From 2e6ab6f06a7629d56acc7b6ee96733236c71fb7f Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Wed, 10 Apr 2024 16:56:51 +0300 Subject: [PATCH] feat(left-sidebar): add simpler tooltips --- src/components/General/LeftSidebar/LeftSidebar.tsx | 5 +---- src/redux/LeftSidebar/slice.ts | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/General/LeftSidebar/LeftSidebar.tsx b/src/components/General/LeftSidebar/LeftSidebar.tsx index 44d8f4e0..d1ff5bb2 100644 --- a/src/components/General/LeftSidebar/LeftSidebar.tsx +++ b/src/components/General/LeftSidebar/LeftSidebar.tsx @@ -56,10 +56,7 @@ const LeftSidebar = () => { content={ - {button.path - .replace(/-/g, ' ') - .slice(1) - .replace(/^\w/, (c: any) => c.toUpperCase())} + {button.tooltip} } diff --git a/src/redux/LeftSidebar/slice.ts b/src/redux/LeftSidebar/slice.ts index c4b1aea9..af0586f6 100644 --- a/src/redux/LeftSidebar/slice.ts +++ b/src/redux/LeftSidebar/slice.ts @@ -4,6 +4,7 @@ interface SidebarButton { isDotOn: boolean isDisabled?: boolean path: string + tooltip?: string } interface LeftSidebarState { @@ -12,10 +13,11 @@ interface LeftSidebarState { const initialState: LeftSidebarState = { buttons: [ - { isDotOn: false, path: '/dashboard' }, + { isDotOn: false, path: '/dashboard', tooltip: 'Dashboard' }, { isDotOn: false, path: '/validator-management', + tooltip: 'Validator Management', }, { isDotOn: false, @@ -25,8 +27,9 @@ const initialState: LeftSidebarState = { { isDotOn: false, path: '/device-health-check', + tooltip: 'Device Health Check', }, - { isDotOn: false, path: '/logs' }, + { isDotOn: false, path: '/logs', tooltip: 'Logs' }, { isDotOn: false, isDisabled: true,