mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
fix: add priority prop to Logo component for LCP optimization on auth pages
- Add optional priority prop to Logo component (defaults to false) - Set priority=true on login and register pages to preload logo - Logo on other pages remains lazy-loaded by default - Improves LCP on critical auth pages by eliminating lazy-load delay
This commit is contained in:
parent
4131e6bea9
commit
414c4c86e9
3 changed files with 5 additions and 2 deletions
|
|
@ -115,7 +115,7 @@ function LoginContent() {
|
||||||
<div className="relative w-full overflow-hidden">
|
<div className="relative w-full overflow-hidden">
|
||||||
<AmbientBackground />
|
<AmbientBackground />
|
||||||
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center">
|
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center">
|
||||||
<Logo className="h-16 w-16 md:h-32 md:w-32 rounded-md transition-all" />
|
<Logo priority className="h-16 w-16 md:h-32 md:w-32 rounded-md transition-all" />
|
||||||
<h1 className="mt-4 mb-6 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:mt-8 md:mb-8 md:text-3xl lg:text-4xl transition-all">
|
<h1 className="mt-4 mb-6 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:mt-8 md:mb-8 md:text-3xl lg:text-4xl transition-all">
|
||||||
{t("sign_in")}
|
{t("sign_in")}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ export default function RegisterPage() {
|
||||||
<div className="relative w-full overflow-hidden">
|
<div className="relative w-full overflow-hidden">
|
||||||
<AmbientBackground />
|
<AmbientBackground />
|
||||||
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center px-6 md:px-0">
|
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center px-6 md:px-0">
|
||||||
<Logo className="h-16 w-16 md:h-32 md:w-32 rounded-md transition-all" />
|
<Logo priority className="h-16 w-16 md:h-32 md:w-32 rounded-md transition-all" />
|
||||||
<h1 className="mt-4 mb-6 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:mt-8 md:mb-8 md:text-3xl lg:text-4xl transition-all">
|
<h1 className="mt-4 mb-6 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:mt-8 md:mb-8 md:text-3xl lg:text-4xl transition-all">
|
||||||
{t("create_account")}
|
{t("create_account")}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,11 @@ import { cn } from "@/lib/utils";
|
||||||
export const Logo = ({
|
export const Logo = ({
|
||||||
className,
|
className,
|
||||||
disableLink = false,
|
disableLink = false,
|
||||||
|
priority = false,
|
||||||
}: {
|
}: {
|
||||||
className?: string;
|
className?: string;
|
||||||
disableLink?: boolean;
|
disableLink?: boolean;
|
||||||
|
priority?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const image = (
|
const image = (
|
||||||
<Image
|
<Image
|
||||||
|
|
@ -16,6 +18,7 @@ export const Logo = ({
|
||||||
alt="logo"
|
alt="logo"
|
||||||
width={128}
|
width={128}
|
||||||
height={128}
|
height={128}
|
||||||
|
priority={priority}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue