From ca2e917fc48a91e55fdf0c5a6dca962079359432 Mon Sep 17 00:00:00 2001 From: Mikola Date: Thu, 30 Nov 2023 16:42:50 +0300 Subject: [PATCH] editSummary --- src/pages/Summary/Summary.js | 104 +++++++++++++++++------------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/pages/Summary/Summary.js b/src/pages/Summary/Summary.js index 68f11b62..1f32e9b6 100644 --- a/src/pages/Summary/Summary.js +++ b/src/pages/Summary/Summary.js @@ -1,8 +1,8 @@ +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"; -import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; -import { CKEditor } from "@ckeditor/ckeditor5-react"; import { getProfileInfo } from "@redux/outstaffingSlice"; @@ -29,8 +29,8 @@ 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('') + const [editSummeryOpen, setEditSummeryOpen] = useState(false); + const [summery, setSummery] = useState(""); useEffect(() => { apiRequest( @@ -39,19 +39,17 @@ export const Summary = () => { }, []); useEffect(() => { - setSummery(profileInfo.vc_text) - }, [profileInfo]) + setSummery(profileInfo.vc_text); + }, [profileInfo]); - function editSummery() { - apiRequest("/resume/edit-text", { - method: "PUT", - data: { - resume: summery - }, - }).then(() => { - - }); - } + function editSummery() { + apiRequest("/resume/edit-text", { + method: "PUT", + data: { + resume: summery, + }, + }).then(() => {}); + } return (
@@ -120,45 +118,47 @@ export const Summary = () => {

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

- -
- {editSummeryOpen ? - { - const data = editor.getData(); - setSummery(data); - }} - /> - : -
-
- } + {editSummeryOpen ? "Сохранить" : "Редактировать раздел"} + +
+ {editSummeryOpen ? ( + { + const data = editor.getData(); + setSummery(data); + }} + /> + ) : ( +
+ )}
)}