website refactor
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Icon } from '@/ui/Icon';
|
||||
import { Text } from '@/ui/Text';
|
||||
import Link from 'next/link';
|
||||
import { LucideIcon, ChevronRight } from 'lucide-react';
|
||||
|
||||
interface NavLinkProps {
|
||||
@@ -14,7 +13,7 @@ interface NavLinkProps {
|
||||
LinkComponent?: React.ComponentType<{ href: string; children: React.ReactNode; className?: string }>;
|
||||
}
|
||||
|
||||
export function NavLink({ href, label, icon, isActive, variant = 'sidebar', collapsed = false, LinkComponent = Link as any }: NavLinkProps) {
|
||||
export function NavLink({ href, label, icon, isActive, variant = 'sidebar', collapsed = false, LinkComponent }: NavLinkProps) {
|
||||
const isTop = variant === 'top';
|
||||
|
||||
// Radical "Game Menu" Style
|
||||
@@ -72,12 +71,23 @@ export function NavLink({ href, label, icon, isActive, variant = 'sidebar', coll
|
||||
</Box>
|
||||
);
|
||||
|
||||
if (LinkComponent) {
|
||||
return (
|
||||
<LinkComponent
|
||||
href={href}
|
||||
className={`w-full group block ${!isTop ? '' : ''}`}
|
||||
>
|
||||
{content}
|
||||
</LinkComponent>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<LinkComponent
|
||||
<a
|
||||
href={href}
|
||||
className={`w-full group block ${!isTop ? '' : ''}`}
|
||||
>
|
||||
{content}
|
||||
</LinkComponent>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user