Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 3 #3303

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Patch 3 #3303

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"postinstall": "preconstruct dev && manypkg check",
"changeset": "changeset",
"version-packages": "changeset version && yarn --mode=\"update-lockfile\"",
"lucide-react": "^0.469.0",
"release": "yarn build && changeset publish"
},
"author": "Kye Hohenberger",
Expand Down
16 changes: 16 additions & 0 deletions site/components/global-styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
import { colors, draculaPrism } from '../util'

const globalCss = css({
':root': {

Check failure on line 6 in site/components/global-styles.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `··`
'--background-color': '#ffffff',
'--text-color': '#000000',
'--link-color': colors.pink,
'--link-hover-color': colors.hightlight,

Check failure on line 10 in site/components/global-styles.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `,`
},
'.dark': {
'--background-color': '#121212',
'--text-color': '#ffffff',
'--link-color': colors.pink, // Adjust if different in dark mode
'--link-hover-color': colors.hightlight, // Adjust if different in dark mode

Check failure on line 16 in site/components/global-styles.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `,`
},
body: {
backgroundColor: 'var(--background-color)',
color: 'var(--text-color)',

Check failure on line 20 in site/components/global-styles.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `,`
},
a: {
color: colors.pink,
textDecoration: 'none'
Expand Down
30 changes: 30 additions & 0 deletions site/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import { css } from '@emotion/react'
import { useRouter } from 'next/router'
import { Container } from './container'
import {useState, useEffect} from'react'

Check failure on line 7 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Replace `useState,·useEffect}·from` with `·useState,·useEffect·}·from·`
import { Moon, Sun } from 'lucide-react'

Check failure on line 8 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / TypeScript

Cannot find module 'lucide-react' or its corresponding type declarations.

export const animatedUnderline = css({
'&::after': {
Expand Down Expand Up @@ -89,7 +91,21 @@

const path = router.asPath
const onCommunityPage = path === '/docs/community'
const [darkMode, setDarkMode] = useState(false);

Check failure on line 94 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `;`
useEffect(() => {

Check failure on line 95 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `··`
const isDark = localStorage.getItem('darkMode') === 'true';

Check failure on line 96 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `;`
setDarkMode(isDark);

Check failure on line 97 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `;`
if (isDark) {
document.documentElement.classList.add('dark');

Check failure on line 99 in site/components/site-header.tsx

View workflow job for this annotation

GitHub Actions / Linting

Delete `;`
}
}, []);

const toggleDarkMode = () => {
const newDarkMode = !darkMode;
setDarkMode(newDarkMode);
localStorage.setItem('darkMode', String(newDarkMode));
document.documentElement.classList.toggle('dark');
};
return (
<>
<UkraineBanner />
Expand Down Expand Up @@ -170,6 +186,20 @@
listStyle: 'none'
}}
>

<li>
<button
onClick={toggleDarkMode}
className="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"
aria-label="Toggle dark mode"
>
{darkMode ? (
<Sun className="h-5 w-5 text-gray-700 dark:text-gray-200" />
) : (
<Moon className="h-5 w-5 text-gray-700 dark:text-gray-200" />
)}
</button>
</li>
<li>
<HeaderLink
href="/docs"
Expand Down
Loading