|
1 | 1 | import { defaultTooltipModifiers, IWalletHTMLElements } from '..';
|
2 |
| -import { ITourStep, OnboardingTourStep } from '../types'; |
| 2 | +import { IOnboardingGetStepFnArgs, ITourStep, OnboardingTourStep } from '../types'; |
3 | 3 | import { getOnboardingTexts } from './OnboardingTourTexts';
|
4 | 4 |
|
5 |
| -export function getMenuIconStep(): ITourStep { |
| 5 | +export function getMenuIconStep({ toggleHighlightButton }: IOnboardingGetStepFnArgs): ITourStep { |
6 | 6 | return {
|
7 | 7 | path: '/',
|
8 | 8 | tooltip: {
|
@@ -30,14 +30,17 @@ export function getMenuIconStep(): ITourStep {
|
30 | 30 | },
|
31 | 31 | lifecycle: {
|
32 | 32 | mounted: async ({ goToNextStep }) => {
|
| 33 | + const hamburguerIconSelector = `${IWalletHTMLElements.ACCOUNT_OVERVIEW_TABLET_MENU_BAR} > button.reset`; |
33 | 34 | // User is expected to click the hamburguer icon to go to next step
|
34 |
| - const hamburguerIcon = document.querySelector( |
35 |
| - `${IWalletHTMLElements.ACCOUNT_OVERVIEW_TABLET_MENU_BAR} > button.reset`) as HTMLButtonElement; |
| 35 | + const hamburguerIcon = document.querySelector(hamburguerIconSelector) as HTMLButtonElement; |
36 | 36 |
|
37 | 37 | const onHamburguerClick = () => goToNextStep();
|
38 | 38 | hamburguerIcon!.addEventListener('click', onHamburguerClick, true);
|
39 | 39 |
|
| 40 | + toggleHighlightButton(hamburguerIconSelector, true, 'gray'); |
| 41 | + |
40 | 42 | return () => {
|
| 43 | + toggleHighlightButton(hamburguerIconSelector, false, 'gray'); |
41 | 44 | hamburguerIcon!.removeEventListener('click', onHamburguerClick, true);
|
42 | 45 | };
|
43 | 46 | },
|
|
0 commit comments