Skip to content

Commit 7576332

Browse files
committed
hamburguer icon highlights in onboarding tour
1 parent 37e26c0 commit 7576332

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/lib/tour/onboarding/06_1_MenuIconStep.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { defaultTooltipModifiers, IWalletHTMLElements } from '..';
2-
import { ITourStep, OnboardingTourStep } from '../types';
2+
import { IOnboardingGetStepFnArgs, ITourStep, OnboardingTourStep } from '../types';
33
import { getOnboardingTexts } from './OnboardingTourTexts';
44

5-
export function getMenuIconStep(): ITourStep {
5+
export function getMenuIconStep({ toggleHighlightButton }: IOnboardingGetStepFnArgs): ITourStep {
66
return {
77
path: '/',
88
tooltip: {
@@ -30,14 +30,17 @@ export function getMenuIconStep(): ITourStep {
3030
},
3131
lifecycle: {
3232
mounted: async ({ goToNextStep }) => {
33+
const hamburguerIconSelector = `${IWalletHTMLElements.ACCOUNT_OVERVIEW_TABLET_MENU_BAR} > button.reset`;
3334
// 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;
3636

3737
const onHamburguerClick = () => goToNextStep();
3838
hamburguerIcon!.addEventListener('click', onHamburguerClick, true);
3939

40+
toggleHighlightButton(hamburguerIconSelector, true, 'gray');
41+
4042
return () => {
43+
toggleHighlightButton(hamburguerIconSelector, false, 'gray');
4144
hamburguerIcon!.removeEventListener('click', onHamburguerClick, true);
4245
};
4346
},

src/lib/tour/onboarding/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function getOnboardingTourSteps({ root }: SetupContext, screenTypes: Scre
5858
get [OnboardingTourStep.MENU_ICON]() {
5959
// show only this step if it is a new user and is not in a large screen
6060
return (!screenTypes.isLargeScreen.value && startedFrom === ITourOrigin.WELCOME_MODAL)
61-
? getMenuIconStep() : undefined;
61+
? getMenuIconStep(args) : undefined;
6262
},
6363
[OnboardingTourStep.ACCOUNT_OPTIONS]: getAccountOptionsStep(args),
6464
get [OnboardingTourStep.BACKUP_OPTION_FROM_OPTIONS]() {

0 commit comments

Comments
 (0)