Skip to content

Commit

Permalink
feat: add 'to' prop to bottomnavitem
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Alessandro Domingo committed Apr 8, 2024
1 parent 4d7e1a2 commit d9f846a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/BottomNav/BottomNavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface BottomNavItemProps extends HTMLAttributes<HTMLLIElement> {
active?: boolean;
/** Indica l'URL a cui puntare (utilizzare o questo o onClick) */
url?: string;
/** Indica il link route a cui l'elemento deve puntare. */
to?: string;
/** Etichetta da associare all'elemento */
label?: string;
/** Testo esplicativo per dispositivi screen reader. */
Expand All @@ -36,6 +38,7 @@ export const BottomNavItem: FC<BottomNavItemProps> = ({
badge,
alert = false,
url,
to,
srText,
iconName = 'it-comment',
label,
Expand All @@ -59,7 +62,7 @@ export const BottomNavItem: FC<BottomNavItemProps> = ({
);
return (
<li {...attributes} data-testid={testId}>
<Tag href={url || link || '#'} className={activeClass} onClick={onLinkClick}>
<Tag href={url || link || '#'} className={activeClass} to={to} onClick={onLinkClick}>
{badgeWrapper}
{alertWrapper}
<Icon icon={iconName} />
Expand Down

0 comments on commit d9f846a

Please sign in to comment.