Skip to content
Permalink
91e8420402
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
45 lines (40 sloc) 1.01 KB
/* eslint-disable-next-line */
import React from 'react';
import { w, W } from 'windstitch';
export const LinkComponent = w.a(
``,
{
variants: {
clickable: (yes: boolean) => (yes ? 'cursor-pointer ' : ''),
},
defaultVariants: {
weight: undefined,
inline: true,
selectable: true,
clickable: false
}
}
);
type ButtonProps = W.Infer<typeof LinkComponent>
export interface CommonProps extends Omit<ButtonProps, 'as'> {
children: React.ReactNode;
rtlMode?: boolean,
sticky?: boolean,
href?: string,
onClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined
}
type NavigationMenuLinkProps = CommonProps
export const NavigationMenuLink = ({ children, rtlMode, onClick, ...rest }: NavigationMenuLinkProps) => {
const rtl = rtlMode ? { dir: 'rtl' } : {}
return (
<LinkComponent
clickable={onClick ? true : false}
onClick={onClick}
{...rtl}
{...rest}
>
{children}
</LinkComponent>
)
}
export default NavigationMenuLink;