diff --git a/src/App.jsx b/src/App.jsx index bd053c0..efb6383 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,13 +1,12 @@ import React, { useState } from "react"; -import { RouterProvider, Routes } from "react-router-dom"; -import {FormsData} from "./context"; -import router from "./router/router" +import { Outlet, useNavigate } from "react-router-dom"; +import { FormsData } from "./context"; import classes from "./assets/styles/app.module.scss" import NavBar from "./components/NavBar.jsx"; import 'bootstrap/dist/css/bootstrap.min.css'; const App = () => { - // const navigate = useNavigate(); + const navigate = useNavigate(); const [forms, setForms] = useState([]) return ( @@ -18,12 +17,10 @@ const App = () => {
- +
- - - +
diff --git a/src/assets/styles/enterAccount.module.scss b/src/assets/styles/enterAccount.module.scss new file mode 100644 index 0000000..70e9026 --- /dev/null +++ b/src/assets/styles/enterAccount.module.scss @@ -0,0 +1,103 @@ +.main { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.wrapper { + width: 50%; + height: 70%; +} + +.tabs { + ul { + li { + width: 50%; + cursor: pointer; + a { + text-align: center; + font-family: "Montserrat", sans-serif; + font-size: 12px; + } + } + } +} + +.content { + width: 100%; + height: 100%; + // box-shadow: 0 3px 5px 1px rgb(200, 200, 200); + border: 1px solid rgb(220, 220, 220); + border-top: none; + &__wrapper { + padding: 2%; + width: 100%; + height: 100%; + &__login { + width: 100%; + height: 100%; + &__header { + width: 100%; + height: 20%; + display: flex; + align-items: center; + justify-content: center; + h3 { + display: block; + font-size: 25px; + font-family: "Montserrat", sans-serif; + text-align: center; + color: rgb(100, 100, 100); + } + } + &__body { + width: 100%; + height: 60%; + // border: 1px solid red; + display: flex; + justify-content: space-around; + flex-direction: column; + } + &__footer { + width: 100%; + height: 20%; + } + } + &__register { + width: 100%; + height: 100%; + &__header { + width: 100%; + height: 15%; + display: flex; + align-items: center; + justify-content: center; + h3 { + display: block; + font-size: 25px; + font-family: "Montserrat", sans-serif; + color: rgb(100, 100, 100); + } + } + &__body { + width: 100%; + height: 75%; + display: flex; + justify-content: space-around; + flex-direction: column; + padding-bottom: 5px; + &__fio { + height: 15%; + display: flex; + justify-content: space-between; + } + } + &__footer { + width: 100%; + height: 10%; + } + } + } +} \ No newline at end of file diff --git a/src/assets/styles/profile.module.scss b/src/assets/styles/profile.module.scss new file mode 100644 index 0000000..d1c7750 --- /dev/null +++ b/src/assets/styles/profile.module.scss @@ -0,0 +1,7 @@ +.main { + +} + +.wrapper { + +} \ No newline at end of file diff --git a/src/components/NavBar.jsx b/src/components/NavBar.jsx index 8101fee..bdb82ce 100644 --- a/src/components/NavBar.jsx +++ b/src/components/NavBar.jsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import classes from "../assets/styles/components/navbar.module.scss" -const NavBar = () => { +const NavBar = ({navigate}) => { const [auth, setAuth] = useState(true); return ( @@ -10,18 +10,18 @@ const NavBar = () => {
{auth ?
- Главная - Мои формы + navigate("/")}>Главная + navigate("/forms")}>Мои формы
:
}
{auth ?
- Профиль + navigate("/profile")}>Профиль
:
- Вход + navigate("/enter")}>Вход
}
diff --git a/src/index.js b/src/index.js index ca35289..e89fa3a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,10 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import { BrowserRouter } from 'react-router-dom'; -import App from './App.jsx'; +import { RouterProvider } from 'react-router-dom'; +import router from "./router/router.js" const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - - - + ); \ No newline at end of file diff --git a/src/pages/EnterAccount.jsx b/src/pages/EnterAccount.jsx new file mode 100644 index 0000000..e5f2b60 --- /dev/null +++ b/src/pages/EnterAccount.jsx @@ -0,0 +1,62 @@ +import React, { useState } from "react"; +import classes from "../assets/styles/enterAccount.module.scss"; +import MyInput from "../components/MyInput.jsx"; +import MyButton from "../components/MyButton.jsx"; + +const EnterAccount = ({navigate}) => { + const [enter, setEnter] = useState("login"); + + return ( +
+
+
+ +
+
+
+ {enter === 'login' ?
+
+

Войти в аккаунт

+
+
+ + +
+
+ +
+
: +
+
+

Зарегестрировать учетную запись

+
+
+ + +
+ + + +
+ + +
+
+ +
+
} +
+
+
+
+ ) +} + +export default EnterAccount; \ No newline at end of file diff --git a/src/pages/Profile.jsx b/src/pages/Profile.jsx new file mode 100644 index 0000000..401d8e1 --- /dev/null +++ b/src/pages/Profile.jsx @@ -0,0 +1,14 @@ +import React, { useState } from "react"; +import classes from "../assets/styles/profile.module.scss" + +const Profile = ({navigate}) => { + return ( +
+
+ +
+
+ ) +} + +export default Profile; \ No newline at end of file diff --git a/src/router/router.js b/src/router/router.js index 4864159..2ff7e8c 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -1,22 +1,39 @@ import React from 'react'; import { createBrowserRouter } from "react-router-dom"; import Forms from '../pages/Forms.jsx'; +import EnterAccount from "../pages/EnterAccount.jsx" import NewForm from '../pages/NewForm.jsx'; import Home from "../pages/Home.jsx"; +import App from "../App.jsx"; +import Profile from "../pages/Profile.jsx"; const router = createBrowserRouter([ { - path: "/", - element: , - }, - { - path: "/forms", - element: , - }, - { - path: '/forms/edit/', - element: + element: , + children: [ + { + path: "/", + element: , + }, + { + path: "/forms", + element: , + }, + { + path: '/forms/edit/', + element: + }, + { + path: '/enter', + element: + }, + { + path: '/profile', + element: + } + ] } + ]); export default router \ No newline at end of file