Skip to content

Commit

Permalink
fix: small minor errors (#1504)
Browse files Browse the repository at this point in the history
* FIX: Map keys error

* FIX: Duplicate key error

* FIx: Animate presewnce where it is needed
  • Loading branch information
vanshavenger authored Nov 12, 2024
1 parent 204c496 commit 88bff90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/components/BreadCrumbComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { FullCourseContent } from '@/db/course';
import { Home } from 'lucide-react';
import Link from 'next/link';
import { useMemo } from 'react';
import { Fragment, useMemo } from 'react';

export default function BreadCrumbComponent({
rest,
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function BreadCrumbComponent({
finalRouteArray = [...rest];
}
return (
<>
<Fragment key={indexofBreadCrumbId}>
{index !== array.length - 1 ? (
<>
<BreadcrumbItem>
Expand All @@ -116,7 +116,7 @@ export default function BreadCrumbComponent({
</BreadcrumbPage>
</BreadcrumbItem>
)}
</>
</Fragment>
);
})}
</BreadcrumbList>
Expand Down
44 changes: 21 additions & 23 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Navbar = () => {
);

return (
<AnimatePresence>
<>
<motion.nav
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
Expand Down Expand Up @@ -143,35 +143,33 @@ export const Navbar = () => {
</div>

{/* Mobile menu */}
{!session?.user && (
<>
{isMenuOpen && (
<AnimatePresence>
{!session?.user && isMenuOpen && (
<motion.div
className="bg-background p-4 md:hidden"
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
>
<motion.div
className="bg-background p-4 md:hidden"
className="flex gap-2"
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
>
<motion.div
className="flex gap-2"
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
>
<AppbarAuth />
<AppbarAuth />
<Button variant={'branding'} className="w-full">
<Link
<Link
href={'https://harkirat.classx.co.in/new-courses'}
target="_blank"
>
Join now
</Link>
</Button>
</motion.div>
target="_blank"
>
Join now
</Link>
</Button>
</motion.div>
)}
</>
)}
</motion.div>
)}
</AnimatePresence>
</motion.nav>

{/* Mobile search overlay */}
Expand All @@ -195,6 +193,6 @@ export const Navbar = () => {
</motion.div>
)}
</AnimatePresence>
</AnimatePresence>
</>
);
};

0 comments on commit 88bff90

Please sign in to comment.