fix problems with settings
This commit is contained in:
parent
71a6cdf3ce
commit
b4125d2642
4 changed files with 30 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
.settingSurvey{
|
||||
width: 85%;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.startEndTime{
|
||||
|
|
|
|||
|
|
@ -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='Время окончания'/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue