-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: blur navbar on scroll & light/dark dashboard preview image
- Loading branch information
Showing
7 changed files
with
83 additions
and
48 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,44 @@ | ||
'use client'; | ||
|
||
import { useEffect, useState } from 'react'; | ||
import { useTheme } from 'next-themes'; | ||
import Image from 'next/image'; | ||
|
||
/** | ||
* This component renders the dashboard preview image that is used on the home | ||
* marketing page, it will use the light or dark image depending on the theme. | ||
* | ||
* @returns A react component representing the dashboard preview image. | ||
*/ | ||
export function HomePreview() { | ||
const [mounted, setMounted] = useState(false); | ||
const { resolvedTheme } = useTheme(); | ||
|
||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (mounted && resolvedTheme === 'light') { | ||
return ( | ||
<> | ||
<Image | ||
src="/_static/light-dashboard-preview.jpg" | ||
width={1920} | ||
height={1080} | ||
alt="Dashboard Preview" | ||
className="my-12 rounded-lg shadow-[0_50px_200px_75px] shadow-pink/10" | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
return ( | ||
<Image | ||
src="/_static/dark-dashboard-preview.jpg" | ||
width={1920} | ||
height={1080} | ||
alt="Dashboard Preview" | ||
className="my-12 rounded-lg shadow-[0_50px_200px_75px] shadow-pink/10" | ||
/> | ||
); | ||
} |
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