diff --git a/src/App.tsx b/src/App.tsx index cd5b26e..f599918 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,7 +10,7 @@ import { import { HomePage } from "./pages/HomePage" import { createTheme, ThemeProvider } from "@mui/material/styles" import Container from "@mui/material/Container" -import { IdentityContextProvider } from "./context" +import { IdentityContextProvider } from "./context/identity" import { RegisterPage } from "./pages/RegisterPage" import { LoginPage } from "./pages/LoginPage" import { LeaderboardsPage } from "./pages/LeaderboardsPage" diff --git a/src/adapters/akatsuki-api/authentication.ts b/src/adapters/akatsuki-api/authentication.ts index 171bf6b..78db499 100644 --- a/src/adapters/akatsuki-api/authentication.ts +++ b/src/adapters/akatsuki-api/authentication.ts @@ -1,5 +1,5 @@ import axios from "axios" -import type { Identity } from "../../context" +import type { Identity } from "../../context/identity" interface AuthenticateRequest { username: string diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index c20b923..3358048 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -13,7 +13,10 @@ import { } from "@mui/material" import { Link, useNavigate } from "react-router-dom" import { FavoriteOutlined } from "@mui/icons-material" -import { removeIdentityFromLocalStorage, useIdentityContext } from "../context" +import { + removeIdentityFromLocalStorage, + useIdentityContext, +} from "../context/identity" import { logout } from "../adapters/akatsuki-api/authentication" import { useEffect, useMemo, useState } from "react" import { AkatsukiLogo } from "./images/logos/AkatsukiLogo" diff --git a/src/context.tsx b/src/context/identity.tsx similarity index 97% rename from src/context.tsx rename to src/context/identity.tsx index 8c5d0bd..90c7ff3 100644 --- a/src/context.tsx +++ b/src/context/identity.tsx @@ -1,5 +1,5 @@ import React from "react" -import { UserPrivileges } from "./privileges" +import { UserPrivileges } from "../privileges" const IDENTITY_CACHE_KEY = "identity" diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index eeaf009..f0cd03f 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -7,7 +7,7 @@ import { import { Link } from "react-router-dom" import Stack from "@mui/material/Stack" import { type OverridableStringUnion } from "@mui/types" -import { useIdentityContext } from "../context" +import { useIdentityContext } from "../context/identity" const NavButton = ({ to, diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx index d2ce96a..19071aa 100644 --- a/src/pages/LoginPage.tsx +++ b/src/pages/LoginPage.tsx @@ -1,6 +1,6 @@ import { useState } from "react" import { authenticate } from "../adapters/akatsuki-api/authentication" -import { useIdentityContext } from "../context" +import { useIdentityContext } from "../context/identity" import { useNavigate } from "react-router-dom" import Stack from "@mui/material/Stack" import Alert from "@mui/material/Alert" diff --git a/src/pages/RegisterPage.tsx b/src/pages/RegisterPage.tsx index 488adcf..4067088 100644 --- a/src/pages/RegisterPage.tsx +++ b/src/pages/RegisterPage.tsx @@ -1,4 +1,4 @@ -import { useIdentityContext } from "../context" +import { useIdentityContext } from "../context/identity" export const RegisterPage = () => { const { identity } = useIdentityContext() diff --git a/src/pages/SupportPage.tsx b/src/pages/SupportPage.tsx index 7c7469d..e2d8d6c 100644 --- a/src/pages/SupportPage.tsx +++ b/src/pages/SupportPage.tsx @@ -1,4 +1,4 @@ -import { useIdentityContext } from "../context" +import { useIdentityContext } from "../context/identity" export const SupportPage = () => { const { identity } = useIdentityContext()