From 986ce3a72571264c81732a7b0ffa3da43a977402 Mon Sep 17 00:00:00 2001 From: kuwsh1n Date: Sat, 9 Mar 2024 03:15:43 +0300 Subject: [PATCH] add home page --- src/App.jsx | 10 +-- .../styles/components/navbar.module.scss | 58 ++++++++++++++++ src/assets/styles/home.module.scss | 68 +++++++++++++++++++ src/components/MyInput.jsx | 4 +- src/components/NavBar.jsx | 22 +++++- src/index.js | 5 +- src/pages/Home.jsx | 29 +++++++- 7 files changed, 184 insertions(+), 12 deletions(-) create mode 100644 src/assets/styles/home.module.scss diff --git a/src/App.jsx b/src/App.jsx index 0a179bc..bd053c0 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { RouterProvider } from "react-router-dom"; +import { RouterProvider, Routes } from "react-router-dom"; import {FormsData} from "./context"; import router from "./router/router" import classes from "./assets/styles/app.module.scss" @@ -7,6 +7,7 @@ import NavBar from "./components/NavBar.jsx"; import 'bootstrap/dist/css/bootstrap.min.css'; const App = () => { + // const navigate = useNavigate(); const [forms, setForms] = useState([]) return ( @@ -20,12 +21,13 @@ const App = () => {
- + + +
- - + ) } diff --git a/src/assets/styles/components/navbar.module.scss b/src/assets/styles/components/navbar.module.scss index 2952fe9..96d4e88 100644 --- a/src/assets/styles/components/navbar.module.scss +++ b/src/assets/styles/components/navbar.module.scss @@ -6,4 +6,62 @@ .wrapper { width: 100%; height: 100%; + display: flex; + justify-content: space-between; + align-items: center; +} + +.menu { + width: 80%; + height: 100%; + &__authorized { + height: 100%; + display: flex; + align-items: center; + span { + margin-left: 2%; + display: block; + font-size: 15px; + color: rgb(80, 80, 80); + cursor: pointer; + &:hover { + color: rgb(66, 68, 189); + text-decoration: underline; + } + } + } +} + +.profile { + width: 20%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + &__authorized { + span { + font-size: 15px; + color: rgb(80, 80, 80); + cursor: pointer; + &:hover { + color: rgb(66, 68, 189); + text-decoration: underline; + } + } + } + &__nonAuthorized { + span { + font-size: 15px; + font-family: "Montserrat", sans-serif; + color: rgb(80, 80, 80); + cursor: pointer; + i { + + } + &:hover { + color: rgb(66, 68, 189); + text-decoration: underline; + } + } + } } \ No newline at end of file diff --git a/src/assets/styles/home.module.scss b/src/assets/styles/home.module.scss new file mode 100644 index 0000000..01ee942 --- /dev/null +++ b/src/assets/styles/home.module.scss @@ -0,0 +1,68 @@ +.main { + width: 100%; + height: 100%; +} + +.wrapper { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.header { + width: 60%; + height: 30%; + text-align: center; + &__top { + font-size: 30px; + font-family: "Montserrat", sans-serif; + color: rgb(100, 100, 100); + } + &__bottom { + font-size: 30px; + font-family: "Montserrat", sans-serif; + color: rgb(100, 100, 100); + } +} + +.content { + width: 60%; + height: 50%; + box-shadow: 0 0 5px 1px rgb(180, 180, 180); + padding: 1% 0; + &__title { + height: 30%; + display: flex; + justify-content: center; + align-items: center; + &__wrapper { + h3 { + font-size: 35px; + font-family: "Montserrat", sans-serif; + color: rgb(100, 100, 100); + } + } + } + &__token { + height: 50%; + display: flex; + justify-content: center; + align-items: center; + &__wrapper { + height: 35%; + width: 80%; + } + } + &__search { + height: 20%; + display: flex; + justify-content: center; + align-items: center; + &__wrapper { + height: 70%; + } + } +} \ No newline at end of file diff --git a/src/components/MyInput.jsx b/src/components/MyInput.jsx index d5e40a8..4a7368e 100644 --- a/src/components/MyInput.jsx +++ b/src/components/MyInput.jsx @@ -3,8 +3,8 @@ import classes from "../assets/styles/components/myInput.module.scss" const MyInput = (props) => { return ( -
- +
+
) } diff --git a/src/components/NavBar.jsx b/src/components/NavBar.jsx index f0feccf..8101fee 100644 --- a/src/components/NavBar.jsx +++ b/src/components/NavBar.jsx @@ -1,13 +1,29 @@ -import React from "react"; -import { Link, BrowserRouter, useNavigate } from "react-router-dom"; +import React, { useState } from "react"; import classes from "../assets/styles/components/navbar.module.scss" const NavBar = () => { + const [auth, setAuth] = useState(true); return (
- +
+ {auth ? +
+ Главная + Мои формы +
: +
} +
+
+ {auth ? +
+ Профиль +
: +
+ Вход +
} +
) diff --git a/src/index.js b/src/index.js index 4318abb..ca35289 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,12 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; import App from './App.jsx'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + + + ); \ No newline at end of file diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index 91d3a01..9397167 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -1,9 +1,34 @@ import React from "react"; +import classes from "../assets/styles/home.module.scss"; +import MyButton from "../components/MyButton.jsx"; +import MyInput from "../components/MyInput.jsx"; const Home = () => { return ( -
- Home +
+
+
+
Кажется вы попали на общую страницу.
+
Чтобы перейти к форме ввелите токен ниже или снова перейдите по ссылке.
+
+
+
+
+

Перейти к нужной форме

+
+
+
+
+ +
+
+
+
+ +
+
+
+
) }