mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
refactor: deep link for faq
This commit is contained in:
21
src/features/nav/TabNavLink.tsx
Normal file
21
src/features/nav/TabNavLink.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import classNames from 'classnames';
|
||||
import type { RefAttributes } from 'react';
|
||||
import { NavLink, type NavLinkProps } from 'react-router';
|
||||
|
||||
const tabClassNames = ({ isActive }: { isActive: boolean }) =>
|
||||
classNames(
|
||||
'link inline-flex text-nowrap mb-[-2px] no-underline w-full',
|
||||
'border-b-2 md:border-b-0 md:border-r-2',
|
||||
'tab md:grow',
|
||||
{
|
||||
'tab-active bg-accent/10 border-accent': isActive,
|
||||
},
|
||||
);
|
||||
|
||||
export function TabNavLink({ children, ...props }: NavLinkProps & RefAttributes<HTMLAnchorElement>) {
|
||||
return (
|
||||
<NavLink className={tabClassNames} role="tab" {...props}>
|
||||
{children}
|
||||
</NavLink>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user