From dc3efd780bb74952c1b0cdb1273c0099f714dc10 Mon Sep 17 00:00:00 2001 From: Aleksandre Date: Sun, 24 Aug 2025 23:41:06 +0400 Subject: [PATCH 01/81] feat: Introduce Settings page --- src/Pages/settings.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/Pages/settings.tsx diff --git a/src/Pages/settings.tsx b/src/Pages/settings.tsx new file mode 100644 index 0000000..914046d --- /dev/null +++ b/src/Pages/settings.tsx @@ -0,0 +1,9 @@ +const SettingsPage = () => { + return ( +
+

Settings

+
+ ); +}; + +export default SettingsPage; From 785acf874943dda4051124ea164801b2ed730e62 Mon Sep 17 00:00:00 2001 From: Aleksandre Date: Sun, 24 Aug 2025 23:41:06 +0400 Subject: [PATCH 02/81] refactor: Improve UserContext authentication handling and types --- src/Contexts/UserContext.tsx | 7 ++++--- src/Types/types.ts | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Contexts/UserContext.tsx b/src/Contexts/UserContext.tsx index 3c20648..20ceb1a 100644 --- a/src/Contexts/UserContext.tsx +++ b/src/Contexts/UserContext.tsx @@ -8,7 +8,7 @@ import React, { import api from "../Services/apiService"; import { Authenticate } from "../Services/authService"; import { HandleErr } from "../Services/errorHandler"; -import { User, UserContextType } from "../Types/types"; +import { User, UserContextType, ValidationResponse } from "../Types/types"; import { useError } from "./ErrorContext"; import { useLoading } from "./LoadingContext"; import { useNotification } from "./NotificationContext"; @@ -37,10 +37,11 @@ export const UserProvider: React.FC<{ children: ReactNode }> = ({ try { const data = await Authenticate(); + console.log(data); - if (data.authenticated) { + if (data) { setAuthenticated(true); - setUser(data.user); + setUser(data as User); setNotification("Logged back in"); } else { setUser(null); diff --git a/src/Types/types.ts b/src/Types/types.ts index c9e5f63..6152cbd 100644 --- a/src/Types/types.ts +++ b/src/Types/types.ts @@ -53,12 +53,17 @@ export interface LoginProps { } export interface User { - id: string; + id: string | null; email: string | null; username: string | null; type: string | null; } +export interface ValidationResponse { + id: string | null; + email: string | null; +} + export interface UserContextType { user: User | null; authenticated: boolean; From 4db316a83968cbd93ad8eee740047d5ffd47d2fc Mon Sep 17 00:00:00 2001 From: Aleksandre Date: Sun, 24 Aug 2025 23:41:06 +0400 Subject: [PATCH 03/81] style: Add horizontal padding to main content areas and minor layout cleanup --- src/Layouts/ChapterPageLayout.tsx | 3 ++- src/Layouts/HeroPageLayout.tsx | 3 +-- src/Layouts/NovelsPageLayout.tsx | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Layouts/ChapterPageLayout.tsx b/src/Layouts/ChapterPageLayout.tsx index 73a12d7..94ec1b1 100644 --- a/src/Layouts/ChapterPageLayout.tsx +++ b/src/Layouts/ChapterPageLayout.tsx @@ -1,4 +1,5 @@ import { Outlet } from "react-router-dom"; + import Footer from "../Components/Footer"; import Navbar from "../Components/Navbar"; import ScrollButtons from "../Components/ScrollButtons"; @@ -7,7 +8,7 @@ const ChapterPageLayout = () => { return (
-
+
diff --git a/src/Layouts/HeroPageLayout.tsx b/src/Layouts/HeroPageLayout.tsx index d47f3ee..0ddb4e5 100644 --- a/src/Layouts/HeroPageLayout.tsx +++ b/src/Layouts/HeroPageLayout.tsx @@ -1,6 +1,5 @@ import { Outlet } from "react-router-dom"; -// Components import Navbar from "../Components/Navbar"; import Footer from "../Components/Footer"; @@ -11,7 +10,7 @@ const HeroPageLayout = () => { return (
-
+