Commit c9400468 authored by Max Alekseenko's avatar Max Alekseenko

remove unnecessary prop

parent ee3c848e
...@@ -21,7 +21,6 @@ const NavLink = ({ item, isCollapsed, onClick }: Props) => { ...@@ -21,7 +21,6 @@ const NavLink = ({ item, isCollapsed, onClick }: Props) => {
item={ item } item={ item }
nextRoute={ 'nextRoute' in item ? item.nextRoute : undefined } nextRoute={ 'nextRoute' in item ? item.nextRoute : undefined }
onClick={ onClick } onClick={ onClick }
target={ isInternalLink ? '_self' : '_blank' }
href={ isInternalLink ? route(item.nextRoute) : item.url } href={ isInternalLink ? route(item.nextRoute) : item.url }
isActive={ isInternalLink && item.isActive } isActive={ isInternalLink && item.isActive }
isExternal={ !isInternalLink } isExternal={ !isInternalLink }
......
...@@ -19,14 +19,13 @@ type Props = { ...@@ -19,14 +19,13 @@ type Props = {
isCollapsed?: boolean; isCollapsed?: boolean;
onClick?: () => void; onClick?: () => void;
as?: 'a' | 'button'; as?: 'a' | 'button';
target?: '_self' | '_blank';
href?: string; href?: string;
isExternal?: boolean; isExternal?: boolean;
isActive?: boolean; isActive?: boolean;
isDisabled?: boolean; isDisabled?: boolean;
} }
const NavLinkBase = ({ item, nextRoute, isCollapsed, onClick, isExternal, as = 'a', target = '_self', href, isActive, isDisabled }: Props) => { const NavLinkBase = ({ item, nextRoute, isCollapsed, onClick, isExternal, as = 'a', href, isActive, isDisabled }: Props) => {
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const colors = useColors(); const colors = useColors();
...@@ -41,7 +40,7 @@ const NavLinkBase = ({ item, nextRoute, isCollapsed, onClick, isExternal, as = ' ...@@ -41,7 +40,7 @@ const NavLinkBase = ({ item, nextRoute, isCollapsed, onClick, isExternal, as = '
<Link <Link
as={ as } as={ as }
href={ href } href={ href }
target={ target } target={ isExternal ? '_blank' : '_self' }
{ ...styleProps.itemProps } { ...styleProps.itemProps }
w={{ base: '100%', lg: isExpanded ? '100%' : '60px', xl: isCollapsed ? '60px' : '100%' }} w={{ base: '100%', lg: isExpanded ? '100%' : '60px', xl: isCollapsed ? '60px' : '100%' }}
display="flex" display="flex"
......
...@@ -45,7 +45,6 @@ const RewardsNavLink = ({ isCollapsed, onClick }: Props) => { ...@@ -45,7 +45,6 @@ const RewardsNavLink = ({ isCollapsed, onClick }: Props) => {
nextRoute={ isLogedIn ? nextRoute : undefined } nextRoute={ isLogedIn ? nextRoute : undefined }
onClick={ handleClick } onClick={ handleClick }
as={ isLogedIn ? 'a' : 'button' } as={ isLogedIn ? 'a' : 'button' }
target="_self"
href={ isLogedIn ? route(nextRoute) : undefined } href={ isLogedIn ? route(nextRoute) : undefined }
isActive={ router.pathname === pathname } isActive={ router.pathname === pathname }
isDisabled={ !isInitialized } isDisabled={ !isInitialized }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment