Skip to content

Commit 89c6623

Browse files
committed
Updated tour with overnice feedback
- Save tour index, so if user reloads page, can keep going from the last step - Fixed UI and UX errors
1 parent 7576332 commit 89c6623

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

src/components/Tour.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default defineComponent({
217217
setTourAsArray();
218218
219219
const isLoading = ref(true);
220-
const currentStep: Ref<TourStepIndex> = ref(0);
220+
const currentStep: Ref<TourStepIndex> = ref(accountStore.tour?.step || 0);
221221
const nSteps: Ref<number> = ref(steps.value.length);
222222
const disableNextStep = ref(true);
223223
const showTour = ref(false);
@@ -379,6 +379,8 @@ export default defineComponent({
379379
nSteps: nSteps.value,
380380
},
381381
});
382+
383+
accountStore.tour!.step = currentStep.value;
382384
}
383385
384386
function _broadcast(data: ITourBroadcast) {
@@ -664,8 +666,7 @@ export default defineComponent({
664666
cursor: not-allowed;
665667
}
666668
667-
#app[data-tour-active] [data-scroll-locked],
668-
#app[data-tour-active] [data-scroll-locked] * {
669+
#app[data-tour-active] [data-scroll-locked] {
669670
overflow: hidden;
670671
}
671672

src/components/layouts/Settings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ export default defineComponent({
377377
}
378378
379379
function goToOnboardingTour() {
380-
useAccountStore().setTour({ name: TourName.ONBOARDING, startedFrom: ITourOrigin.SETTINGS });
380+
useAccountStore().setTour({ name: TourName.ONBOARDING, startedFrom: ITourOrigin.SETTINGS, step: 0 });
381381
context.root.$router.push('/');
382382
}
383383

src/components/modals/DiscoverTheNimiqWalletModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default defineComponent({
4949
const { setTour } = useAccountStore();
5050
5151
function startTour() {
52-
setTour({ name: TourName.ONBOARDING, startedFrom: ITourOrigin.WELCOME_MODAL });
52+
setTour({ name: TourName.ONBOARDING, startedFrom: ITourOrigin.WELCOME_MODAL, step: 0 });
5353
context.root.$router.push('/');
5454
}
5555

src/components/modals/NetworkInfoModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default defineComponent({
5656
}
5757
5858
function goToNetworkTour() {
59-
useAccountStore().setTour({ name: TourName.NETWORK });
59+
useAccountStore().setTour({ name: TourName.NETWORK, step: 0 });
6060
context.emit('close');
6161
}
6262

src/lib/tour/onboarding/02_TransactionListStep.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getTransactionListStep(
4141
txsLen.value === 0 ? '' : IWalletHTMLElements.BUTTON_ADDRESS_OVERVIEW_BUY,
4242
],
4343
scrollLockedElements: [
44-
`${IWalletHTMLElements.ACCOUNT_OVERVIEW_ADDRESS_LIST} .vue-recycle-scroller`,
44+
IWalletHTMLElements.ACCOUNT_OVERVIEW_ADDRESS_LIST,
4545
`${IWalletHTMLElements.ADDRESS_OVERVIEW_TRANSACTIONS} .vue-recycle-scroller`,
4646
],
4747
explicitInteractableElements: [
@@ -98,10 +98,11 @@ export function getTransactionListStep(
9898
});
9999

100100
// Add hightlight effect to 'Get Free NIM' button
101-
toggleHighlightButton(IWalletHTMLElements.ADDRESS_OVERVIEW_ACTIONS, true, 'green');
101+
toggleHighlightButton(IWalletHTMLElements.BUTTON_ADDRESS_OVERVIEW_RECEIVE_FREE_NIM, true, 'green');
102102
return () => {
103103
unwatch();
104-
return toggleHighlightButton(IWalletHTMLElements.ADDRESS_OVERVIEW_ACTIONS, false, 'green');
104+
return toggleHighlightButton(
105+
IWalletHTMLElements.BUTTON_ADDRESS_OVERVIEW_RECEIVE_FREE_NIM, false, 'green');
105106
};
106107
},
107108
},

src/stores/Account.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import { createStore } from 'pinia';
1+
import { ITourOrigin, TourName, TourStepIndex } from '@/lib/tour';
22
import { Account } from '@nimiq/hub-api';
3-
import { TourName, ITourOrigin } from '@/lib/tour';
4-
import { useAddressStore } from './Address';
3+
import { createStore } from 'pinia';
54
import { CryptoCurrency } from '../lib/Constants';
5+
import { useAddressStore } from './Address';
66

77
export type AccountState = {
88
accountInfos: {[id: string]: AccountInfo},
99
activeAccountId: string | null,
1010
activeCurrency: CryptoCurrency,
11-
tour: { name: TourName.NETWORK } | { name: TourName.ONBOARDING, startedFrom: ITourOrigin } | null,
11+
tour:
12+
{ name: TourName.NETWORK, step: TourStepIndex } |
13+
{ name: TourName.ONBOARDING, step: TourStepIndex, startedFrom: ITourOrigin } |
14+
null,
1215
}
1316

1417
// Mirror of Hub WalletType, which is not exported

0 commit comments

Comments
 (0)