From b45991ed265604625f28a02df335caf638da7458 Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:45:13 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B0=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab5/data.json | 2 +- Lab5/src/App.jsx | 19 +++--- Lab5/src/components/lines/News/UpdateNews.jsx | 33 +++++++++- .../components/logins/hooks/EntrysDataHook.js | 6 +- Lab5/src/components/logins/hooks/Reducer.js | 0 .../logins/login/{ => Entry}/Entry.jsx | 49 +++++++++++--- .../components/logins/login/Registration.jsx | 4 +- .../logins/login/context/AuthContext.jsx | 66 +++++++++++++++++++ Lab5/src/main.jsx | 2 +- Lab5/src/pages/Page4.jsx | 2 +- 10 files changed, 153 insertions(+), 30 deletions(-) create mode 100644 Lab5/src/components/logins/hooks/Reducer.js rename Lab5/src/components/logins/login/{ => Entry}/Entry.jsx (60%) create mode 100644 Lab5/src/components/logins/login/context/AuthContext.jsx diff --git a/Lab5/data.json b/Lab5/data.json index 50b2e59..fb53e45 100644 --- a/Lab5/data.json +++ b/Lab5/data.json @@ -4,7 +4,7 @@ "id": 0, "login": "dyctator", "password": "12345", - "role": "user" + "role": "admin" }, { "login": "user", diff --git a/Lab5/src/App.jsx b/Lab5/src/App.jsx index 5369184..33446e0 100644 --- a/Lab5/src/App.jsx +++ b/Lab5/src/App.jsx @@ -5,17 +5,20 @@ import { Outlet } from 'react-router-dom'; import { CartProvider } from './components/cart/CartContext.jsx'; import Footer from './components/footer/Footer.jsx'; import Navigation from './components/navigation/Navigation.jsx'; +import { AuthProvider } from './components/logins/login/context/AuthContext.jsx'; const App = ({ routes }) => { return ( - - - - - -