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

Adds Nextjs Loader #909

Merged
2 commits merged into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"next-i18n-router": "^5.0.2",
"next-sitemap": "^4.2.3",
"next-themes": "^0.2.1",
"nextjs-toploader": "^1.6.6",
"nextjs-toploader": "^1.6.12",
"obscenity": "^0.2.0",
"p-limit": "^5.0.0",
"p-retry": "^6.2.0",
Expand Down
8 changes: 6 additions & 2 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { SpeedInsights } from '@vercel/speed-insights/next'
import { capitalize } from 'lodash-es'
import type { Metadata, Viewport } from 'next'
import { notFound } from 'next/navigation'
import NextTopLoader from 'nextjs-toploader'

import { TopLevelClientLogic } from '@/app/[locale]/topLevelClientLogic'
import { CookieConsent } from '@/components/app/cookieConsent'
Expand Down Expand Up @@ -71,8 +72,11 @@ export default function Layout({ children, params }: PageProps & { children: Rea
<html lang={locale}>
<body className={fontClassName}>
<OverrideGlobalLocalStorage />
{/* LATER-TASK add back once https://github.com/TheSGJ/nextjs-toploader/issues/66 is resolved */}
{/* <NextTopLoader /> */}
<NextTopLoader
color="#6200FF"
shadow="0 0 10px #6200FF,0 0 5px #6200FF"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid hard coding colors we could use a css variable injected by tailwind here

Suggested change
color="#6200FF"
shadow="0 0 10px #6200FF,0 0 5px #6200FF"
color="hsl(var(--primary-cta))"
shadow="0 0 10px hsl(var(--primary-cta)),0 0 5px hsl(var(--primary-cta))"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

showSpinner={false}
/>
<TopLevelClientLogic locale={locale}>
<FullHeight.Container>
<Navbar locale={locale} />
Expand Down
Loading