Skip to content

Commit 0401437

Browse files
committed
feat: the big refactor
1 parent cbeb470 commit 0401437

29 files changed

+34
-49
lines changed

src/components/Layout/Footer.tsx renamed to src/app/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from "react";
55
import { BottomNavigation, Box } from "@mui/material";
66
import { getBaseUrl } from "@/util/url";
77
import { ThemeAppearanceToggle } from "./ThemeAppearanceToggle";
8-
import { MuiLink } from "../MuiLink";
8+
import { MuiLink } from "@/components/MuiLink";
99
import { useIsDesktop } from "@/hooks/useIsDesktop";
1010
import { useIsResumePage } from "@/hooks/useIsResumePage";
1111
import { useIsLoggedIn } from "@/hooks/useIsLoggedIn";
File renamed without changes.

src/components/Layout/Layout.tsx renamed to src/app/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, { useContext } from "react";
55
import { AppRouterCacheProvider } from "@mui/material-nextjs/v14-appRouter";
66
import CssBaseline from "@mui/material/CssBaseline";
77
import { Footer } from "./Footer";
8-
import { ThemeAppearanceContext } from "@/context/ThemeContext";
8+
import { ThemeAppearanceContext } from "./ThemeContext";
99
import { Container, ThemeProvider } from "@mui/material";
1010
import { createTheme } from "@mui/material";
1111
import { usePathname } from "next/navigation";

src/components/Layout/NavPrimary.tsx renamed to src/app/components/NavPrimary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useState } from "react";
2-
import { MuiLink } from "../MuiLink";
32
import { useSession } from "next-auth/react";
43
import { getBaseUrl } from "@/util/url";
54
import { ThemeAppearanceToggle } from "./ThemeAppearanceToggle";
5+
import { MuiLink } from "@/components/MuiLink";
66
import { useIsLoggedIn } from "@/hooks/useIsLoggedIn";
77
import Drawer from "@mui/material/Drawer";
88
import List from "@mui/material/List";

src/components/Layout/ThemeAppearanceToggle.tsx renamed to src/app/components/ThemeAppearanceToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Icon } from "@iconify/react";
22

33
import { Box, Switch } from "@mui/material";
4-
import { ThemeAppearanceContext } from "@/context/ThemeContext";
4+
import { ThemeAppearanceContext } from "./ThemeContext";
55
import { useContext } from "react";
66

77
export const ThemeAppearanceToggle = () => {
File renamed without changes.

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import "./globals.scss";
22

33
import { GoogleTagManager } from "@next/third-parties/google";
4-
import { Layout } from "@/components/Layout/Layout";
5-
import { ThemeAppearanceProvider } from "@/context/ThemeContext";
4+
import { Layout } from "./components/Layout";
5+
import { ThemeAppearanceProvider } from "./components/ThemeContext";
66
import localFont from "next/font/local";
77

88
const geistSans = localFont({

src/components/sections/Education/Education.tsx renamed to src/app/r/[slug]/components/Education/Education.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import React, { useContext } from "react";
44

5-
import { DataContext } from "@/context/DataContext";
5+
import { ResumeContext } from "../ResumeContext";
66
import type { Education as EducationType } from "@prisma/client";
77
import { formatDate } from "@/lib/format";
88
import styles from "./Education.module.scss";
99

1010
export const Education = () => {
11-
const { education } = useContext(DataContext);
11+
const { education } = useContext(ResumeContext);
1212

1313
// Group education by school name. This was a simpler
1414
// approach than to create a separate type speficially to group

src/context/DataContext.tsx renamed to src/app/r/[slug]/components/ResumeContext.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ import { SkillForUserWithSkill } from "@/graphql/getSkills";
55
import { Company, Education } from "@prisma/client";
66
import { createContext } from "react";
77

8-
interface DataProviderProps {
8+
interface ResumeProviderProps {
99
skills: SkillForUserWithSkill[];
1010
companies: Company[];
1111
positions: PositionWithProjects[];
1212
education: Education[];
1313
}
1414

15-
export const DataContext = createContext<DataProviderProps>({
15+
export const ResumeContext = createContext<ResumeProviderProps>({
1616
skills: [],
1717
companies: [],
1818
positions: [],
1919
education: [],
2020
});
2121

22-
export const DataProvider = ({
22+
export const ResumeProvider = ({
2323
children,
2424
skills,
2525
companies,
2626
positions,
2727
education,
28-
}: DataProviderProps & { children?: React.ReactNode }) => (
29-
<DataContext.Provider value={{ skills, companies, positions, education }}>
28+
}: ResumeProviderProps & { children?: React.ReactNode }) => (
29+
<ResumeContext.Provider value={{ skills, companies, positions, education }}>
3030
{children}
31-
</DataContext.Provider>
31+
</ResumeContext.Provider>
3232
);

0 commit comments

Comments
 (0)