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

Create useThemeToggle hook in new hooks directory and add import alias #273

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

AVGVSTVS96
Copy link
Owner

@AVGVSTVS96 AVGVSTVS96 commented Apr 28, 2024

TL;DR

This PR introduces a new hook useThemeToggle and updates the tsconfig.json.

  • Create useThemeToggle hook using logic from ModeToggle

  • Add hooks directory and @hooks import alias to tsconfig.json

What changed?

A new file useThemeToggle.tsx was added in the new src/hooks/ directory. This hook provides a reusable toggleTheme function that changes the theme between dark and light mode.

The tsconfig.json is updated with an import alias for the new hooks directory.

Create `useThemeToggle` hook using logic from `ModeToggle`

Add `@hooks` import alias to `tsconfig.json`
Copy link

cloudflare-workers-and-pages bot commented Apr 28, 2024

Deploying astrosite with  Cloudflare Pages  Cloudflare Pages

Latest commit: afedbe5
Status: ✅  Deploy successful!
Preview URL: https://52904a2d.astrosite-aid.pages.dev
Branch Preview URL: https://createusethemetogglehook.astrosite-aid.pages.dev

View logs

Copy link

codesandbox bot commented Apr 28, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Owner Author

AVGVSTVS96 commented Apr 28, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @AVGVSTVS96 and the rest of your teammates on Graphite Graphite

@AVGVSTVS96 AVGVSTVS96 marked this pull request as ready for review April 28, 2024 02:17
Copy link
Owner Author

AVGVSTVS96 commented Apr 28, 2024

Merge activity

@AVGVSTVS96 AVGVSTVS96 merged commit 0ab9147 into master Apr 28, 2024
1 check passed
@AVGVSTVS96 AVGVSTVS96 deleted the createUseThemeToggleHook branch April 29, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant