-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
34 changed files
with
286 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useCallback, useState } from 'react'; | ||
import type { FunctionComponent, ReactElement } from 'react'; | ||
|
||
import { FiSun, FiMoon } from 'react-icons/fi'; | ||
|
||
const DarkModeSwitch: FunctionComponent = (): ReactElement => { | ||
const [darkMode, setDarkMode] = useState<boolean>(false); | ||
|
||
const toggleDarkMode = useCallback(() => { | ||
setDarkMode(!darkMode); | ||
document.documentElement.classList.toggle('dark'); | ||
}, [darkMode]); | ||
|
||
return ( | ||
<> | ||
{darkMode === true ? ( | ||
<FiMoon | ||
size="28" | ||
onClick={toggleDarkMode} | ||
/> | ||
) : ( | ||
<FiSun | ||
size="28" | ||
onClick={toggleDarkMode} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export { DarkModeSwitch }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import type { FunctionComponent, PropsWithChildren } from 'react'; | ||
|
||
const DocumentHead: FunctionComponent<PropsWithChildren> = ({ children }) => { | ||
return ( | ||
<> | ||
<html lang="en" /> | ||
|
||
<meta | ||
httpEquiv="cache-control" | ||
content="public, max-age=0, must-revalidate" | ||
/> | ||
|
||
<meta | ||
name="color-scheme" | ||
content="light dark" | ||
/> | ||
|
||
{children} | ||
</> | ||
); | ||
}; | ||
|
||
export { DocumentHead }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ponents/seo/meta-twitter/meta-twitter.tsx → ...nt-head/seo/meta-twitter/meta-twitter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.