From 2d2c04af0c44b28d29506bfbf7d6de2ad3ef67d8 Mon Sep 17 00:00:00 2001 From: Maria Torrente <64274966+mariatorrentedev@users.noreply.github.com> Date: Mon, 1 Jul 2024 15:12:11 -0400 Subject: [PATCH] Develop (#40) * Some clean up, added Spotify icon for offline/loading state * Minor clean up in Mobile view * Updating about text. * Fixing max width for the Tab Panel * P-18: fixed bug when type is not track * P-20: Add real time spotify streaming progress bar. (#21) * P-23: Added experience section. (#24) * P-26: Added placeholder projects section. (#27) * Wip footer. * develop: some footer updates, brb. * develop: simple footer. * P-11 (#31) * P-11: added vitest, react testing library config for unit testing. * P-11: add Projects unit test. * P-11: fix bg card color. * P-11 (#32) * P-11: added vitest, react testing library config for unit testing. * P-11: add Projects unit test. * P-11: fix bg card color. * P-11: almost done, missing Github actions and TODOS in test. * Update src/components/Navigation/Navigation.test.tsx * theme-mode: add dark/light mode. (#38) --- src/App.tsx | 28 ++++++++++--- src/assets/mt-dark.png | Bin 0 -> 8027 bytes src/assets/mt-light.png | Bin 0 -> 7637 bytes src/components/Experience/Experience.tsx | 2 +- src/components/Footer/Footer.tsx | 23 ++++++---- src/main.tsx | 7 ++-- src/{theme.ts => mui/base-theme.ts} | 16 +------ src/mui/palettes.ts | 36 ++++++++++++++++ src/mui/theme-context.tsx | 51 +++++++++++++++++++++++ 9 files changed, 129 insertions(+), 34 deletions(-) create mode 100644 src/assets/mt-dark.png create mode 100644 src/assets/mt-light.png rename src/{theme.ts => mui/base-theme.ts} (77%) create mode 100644 src/mui/palettes.ts create mode 100644 src/mui/theme-context.tsx diff --git a/src/App.tsx b/src/App.tsx index daf996c..d4e3b52 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,9 @@ +import * as React from "react"; import type { Icon } from "./types/shared"; import { Grid, Typography, Link, IconButton } from "@mui/material"; -import { GitHub, LinkedIn } from "@mui/icons-material"; +import { GitHub, LinkedIn, LightMode, DarkMode } from "@mui/icons-material"; import { Navigation, Footer } from "./components"; +import { ThemeContext } from "./mui/theme-context"; const icons: Icon[] = [ { @@ -17,6 +19,8 @@ const icons: Icon[] = [ ]; export default function App() { + const { theme, toggleTheme } = React.useContext(ThemeContext); + return ( <> + + + {theme.palette.mode === "dark" ? : } + + + Hey there! @@ -45,7 +55,14 @@ export default function App() { meaningful experiences. - + {icons.map((item, index) => ( ))} - - + 23L?jT}AlNcR<}k>l7$yO=L2w{IWC{t8Kp+f4I1m*CWmFpw zL{vmH%Gk^_iqas7K@b#zibzl(G6{mh+j#nTyZgNN*1hN6Ki*sGu-3QucI~R#Rlgc` zB{}2lWV>EMK>~uH^|<{ut`G#9TYJRT0ZM1z@LBLrJY@e73Irh@tUa*oU5ITEB)Tc! zkUQ1g(E;m24%Wi^lD!F9k-;H=8-h$DvEVhBK*ggXgNY;xHquP(8wVD=uaULY%q392 z|CxsQp2WJ^?E9S+tjyH>snigxwlFa}~22hEFzZh;wr2d6M3|R97OT?4>%+w+^eF-P=;Y6yMxfK!b6NGZ} z5154_P!422GD;JrYpT6wJTc%8+P_i$e4zIK z#;k8_e?Z}11jv#~4GZx84ibr?h5tqgUqe<41YH~Ny9SfapJ4jC6xPz0@(07$JUK`R z{R;&EwYCw052FwcMTHQ|)LaP^a(I{z;g8wzyF%+Q0-j3nHQ%kXTTfHRP*VqEs{NO( z?*TUbePeGV73XX2N)d*azSw3nni{W-f!0c%Qi7nPP8=A@;@{7|fC0O*kN%<&hI&ir{@fV- z;DY$l);^CLn0EFQ5>i>9bhC%Hr%jw(fS^}l3cr52 z)MJFLkEVy`^r~=~fm`&ulN}9@J-NPX+m?!-Yiq|hS~^>%x?6rpbl-f|S;SISLsrkl zRyVYLAb_{o#BHMGbm8IFJ&Wo6GFczlzvY_=1u@6l|bmZiSF5EVru`@yf*|T_6)Z{HvNd8PXF1o?GP*E0p{hsxB?=ne%YB_&| zwM|tsdd%X8I@RGr{Iz9Zy)~hA(J=XvGymelb8^H1piWPY$h_u=YY=UFrcUh&9AZq) zBVbZp7+l`LR);l;3)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S8d_@FP_nAOV4ineqYMJY?Yt<#o}$(J$eQ=s;!?L zk1h2&&}supagk&yoD;=pQz*3JUwhXg?0H1%xkAeYpqo#}xoGv})6G@#?g4z8&-C~q z<`}(NEo)<-Z{HNU*(z|Um@muhOB{ntx7~(<%8=AAZEHG7t8;@x)aymHZXMLc%o*)( zuVSg8aL9VR$5lJPLeY9(!*rcY;Ml|Of#k2Iz1mAzp5#WxOvh4|OGp5#hiN}T*K=iO ziLN-^5hVpKC^B0nx1SzQ)`aa8XTmH(ve}QZg~4H4xl#WX{PTE})vUtUzr;xGTR^|q zqS;4<31^!lAKhK$=b80eV7qG2iCnGO+<@J@F}f@kf^r~ng|Pl|z5Od6i99F}lVxni Q`o}Bg_(=nro^#lL0IFJNZvX%Q literal 0 HcmV?d00001 diff --git a/src/components/Experience/Experience.tsx b/src/components/Experience/Experience.tsx index 8f76e47..96b2e0d 100644 --- a/src/components/Experience/Experience.tsx +++ b/src/components/Experience/Experience.tsx @@ -64,7 +64,7 @@ export default function Experience() { color="secondary" href={item.url} target="_blank" - sx={{ padding: "8px 0" }} + sx={{ padding: "0", borderRadius: 0, border: "0.5px solid" }} > {item.name} diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 0c7744f..5c56a2b 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,19 +1,24 @@ +import * as React from "react"; import { Typography, Container, Stack, IconButton } from "@mui/material"; -import MTLogo from "../../assets/mt.png"; +import MTLogoDark from "../../assets/mt-dark.png"; +import MTLogoLight from "../../assets/mt-light.png"; +import { ThemeContext } from "../../mui/theme-context"; export default function Footer() { + const { theme } = React.useContext(ThemeContext); + return ( - - Maria Torrente + + Maria Torrente - © Maria Torrente 2024 + + Made with ♡ by Maria Torrente © 2024 + ); diff --git a/src/main.tsx b/src/main.tsx index 10b060d..8bfe6a8 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,8 +1,7 @@ import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App.tsx"; -import { theme } from "./theme"; -import ThemeProvider from "@mui/material/styles/ThemeProvider"; +import { ThemeProviderWrapper } from "./mui/theme-context.tsx"; import CssBaseline from "@mui/material/CssBaseline"; import { QueryClient, QueryClientProvider } from "react-query"; @@ -11,10 +10,10 @@ const queryClient = new QueryClient(); ReactDOM.createRoot(document.getElementById("root")!).render( - + - + ); diff --git a/src/theme.ts b/src/mui/base-theme.ts similarity index 77% rename from src/theme.ts rename to src/mui/base-theme.ts index 6c1103f..218138e 100644 --- a/src/theme.ts +++ b/src/mui/base-theme.ts @@ -1,17 +1,7 @@ +import type { Theme } from "@mui/material/styles"; import { createTheme } from "@mui/material/styles"; -export const theme = createTheme({ - palette: { - primary: { - main: "#142d4c", - }, - secondary: { - main: "#9fd3c7", - }, - info: { - main: "#ececec", - }, - }, +export const baseTheme: Theme = createTheme({ typography: { fontFamily: ["Poppins", "Arial", "sans-serif"].join(","), h1: { @@ -25,9 +15,7 @@ export const theme = createTheme({ styleOverrides: { body: { minHeight: "100vh", - backgroundColor: "#142d4c", textAlign: "left", - color: "#ececec", }, ":root": { ".MuiSvgIcon-root": { diff --git a/src/mui/palettes.ts b/src/mui/palettes.ts new file mode 100644 index 0000000..00f1146 --- /dev/null +++ b/src/mui/palettes.ts @@ -0,0 +1,36 @@ +import type { PaletteMode, PaletteColor } from "@mui/material"; + +type CustomPaletteColor = Omit; + +type CustomPalette = { + mode: PaletteMode; + primary: CustomPaletteColor; + secondary: CustomPaletteColor; + info: CustomPaletteColor; +}; + +export const darkPalette: CustomPalette = { + mode: "dark", + primary: { + main: "#000000", + }, + secondary: { + main: "#FDB3FD", + }, + info: { + main: "#ECECEC", + }, +}; + +export const lightPalette: CustomPalette = { + mode: "light", + primary: { + main: "#FFFFFF", + }, + secondary: { + main: "#E61680", + }, + info: { + main: "#000000", + }, +}; diff --git a/src/mui/theme-context.tsx b/src/mui/theme-context.tsx new file mode 100644 index 0000000..0ba710e --- /dev/null +++ b/src/mui/theme-context.tsx @@ -0,0 +1,51 @@ +import * as React from "react"; +import type { PaletteMode, Theme } from "@mui/material"; +import { ThemeProvider, createTheme } from "@mui/material/styles"; +import { baseTheme } from "./base-theme"; +import { lightPalette, darkPalette } from "./palettes"; + +export interface ThemeContextProps { + toggleTheme: () => void; + theme: Theme; +} + +export const ThemeContext = React.createContext({ + toggleTheme: () => {}, + theme: createTheme(baseTheme), +}); + +export const ThemeProviderWrapper: React.FC<{ children: React.ReactNode }> = ({ + children, +}) => { + const [mode, setMode] = React.useState("light"); + + const toggleTheme = () => { + setMode((prevMode) => (prevMode === "light" ? "dark" : "light")); + }; + + const theme = React.useMemo(() => { + const palette = mode === "light" ? lightPalette : darkPalette; + return createTheme({ + ...baseTheme, + palette, + components: { + MuiCssBaseline: { + styleOverrides: { + ...((baseTheme.components?.MuiCssBaseline + ?.styleOverrides as object) || {}), + body: { + backgroundColor: palette.primary.main, + color: palette.info.main, + }, + }, + }, + }, + }); + }, [mode]); + + return ( + + {children} + + ); +};