From b4125d264251022453965ae09d748ad6f114c4fb Mon Sep 17 00:00:00 2001 From: Tatiana Nikolaeva Date: Mon, 26 May 2025 13:20:41 +0500 Subject: [PATCH] fix problems with settings --- .../SaveButton/SaveButton.module.css | 1 + .../SettingSurvey/SettingSurvey.module.css | 2 +- .../SettingSurvey/SettingSurvey.tsx | 30 ++++++++++++++----- .../components/TimeEvent/TimeEvent.module.css | 9 ++++-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/SurveyFrontend/src/components/SaveButton/SaveButton.module.css b/SurveyFrontend/src/components/SaveButton/SaveButton.module.css index e4cbd6b..54d2c03 100644 --- a/SurveyFrontend/src/components/SaveButton/SaveButton.module.css +++ b/SurveyFrontend/src/components/SaveButton/SaveButton.module.css @@ -13,4 +13,5 @@ text-align: center; box-shadow: 0 0 7.4px 0 rgba(154, 202, 247, 1); box-sizing: border-box; + margin-bottom: 20px; } diff --git a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css index fd5b485..444399f 100644 --- a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css +++ b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css @@ -2,7 +2,7 @@ .settingSurvey{ width: 85%; - height: 100vh; + min-height: 100vh; } .startEndTime{ diff --git a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx index bec8a4c..a2a6568 100644 --- a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx +++ b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx @@ -1,26 +1,40 @@ -import React from 'react'; +import React, {useState} from 'react'; import SurveyInfo from "../SurveyInfo/SurveyInfo.tsx"; import styles from "./SettingSurvey.module.css"; import TimeEvent from "../TimeEvent/TimeEvent.tsx"; import SaveButton from "../SaveButton/SaveButton.tsx"; import {ISurvey} from "../../api/SurveyApi.ts"; -import {useOutletContext} from "react-router-dom"; +import {useLocation, useOutletContext} from "react-router-dom"; const SettingSurvey: React.FC = () => { + const location = useLocation(); + const isSettingCreatePage = location.pathname.includes('/survey/create'); const { survey, setSurvey } = useOutletContext<{ survey: ISurvey; setSurvey: (survey: ISurvey) => void; }>(); + const [descriptionSurvey, setDescriptionSurvey] = useState(''); + const [titleSurvey, setTitleSurvey] = useState(''); + return (
- setSurvey({ ...survey, description: value })} - setTitleSurvey={(value) => setSurvey({ ...survey, title: value })} - /> + {isSettingCreatePage ? ( + + ) : ( + setSurvey({ ...survey, description: value })} + setTitleSurvey={(value) => setSurvey({ ...survey, title: value })} + /> + )}
diff --git a/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css b/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css index 0809dc9..34b45be 100644 --- a/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css +++ b/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css @@ -2,7 +2,7 @@ .timeEvent{ - width: 49%; + width: 44%; padding: 17px 25px 48px 20px; background-color: #FFFFFF; border-radius: 6px; @@ -18,19 +18,22 @@ .datetime{ display: flex; justify-content: space-between; + gap: 30px; } .inputDate{ + width: fit-content; border: 3px solid #007AFF26; - padding: 12px 107px 12px 21px; + padding: 12px 40px 12px 21px; font-size: 20px; font-weight: 400; border-radius: 3px; } .inputTime{ + width: fit-content; border: 3px solid #007AFF26; - padding: 12px 42px; + padding: 12px 22px; font-size: 20px; font-weight: 400; border-radius: 3px;