mirror of
https://github.com/evgen-app/evgen-app-front-template.git
synced 2024-11-28 18:03:43 +03:00
fix bugs
This commit is contained in:
parent
854baf27a2
commit
0dd50d7299
|
@ -6,6 +6,10 @@ import { Route, useRouteMatch, Switch } from "react-router";
|
||||||
import {useUpdateDocMutation} from "../../generated/graphql"
|
import {useUpdateDocMutation} from "../../generated/graphql"
|
||||||
import {Document} from "../../uiKit/Documents/Document/Document"
|
import {Document} from "../../uiKit/Documents/Document/Document"
|
||||||
|
|
||||||
|
function createDoc(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
export const BaseScreen:react.FC = () => {
|
export const BaseScreen:react.FC = () => {
|
||||||
let {url} = useRouteMatch();
|
let {url} = useRouteMatch();
|
||||||
const {loading, data} = useGetMaterialsQuery({variables:{token:localStorage.getItem("token")}});
|
const {loading, data} = useGetMaterialsQuery({variables:{token:localStorage.getItem("token")}});
|
||||||
|
@ -35,6 +39,7 @@ export const BaseScreen:react.FC = () => {
|
||||||
<Document></Document>
|
<Document></Document>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={url}>
|
<Route path={url}>
|
||||||
|
<button onClick={}></button>
|
||||||
<div>
|
<div>
|
||||||
{data && data?.materialsByUser?.map( materials =>
|
{data && data?.materialsByUser?.map( materials =>
|
||||||
<DocumentCard
|
<DocumentCard
|
||||||
|
|
|
@ -28,7 +28,9 @@ export const Document:React.FC = () =>{
|
||||||
function onChange(state:any){
|
function onChange(state:any){
|
||||||
updateDoc({variables:{id:docID, content:JSON.stringify(convertToRaw(state))}})
|
updateDoc({variables:{id:docID, content:JSON.stringify(convertToRaw(state))}})
|
||||||
}
|
}
|
||||||
|
// let a = {"entityMap":{},"blocks":[{"key":"637gr","text":"Initialized from content state.","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}]};
|
||||||
|
// updateDoc({variables:{id:docID, content:JSON.stringify(a)}})
|
||||||
|
|
||||||
|
|
||||||
let state = convertFromRaw(JSON.parse(data.material.content))
|
let state = convertFromRaw(JSON.parse(data.material.content))
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ export class MyUserComponentEditor extends React.Component {
|
||||||
|
|
||||||
|
|
||||||
test = (e) =>{
|
test = (e) =>{
|
||||||
|
console.log(e)
|
||||||
this.Type_task = e.target.innerText
|
this.Type_task = e.target.innerText
|
||||||
this.confirmMedia()
|
this.confirmMedia()
|
||||||
};
|
};
|
||||||
|
@ -50,10 +51,10 @@ export class MyUserComponentEditor extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div onClick={this.stopPropagation}>
|
<div onClick={this.stopPropagation}>
|
||||||
<div className="wrapper">
|
<div className="wrapper">
|
||||||
<DefaultButton handleClick={(e)=>this.test(e)} id={1} class="taskButton">Прочитать текст</DefaultButton>
|
<button onClick={(e)=>this.test(e)} id={1} class="taskButton">Прочитать текст</button>
|
||||||
<DefaultButton handleClick={(e)=>this.test(e)} id={2} class="taskButton">выбрать правильный вариант ответа</DefaultButton>
|
<button handleClick={(e)=>this.test(e)} id={2} class="taskButton">выбрать правильный вариант ответа</button>
|
||||||
<DefaultButton handleClick={(e)=>this.test(e)} id={3} class="taskButton">правда/ложь</DefaultButton>
|
<button handleClick={(e)=>this.test(e)} id={3} class="taskButton">правда/ложь</button>
|
||||||
<DefaultButton handleClick={(e)=>this.test(e)} id={4} class="taskButton">расставить заголвки</DefaultButton>
|
<button handleClick={(e)=>this.test(e)} id={4} class="taskButton">расставить заголвки</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -155,6 +156,8 @@ const Media = (props) => {
|
||||||
const type = entity.getType();
|
const type = entity.getType();
|
||||||
|
|
||||||
let media;
|
let media;
|
||||||
|
media = <div>audio</div>;
|
||||||
|
|
||||||
if (type === 'audio') {
|
if (type === 'audio') {
|
||||||
media = <div>audio</div>;
|
media = <div>audio</div>;
|
||||||
} else if (type === "Прочитать текст") {
|
} else if (type === "Прочитать текст") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user