This commit is contained in:
Untone 2024-02-17 16:04:47 +03:00
parent 49f7d4efc1
commit da7c98afab

View File

@ -17,11 +17,11 @@ type Props = {
export const Link = (props: Props) => { export const Link = (props: Props) => {
const { page } = useRouter() const { page } = useRouter()
const isSelected = page().route === props.routeName const isSelected = page()?.route === props.routeName
return ( return (
<li <li
onClick={props.onClick} onClick={props.onClick}
classList={{ 'view-switcher__item--selected': page().route === props.routeName }} classList={{ 'view-switcher__item--selected': page()?.route === props.routeName }}
> >
<ConditionalWrapper <ConditionalWrapper
condition={!isSelected && Boolean(props.routeName)} condition={!isSelected && Boolean(props.routeName)}