Merge branch 'unstable' into 'main'

unstable

See merge request internship-2025/survey-webapp/survey-webapp!22
This commit is contained in:
Tatyana Nikolaeva 2025-05-26 08:21:33 +00:00
commit 7c0ac0c7f2
4 changed files with 30 additions and 12 deletions

View file

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

View file

@ -2,7 +2,7 @@
.settingSurvey{
width: 85%;
height: 100vh;
min-height: 100vh;
}
.startEndTime{

View file

@ -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 (
<div className={styles.settingSurvey}>
{isSettingCreatePage ? (
<SurveyInfo
titleSurvey={titleSurvey}
descriptionSurvey={descriptionSurvey}
setDescriptionSurvey={setDescriptionSurvey}
setTitleSurvey={setTitleSurvey}
/>
) : (
<SurveyInfo
titleSurvey={survey.title}
descriptionSurvey={survey.description}
setDescriptionSurvey={(value) => setSurvey({ ...survey, description: value })}
setTitleSurvey={(value) => setSurvey({ ...survey, title: value })}
/>
)}
<div className={styles.startEndTime}>
<TimeEvent title='Время начала'/>
<TimeEvent title='Время окончания'/>

View file

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