fix(left-sidebar): remove useless components

This commit is contained in:
RadoslavDimchev 2024-04-10 18:02:27 +03:00 committed by Radoslav Dimchev
parent 50d1227496
commit 7a94fefa15
2 changed files with 22 additions and 24 deletions

View File

@ -8,7 +8,7 @@ import {
ActivityCenterIcon, ActivityCenterIcon,
SettingsIcon, SettingsIcon,
} from '@status-im/icons' } from '@status-im/icons'
import { YStack } from 'tamagui' import { Stack, YStack } from 'tamagui'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import { Tooltip } from '@status-im/components' import { Tooltip } from '@status-im/components'
@ -41,14 +41,14 @@ const LeftSidebar = () => {
> >
{buttons.map((button: SidebarButton) => ( {buttons.map((button: SidebarButton) => (
<Tooltip side="right" content={button.tooltip} key={button.path}> <Tooltip side="right" content={button.tooltip} key={button.path}>
<div style={{ padding: '3px', cursor: 'pointer' }}> <Stack>
<LeftSidebarIconButton <LeftSidebarIconButton
iconEl={iconMap[button.path as keyof typeof iconMap]} iconEl={iconMap[button.path as keyof typeof iconMap]}
isDotOn={button.isDotOn} isDotOn={button.isDotOn}
isDisabled={button.isDisabled} isDisabled={button.isDisabled}
path={button.path} path={button.path}
/> />
</div> </Stack>
</Tooltip> </Tooltip>
))} ))}
</YStack> </YStack>

View File

@ -17,28 +17,26 @@ const LeftSidebarIconButton = ({
}: IconButtonWithDotProps) => { }: IconButtonWithDotProps) => {
return ( return (
<Link to={path}> <Link to={path}>
<Stack style={{ position: 'relative', display: 'inline-block' }}> <IconButton
<IconButton icon={iconEl}
icon={iconEl} variant={isDisabled ? 'outline' : 'ghost'}
variant={isDisabled ? 'outline' : 'ghost'} selected={path === window.location.pathname}
selected={path === window.location.pathname} disabled={isDisabled}
disabled={isDisabled} />
{isDotOn && (
<Stack
style={{
position: 'absolute',
right: 7,
top: 5,
width: '9px',
height: '9px',
borderRadius: '50%',
backgroundColor: '#1992D7',
border: '1.5px solid #fff',
}}
/> />
{isDotOn && ( )}
<Stack
style={{
position: 'absolute',
right: 7,
top: 5,
width: '9px',
height: '9px',
borderRadius: '50%',
backgroundColor: '#1992D7',
border: '1.5px solid #fff',
}}
/>
)}
</Stack>
</Link> </Link>
) )
} }