-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dark mode, login and footer images
- Loading branch information
Showing
5 changed files
with
48 additions
and
8 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 |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import albyLogoWithText from "../assets/images/alby-logo-with-text.svg"; | ||
import albyLogoWithTextDark from "../assets/images/alby-logo-with-text-dark.svg"; | ||
import { useDarkMode } from "../hooks/useDarkMode"; | ||
|
||
function Footer() { | ||
const isDarkMode = useDarkMode(); | ||
return ( | ||
<footer className="mt-20 mb-4 text-center"> | ||
<span className="text-gray-500 dark:text-neutral-300 text-xs">Made with 💜 by</span> | ||
<footer className="mt-20 mb-4 flex justify-center items-center gap-2"> | ||
<span className="text-gray-500 dark:text-neutral-300 text-xs"> | ||
Made with 💜 by | ||
</span> | ||
<a href="https://getalby.com?utm_source=nwc" rel="noreferrer noopener"> | ||
<img id="alby-logo" src="/public/images/alby-logo-with-text.svg" className="w-16 inline"/> | ||
<img | ||
id="alby-logo" | ||
src={isDarkMode ? albyLogoWithTextDark : albyLogoWithText} | ||
className="w-16 inline" | ||
/> | ||
</a> | ||
</footer> | ||
) | ||
); | ||
} | ||
|
||
export default Footer; |
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,23 @@ | ||
import React from "react"; | ||
|
||
export function useDarkMode() { | ||
const [isDarkMode, setIsDarkMode] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
const darkModeMediaQuery = window.matchMedia( | ||
"(prefers-color-scheme: dark)" | ||
); | ||
|
||
const handleDarkModeChange = (event: MediaQueryListEvent) => { | ||
setIsDarkMode(event.matches); | ||
}; | ||
|
||
darkModeMediaQuery.addEventListener("change", handleDarkModeChange); | ||
setIsDarkMode(darkModeMediaQuery.matches); | ||
|
||
return () => { | ||
darkModeMediaQuery.removeEventListener("change", handleDarkModeChange); | ||
}; | ||
}, []); | ||
return isDarkMode; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind utilities; | ||
|
||
html, | ||
body, | ||
#root { | ||
height: 100%; | ||
} |
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