@@ -30,6 +30,7 @@ import { createRouteURL } from '../../lib/router/createRouteURL';
30
30
import { useTypedSelector } from '../../redux/hooks' ;
31
31
import ActionButton from '../common/ActionButton' ;
32
32
import CreateButton from '../common/Resource/CreateButton' ;
33
+ import { TutorialToolTip } from '../common/Tutorial/TutorialToolTip' ;
33
34
import NavigationTabs from './NavigationTabs' ;
34
35
import SidebarItem , { SidebarItemProps } from './SidebarItem' ;
35
36
import { DefaultSidebars , setSidebarSelected , setWhetherSidebarOpen } from './sidebarSlice' ;
@@ -73,6 +74,28 @@ function AddClusterButton() {
73
74
const { t } = useTranslation ( [ 'translation' ] ) ;
74
75
const { isOpen } = useSidebarInfo ( ) ;
75
76
77
+ const [ AddClusterButtonDescription , setAddClusterButtonDescription ] = React . useState <
78
+ string | React . ReactNode
79
+ > ( 'loading..' ) ;
80
+
81
+ // since we can use this as part of the tutorial mode we grab the tutorialEnabled from local storage
82
+
83
+ // set it with a useEffect for now, we can always change it latter in the settings to have that refresh thing to set the local storage
84
+ // localStorage.setItem('tutorialMode', 'true');
85
+ console . log ( 'current tutorial mode' , localStorage . getItem ( 'tutorialMode' ) ) ;
86
+ const isTutorialMode = localStorage . getItem ( 'tutorialMode' ) === 'true' ;
87
+
88
+ React . useEffect ( ( ) => {
89
+ if ( isTutorialMode ) {
90
+ // setAddClusterButtonDescription("tutorial");
91
+ setAddClusterButtonDescription (
92
+ < TutorialToolTip context = "AddClusterButton" labelText = { t ( 'translation|Add Cluster' ) } />
93
+ ) ;
94
+ } else {
95
+ setAddClusterButtonDescription ( t ( 'translation|Add Cluster' ) ) ;
96
+ }
97
+ } , [ isTutorialMode , AddClusterButtonDescription , t ] ) ;
98
+
76
99
return (
77
100
< Box pb = { 2 } >
78
101
{ isOpen ? (
@@ -81,13 +104,13 @@ function AddClusterButton() {
81
104
startIcon = { < InlineIcon icon = "mdi:plus-box-outline" /> }
82
105
sx = { { color : theme => theme . palette . sidebar . color } }
83
106
>
84
- { t ( 'translation|Add Cluster' ) }
107
+ { AddClusterButtonDescription }
85
108
</ Button >
86
109
) : (
87
110
< ActionButton
88
111
onClick = { ( ) => history . push ( createRouteURL ( 'addCluster' ) ) }
89
112
icon = "mdi:plus-box-outline"
90
- description = { t ( 'translation|Add Cluster' ) }
113
+ description = { AddClusterButtonDescription }
91
114
color = "#adadad"
92
115
width = { 38 }
93
116
/>
0 commit comments