feat(left-sidebar): add simpler tooltips

This commit is contained in:
RadoslavDimchev 2024-04-10 16:56:51 +03:00 committed by Radoslav Dimchev
parent 879d6916f1
commit 2e6ab6f06a
2 changed files with 6 additions and 6 deletions

View File

@ -56,10 +56,7 @@ const LeftSidebar = () => {
content={ content={
<XStack alignItems="center" space="$1"> <XStack alignItems="center" space="$1">
<Text size={15} weight="semibold"> <Text size={15} weight="semibold">
{button.path {button.tooltip}
.replace(/-/g, ' ')
.slice(1)
.replace(/^\w/, (c: any) => c.toUpperCase())}
</Text> </Text>
</XStack> </XStack>
} }

View File

@ -4,6 +4,7 @@ interface SidebarButton {
isDotOn: boolean isDotOn: boolean
isDisabled?: boolean isDisabled?: boolean
path: string path: string
tooltip?: string
} }
interface LeftSidebarState { interface LeftSidebarState {
@ -12,10 +13,11 @@ interface LeftSidebarState {
const initialState: LeftSidebarState = { const initialState: LeftSidebarState = {
buttons: [ buttons: [
{ isDotOn: false, path: '/dashboard' }, { isDotOn: false, path: '/dashboard', tooltip: 'Dashboard' },
{ {
isDotOn: false, isDotOn: false,
path: '/validator-management', path: '/validator-management',
tooltip: 'Validator Management',
}, },
{ {
isDotOn: false, isDotOn: false,
@ -25,8 +27,9 @@ const initialState: LeftSidebarState = {
{ {
isDotOn: false, isDotOn: false,
path: '/device-health-check', path: '/device-health-check',
tooltip: 'Device Health Check',
}, },
{ isDotOn: false, path: '/logs' }, { isDotOn: false, path: '/logs', tooltip: 'Logs' },
{ {
isDotOn: false, isDotOn: false,
isDisabled: true, isDisabled: true,