Skip to content

Commit

Permalink
always show header when user on top
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 17, 2024
1 parent df18a3b commit 9a96bb4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export default async function LocaleLayout({
className={cn(`${inter.variable} ${notoSansJP.variable}`)}
suppressHydrationWarning
>
<ThemeProvider attribute="class" defaultTheme="dark">
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem={false}
>
<NextIntlClientProvider messages={messages}>
<SolanaWalletProvider>{children}</SolanaWalletProvider>
<Toaster />
Expand Down
3 changes: 0 additions & 3 deletions src/components/config/ModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export function ModeToggle() {
<DropdownMenuItem onClick={() => setTheme('dark')}>
{t('common.darkMode')}
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme('system')}>
{t('common.systemMode')}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/utils/useShowHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function useShowHeader({ defaultShowHeader = true }: Props = {}) {
const handleScroll = () => {
const currentScrollY = window.scrollY

if (currentScrollY < lastScrollY) {
if (currentScrollY < 80 || currentScrollY < lastScrollY) {
setShowHeader(true)
} else {
setShowHeader(false)
Expand Down

0 comments on commit 9a96bb4

Please sign in to comment.