diff --git a/src/pages/Summary/Summary.js b/src/pages/Summary/Summary.js index 7c45c91a..1f32e9b6 100644 --- a/src/pages/Summary/Summary.js +++ b/src/pages/Summary/Summary.js @@ -1,3 +1,5 @@ +import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; +import { CKEditor } from "@ckeditor/ckeditor5-react"; import React, { useEffect, useState } from "react"; import { useSelector } from "react-redux"; import { Navigate } from "react-router-dom"; @@ -27,12 +29,27 @@ export const Summary = () => { const profileInfo = useSelector(getProfileInfo); const [openGit, setOpenGit] = useState(false); const [gitInfo, setGitInfo] = useState([]); + const [editSummeryOpen, setEditSummeryOpen] = useState(false); + const [summery, setSummery] = useState(""); useEffect(() => { apiRequest( `/profile/portfolio-projects?card_id=${localStorage.getItem("cardId")}` ).then((responseGit) => setGitInfo(responseGit)); }, []); + + useEffect(() => { + setSummery(profileInfo.vc_text); + }, [profileInfo]); + + function editSummery() { + apiRequest("/resume/edit-text", { + method: "PUT", + data: { + resume: summery, + }, + }).then(() => {}); + } return (
@@ -101,12 +118,47 @@ export const Summary = () => {

Описание опыта работы

- +
-
+ {editSummeryOpen ? ( + { + const data = editor.getData(); + setSummery(data); + }} + /> + ) : ( +
+ )}
)} diff --git a/src/pages/Summary/summary.scss b/src/pages/Summary/summary.scss index 9c950c92..fd3bfc96 100644 --- a/src/pages/Summary/summary.scss +++ b/src/pages/Summary/summary.scss @@ -220,6 +220,11 @@ white-space: nowrap; } } + + .edit { + background-color: green; + color: white; + } } .skills__section { @@ -287,6 +292,15 @@ } } + .ck-toolbar { + border: none !important; + } + + .ck-content { + border: none !important; + padding: 15px 35px 15px 50px !important; + } + &__sectionGit { margin-top: 25px;