diff --git a/SurveyFrontend/package-lock.json b/SurveyFrontend/package-lock.json index 2129a70..38b21e5 100644 --- a/SurveyFrontend/package-lock.json +++ b/SurveyFrontend/package-lock.json @@ -8,6 +8,7 @@ "name": "survey-frontend", "version": "0.0.0", "dependencies": { + "@formkit/tempo": "^0.1.2", "react": "^19.0.0", "react-dom": "^19.0.0", "uuid": "^11.1.0" @@ -842,6 +843,12 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@formkit/tempo": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@formkit/tempo/-/tempo-0.1.2.tgz", + "integrity": "sha512-jNPPbjL8oj7hK3eHX++CwbR6X4GKQt+x00/q4yeXkwynXHGKL27dylYhpEgwrmediPP4y7s0XtN1if/M/JYujg==", + "license": "MIT" + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", diff --git a/SurveyFrontend/package.json b/SurveyFrontend/package.json index 8865293..150e7f9 100644 --- a/SurveyFrontend/package.json +++ b/SurveyFrontend/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@formkit/tempo": "^0.1.2", "react": "^19.0.0", "react-dom": "^19.0.0", "uuid": "^11.1.0" diff --git a/SurveyFrontend/src/components/MainComponent/MainComponent.tsx b/SurveyFrontend/src/components/MainComponent/MainComponent.tsx index 9ee2f41..695dbf5 100644 --- a/SurveyFrontend/src/components/MainComponent/MainComponent.tsx +++ b/SurveyFrontend/src/components/MainComponent/MainComponent.tsx @@ -2,12 +2,16 @@ import Navigation from "../Navigation/Navigation.tsx"; import React, {useState} from "react"; import styles from './MainComponent.module.css' import Survey from "../Survey/Survey.tsx"; +import SettingSurvey from "../SettingSurvey/SettingSurvey.tsx"; const MainComponent: React.FC = () => { - const [activePage, setActivePage] = useState('Вопросы'); + const [activePage, setActivePage] = useState( + localStorage.getItem("activePage") || "Вопросы" + ); const handleNavigationClick = (title: string) => { setActivePage(title); + localStorage.setItem('activePage', title); } return ( @@ -16,7 +20,8 @@ const MainComponent: React.FC = () => { activePage={activePage} onNavigationClick={handleNavigationClick} /> - + { activePage === 'Вопросы' && } + {activePage === 'Настройки' && } ) } diff --git a/SurveyFrontend/src/components/NavigationItem/NavigationItem.tsx b/SurveyFrontend/src/components/NavigationItem/NavigationItem.tsx index 743b9ee..1ef2735 100644 --- a/SurveyFrontend/src/components/NavigationItem/NavigationItem.tsx +++ b/SurveyFrontend/src/components/NavigationItem/NavigationItem.tsx @@ -4,7 +4,7 @@ import styles from './NavigationItem.module.css' interface NavigationItemProps{ title: string; onClick(): void; - isActive: boolean; //Дописать для активной ссылки, для класса + isActive: boolean; } const NavigationItem: React.FC = ({title, onClick, isActive}) => { diff --git a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css new file mode 100644 index 0000000..40b5a44 --- /dev/null +++ b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.module.css @@ -0,0 +1,25 @@ +/*SettingSurvey.module.css*/ + +.settingSurvey{ + width: 65%; + margin-left: 8.9%; +} + +.startEndTime{ + display: flex; + justify-content: space-between; + gap: 14px; +} + +.param{ + background-color: #FFFFFF; + padding-top: 15px; + padding-bottom: 97px; + padding-left: 19px; +} + +.param h2{ + font-size: 24px; + font-weight: 600; + border-radius: 4px; +} \ No newline at end of file diff --git a/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx new file mode 100644 index 0000000..e83f446 --- /dev/null +++ b/SurveyFrontend/src/components/SettingSurvey/SettingSurvey.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import SurveyInfo from "../SurveyInfo/SurveyInfo.tsx"; +import styles from "./SettingSurvey.module.css"; +import TimeEvent from "../TimeEvent/TimeEvent.tsx"; + + +const SettingSurvey: React.FC = () => { + return ( +
+ +
+ + +
+
+

Параметры видимости

+
+
+ ) +} + +export default SettingSurvey; \ No newline at end of file diff --git a/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css b/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css new file mode 100644 index 0000000..4417f66 --- /dev/null +++ b/SurveyFrontend/src/components/TimeEvent/TimeEvent.module.css @@ -0,0 +1,37 @@ +/*TimeEvent.module.css*/ + + +.timeEvent{ + width: 49%; + padding: 17px 25px 48px 20px; + background-color: #FFFFFF; + border-radius: 6px; + margin-bottom: 34px; +} + +.title{ + font-weight: 600; + font-size: 24px; + margin-bottom: 23px; +} + +.datetime{ + display: flex; + justify-content: space-between; +} + +.inputDate{ + border: 3px solid #007AFF26; + padding: 12px 107px 12px 21px; + font-size: 20px; /*??????????????????????? в макете указано bodyLarge/Size*/ + font-weight: 400; + border-radius: 3px; +} + +.inputTime{ + border: 3px solid #007AFF26; + padding: 12px 42px; + font-size: 20px; /*??????????????????????? в макете указано bodyLarge/Size*/ + font-weight: 400; + border-radius: 3px; +} diff --git a/SurveyFrontend/src/components/TimeEvent/TimeEvent.tsx b/SurveyFrontend/src/components/TimeEvent/TimeEvent.tsx new file mode 100644 index 0000000..4b8c810 --- /dev/null +++ b/SurveyFrontend/src/components/TimeEvent/TimeEvent.tsx @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; +import styles from "./TimeEvent.module.css"; + +interface TimeEventProps { + title: string; +} + +const TimeEvent: React.FC = ({ title }) => { + const [date, setDate] = useState(() => { + const now = new Date(); + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); + const day = String(now.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + }); + + const [time, setTime] = useState(() => { + const now = new Date(); + const hours = String(now.getHours()).padStart(2, '0'); + const minutes = String(now.getMinutes()).padStart(2, '0'); + return `${hours}:${minutes}`; + }); + + return ( +
+

{title}

+
+ setDate(e.target.value)} + /> + setTime(e.target.value)} + /> +
+
+ ); +}; + +export default TimeEvent; \ No newline at end of file diff --git a/SurveyFrontend/src/pages/Results.tsx b/SurveyFrontend/src/pages/Results.tsx index e69de29..429ae09 100644 --- a/SurveyFrontend/src/pages/Results.tsx +++ b/SurveyFrontend/src/pages/Results.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import Header from "../components/Header/Header.tsx"; + + +const Results: React.FC = () => { + return ( +
+ ) +} + +export default Results; \ No newline at end of file diff --git a/SurveyFrontend/src/pages/Settings.tsx b/SurveyFrontend/src/pages/Settings.tsx index e69de29..5666a55 100644 --- a/SurveyFrontend/src/pages/Settings.tsx +++ b/SurveyFrontend/src/pages/Settings.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import Header from "../components/Header/Header.tsx"; +import MainComponent from "../components/MainComponent/MainComponent.tsx"; + + +const Settings: React.FC = () => { + return ( + <> +
+ + + ); +}; + +export default Settings; \ No newline at end of file