@@ -26,6 +26,7 @@ import { useTranslation } from 'react-i18next';
26
26
import { useSelectedClusters } from '../../../lib/k8s' ;
27
27
import { Activity } from '../../activity/Activity' ;
28
28
import ActionButton from '../ActionButton' ;
29
+ import { TutorialToolTip } from '../Tutorial/TutorialToolTip' ;
29
30
import EditorDialog from './EditorDialog' ;
30
31
31
32
interface CreateButtonProps {
@@ -53,6 +54,25 @@ export default function CreateButton(props: CreateButtonProps) {
53
54
}
54
55
} , [ clusters ] ) ;
55
56
57
+ // Hackathon WIP for tutorial mode
58
+ console . log ( 'current tutorial mode' , localStorage . getItem ( 'tutorialMode' ) ) ;
59
+ const isTutorialMode = localStorage . getItem ( 'tutorialMode' ) === 'true' ;
60
+
61
+ const [ createButtonDescription , setCreateButtonDescription ] = React . useState <
62
+ string | React . ReactNode
63
+ > ( 'loading..' ) ;
64
+
65
+ React . useEffect ( ( ) => {
66
+ if ( isTutorialMode ) {
67
+ setCreateButtonDescription (
68
+ < TutorialToolTip context = "CreateButton" labelText = { t ( 'translation|Create ' ) } />
69
+ ) ;
70
+ } else {
71
+ setCreateButtonDescription ( t ( 'translation|Create ' ) ) ;
72
+ }
73
+ } , [ isTutorialMode , createButtonDescription , t ] ) ;
74
+ // need to clean later
75
+
56
76
const openActivity = ( ) => {
57
77
const id = 'create-button' ;
58
78
Activity . launch ( {
@@ -128,7 +148,7 @@ export default function CreateButton(props: CreateButtonProps) {
128
148
} ,
129
149
} ) }
130
150
>
131
- { t ( 'translation|Create' ) }
151
+ { createButtonDescription }
132
152
</ Button >
133
153
) }
134
154
</ React . Fragment >
0 commit comments