Skip to content

Commit

Permalink
fix(website): fix issue with white logo text and light mode (#13019)
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx authored Jan 23, 2023
1 parent 5b4a33d commit 8c166fa
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 175 deletions.
8 changes: 3 additions & 5 deletions packages/website/components/ThemedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ import { useTheme } from "next-themes";
import { useEffect, useState } from "react";

function ThemedImage() {
const { theme } = useTheme();
const { resolvedTheme } = useTheme();
const [src, setSrc] = useState(null);

useEffect(() => {
setSrc(
localStorage.getItem("theme") === "dark" ||
localStorage.getItem("theme") === "system" ||
localStorage.getItem("theme") === null
resolvedTheme === "dark"
? "/images/logotype-white.png"
: "/images/logotype-black.png"
);
}, [theme]);
}, [resolvedTheme]);

return src ? (
<Image
Expand Down
16 changes: 8 additions & 8 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"start": "pnpm next start"
},
"dependencies": {
"next": "^13.1.2",
"next": "^13.1.4",
"next-themes": "^0.2.1",
"nextra": "^2.2.3",
"nextra-theme-docs": "^2.2.3",
"nextra": "^2.2.12",
"nextra-theme-docs": "^2.2.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sharp": "^0.31.3"
},
"devDependencies": {
"@heroicons/react": "^2.0.13",
"@next/font": "^13.1.2",
"@types/node": "^18.11.10",
"@types/react": "^18.0.26",
"@next/font": "^13.1.4",
"@types/node": "^18.11.18",
"@types/react": "^18.0.27",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.20",
"postcss": "^8.4.21",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.3"
"typescript": "^4.9.4"
}
}
Loading

0 comments on commit 8c166fa

Please sign in to comment.