From fcca9acd2b0dfab32223e1d7d9ba9dbe012de3a1 Mon Sep 17 00:00:00 2001 From: Fermatka Date: Fri, 17 May 2024 12:06:16 +0200 Subject: [PATCH 1/6] next-themes added to project --- algrtm/package-lock.json | 10 ++++++++++ algrtm/package.json | 1 + 2 files changed, 11 insertions(+) diff --git a/algrtm/package-lock.json b/algrtm/package-lock.json index f7454d40..9afa8f28 100644 --- a/algrtm/package-lock.json +++ b/algrtm/package-lock.json @@ -13,6 +13,7 @@ "dotenv": "^16.4.5", "next": "14.1.0", "next-plugin-svgr": "^1.1.10", + "next-themes": "^0.3.0", "react": "^18", "react-dom": "^18", "react-icons": "^5.0.1" @@ -6058,6 +6059,15 @@ "file-loader": "^6.2.0" } }, + "node_modules/next-themes": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.3.0.tgz", + "integrity": "sha512-/QHIrsYpd6Kfk7xakK4svpDI5mmXP0gfvCoJdGpZQ2TOrQZmsW0QxjaiLn8wbIKjtm4BTSqLoix4lxYYOnLJ/w==", + "peerDependencies": { + "react": "^16.8 || ^17 || ^18", + "react-dom": "^16.8 || ^17 || ^18" + } + }, "node_modules/next/node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", diff --git a/algrtm/package.json b/algrtm/package.json index fcf788c4..0ae96ee0 100644 --- a/algrtm/package.json +++ b/algrtm/package.json @@ -14,6 +14,7 @@ "dotenv": "^16.4.5", "next": "14.1.0", "next-plugin-svgr": "^1.1.10", + "next-themes": "^0.3.0", "react": "^18", "react-dom": "^18", "react-icons": "^5.0.1" From ee950da83658678afe91f0c802651df24777fdc5 Mon Sep 17 00:00:00 2001 From: Fermatka Date: Fri, 17 May 2024 12:10:20 +0200 Subject: [PATCH 2/6] Providers.js created --- algrtm/src/providers/providers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 algrtm/src/providers/providers.js diff --git a/algrtm/src/providers/providers.js b/algrtm/src/providers/providers.js new file mode 100644 index 00000000..242f246c --- /dev/null +++ b/algrtm/src/providers/providers.js @@ -0,0 +1,11 @@ +"use client"; +import { ThemeProvider } from "next-themes"; +import React from "react"; + +export function Providers({ children }) { + return ( + + {children} + + ); +} From 05082dc35a17cc3a1aaa67b2a1f290dd4b8b4259 Mon Sep 17 00:00:00 2001 From: Fermatka Date: Fri, 17 May 2024 14:12:26 +0200 Subject: [PATCH 3/6] dark/light mode page blinking removed --- algrtm/src/app/layout.js | 25 +++-- algrtm/src/components/Navbar.js | 1 - algrtm/src/components/PianoRollDescription.js | 4 +- algrtm/src/components/shared/ThemeToggle.js | 33 ++++++- algrtm/src/contexts/ThemeContext.js | 94 +++++++++---------- 5 files changed, 96 insertions(+), 61 deletions(-) diff --git a/algrtm/src/app/layout.js b/algrtm/src/app/layout.js index 279208a1..3a834827 100644 --- a/algrtm/src/app/layout.js +++ b/algrtm/src/app/layout.js @@ -3,26 +3,39 @@ import "../styles/globals.css"; import Footer from "@/components/Footer"; import LinksSection from "@/components/LinksSection"; import Header from "../components/Header"; -import ThemeContextProvider from "@/contexts/ThemeContext"; +// import ThemeContextProvider from "@/contexts/ThemeContext"; +import { Providers } from "@/providers/providers"; const pingFont = localFont({ src: "../fonts/PingFangHK.ttf" }); export const metadata = { - title: "Algrtm | Algorithmic solutions", - description: "We develop algorithmic solutions.", + title: "EPR | Algorithmic solutions", + description: "Make Data Science Great Again.", }; export default function RootLayout({ children }) { return ( - + - +
{children}