ticket 17
This commit is contained in:
@ -4,7 +4,7 @@ import classes from "../assets/styles/components/myButton.module.scss"
|
||||
const MyButton = (props) => {
|
||||
|
||||
return (
|
||||
<div className={classes.main}>
|
||||
<div className={classes.main} style={props.mainStyle}>
|
||||
<button
|
||||
type="button"
|
||||
className={classes[props.class]}
|
||||
|
@ -14,7 +14,8 @@ const NavBar = ({navigate, auth, setAuth}) => {
|
||||
auth ?
|
||||
auth.is_admin ?
|
||||
<><span onClick={() => navigate("/forms")}>Мои формы</span>
|
||||
<span onClick={() => navigate("/admin")}>Админ панель</span></> :
|
||||
<span onClick={() => navigate("/admin")}>Админ панель</span>
|
||||
<span onClick={() => navigate("/articles")}>Мои статьи</span></> :
|
||||
<span></span> :
|
||||
<span></span>
|
||||
}
|
||||
|
33
src/components/TextEditor.jsx
Normal file
33
src/components/TextEditor.jsx
Normal file
@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react';
|
||||
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
||||
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
||||
|
||||
const TextEditor = ({data, setData}) => {
|
||||
return (
|
||||
<div className="App">
|
||||
<h2>Редактор статьи</h2>
|
||||
<CKEditor
|
||||
editor={ ClassicEditor }
|
||||
data={data}
|
||||
config = {{
|
||||
mediaEmbed: {previewsInData: true }
|
||||
}}
|
||||
onReady={ editor => {
|
||||
// You can store the "editor" and use when it is needed.
|
||||
console.log( 'Editor is ready to use!', editor );
|
||||
} }
|
||||
onChange={ ( event, editor ) => {
|
||||
setData(editor.getData())
|
||||
}}
|
||||
onBlur={ ( event, editor ) => {
|
||||
console.log( 'Blur.', editor );
|
||||
} }
|
||||
onFocus={ ( event, editor ) => {
|
||||
console.log( 'Focus.', editor );
|
||||
} }
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default TextEditor;
|
Reference in New Issue
Block a user