@@ -26,6 +26,7 @@ import { useTranslation } from 'react-i18next';
2626import { useSelectedClusters } from '../../../lib/k8s' ;
2727import { Activity } from '../../activity/Activity' ;
2828import ActionButton from '../ActionButton' ;
29+ import { TutorialToolTip } from '../Tutorial/TutorialToolTip' ;
2930import EditorDialog from './EditorDialog' ;
3031
3132interface CreateButtonProps {
@@ -53,6 +54,25 @@ export default function CreateButton(props: CreateButtonProps) {
5354 }
5455 } , [ clusters ] ) ;
5556
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+
5676 const openActivity = ( ) => {
5777 const id = 'create-button' ;
5878 Activity . launch ( {
@@ -128,7 +148,7 @@ export default function CreateButton(props: CreateButtonProps) {
128148 } ,
129149 } ) }
130150 >
131- { t ( 'translation|Create' ) }
151+ { createButtonDescription }
132152 </ Button >
133153 ) }
134154 </ React . Fragment >
0 commit comments