ticket 17

This commit is contained in:
kuwsh1n
2024-06-25 13:52:14 +03:00
parent 133ed782aa
commit 0e7f962645
13 changed files with 888 additions and 2 deletions

View File

@ -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]}

View File

@ -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>
}

View 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;