diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ef6a52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/app/AuthPage.jsx b/app/AuthPage.jsx new file mode 100644 index 0000000..86639fc --- /dev/null +++ b/app/AuthPage.jsx @@ -0,0 +1,141 @@ +"use client"; + +import React, { useState } from "react"; +import { useRouter } from "next/navigation"; + + +const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + +const AuthPage = () => { + const router = useRouter(); + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [rememberMe, setRememberMe] = useState(false); + const [checkboxError, setCheckboxError] = useState(false); + + const isEmailValid = emailRegex.test(email); + const isFormValid = isEmailValid && password.length > 0; + + const handleSubmit = (e) => { + e.preventDefault(); + + // проверка чекбокса + if (!rememberMe) { + setCheckboxError(true); + return; + } + + setCheckboxError(false); + + if (!isFormValid) return; + + console.log("Email:", email, "Password:", password, "Remember:", rememberMe); + router.push('./home'); + }; + + return ( +
+
+ {/* Красный баннер ошибки по чекбоксу */} + {checkboxError && ( +
+ Вы не согласны с условиями использования +
+ )} + +

+ Авторизация +

+ {/*

+ как пользователь +

*/} + +
+ {/* Почта */} +
+ + setEmail(e.target.value)} + className="w-full rounded-full bg-white px-4 py-2 text-sm font-montserrat text-black outline-none focus:ring-2 focus:ring-blue-200" + /> + {!isEmailValid && email.length > 0 && ( +

+ Введите корректный email +

+ )} +
+ + {/* Пароль */} +
+ + setPassword(e.target.value)} + className="w-full rounded-full bg-white px-4 py-2 text-sm font-montserrat text-black outline-none focus:ring-2 focus:ring-blue-200" + /> +
+ + {/* Чекбокс */} +
+ +

+ Подтверждаю, что я прочитал условия использования данного приложения +

+
+ + + {/* Ссылки */} +
+ + +
+ + {/* Кнопка Войти */} + +
+
+
+ ); +}; + +export default AuthPage; diff --git a/app/components/RequestDetailsModal.jsx b/app/components/RequestDetailsModal.jsx new file mode 100644 index 0000000..1aa4d5a --- /dev/null +++ b/app/components/RequestDetailsModal.jsx @@ -0,0 +1,161 @@ +import React, { useState } from "react"; +import { FaStar } from "react-icons/fa"; + +const RequestDetailsModal = ({ request, onClose }) => { + const isDone = request.status === "Выполнена"; + const isRejected = request.status === "Отклонена"; + + const [rating, setRating] = useState(0); + const [review, setReview] = useState(""); + const [rejectFeedback, setRejectFeedback] = useState(""); + + const handleStarClick = (value) => { + setRating(value); + }; + + const handleSubmit = () => { + console.log("Оставить отзыв:", { + id: request.id, + status: request.status, + rating, + review, + rejectFeedback, + }); + onClose(); + }; + + return ( +
+ {/* Заголовок */} +
+ +

+ Заявка от {request.createdAt} +

+ +
+ + {/* Белая карточка как на макете */} +
+
+ {/* Статус + срок (берём цвет и текст из заявки) */} +
+ + {request.status} + +
+

+ {request.date} +

+

+ {request.time} +

+
+
+ + {/* Название задачи */} +

+ {request.title} +

+ + {/* ВЫПОЛНЕНА: голубой блок с отзывом как было */} + {isDone && ( +
+

+ Отзыв +

+