Merge pull request #1120 from ArvinFarrelP/fix-mobile-navbar-remount

fix(navbar): remove key prop causing unnecessary remount in mobile navbar
This commit is contained in:
Rohan Verma 2026-04-05 13:25:42 -07:00 committed by GitHub
commit 3d2e25cdf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 2 deletions

View file

@ -408,6 +408,7 @@ const AudioCommentIllustration = () => (
src="/homepage/comments-audio.webp"
alt="Audio Comment Illustration"
fill
sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
className="object-cover"
/>
</div>

View file

@ -143,7 +143,6 @@ const MobileNav = ({ navItems, isScrolled, scrolledBgClassName }: any) => {
<motion.div
ref={navRef}
animate={{ borderRadius: open ? "4px" : "2rem" }}
key={String(open)}
className={cn(
"relative mx-auto flex w-full max-w-[calc(100vw-2rem)] flex-col items-center justify-between px-4 py-2 lg:hidden transition-all duration-300",
isScrolled

View file

@ -307,6 +307,7 @@ export function Image({
src={src}
alt={alt}
fill
sizes="(max-width: 512px) 100vw, 512px"
className={cn(
"transition-transform duration-300",
fit === "cover" ? "object-cover" : "object-contain",

View file

@ -15,8 +15,9 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
img: ({ className, alt, ...props }: React.ComponentProps<"img">) => (
<Image
{...(props as ImageProps)}
className={cn("rounded-md border", className)}
alt={alt ?? ""}
sizes="(max-width: 768px) 100vw, 896px"
className={cn("rounded-md border", className)}
/>
),
Video: ({ className, ...props }: React.ComponentProps<"video">) => (