ui improvement
This commit is contained in:
@@ -231,6 +231,23 @@ export function OnboardingPage() {
|
||||
persist(completeStep(state, step, nextOf(step)));
|
||||
}
|
||||
|
||||
/*
|
||||
Each step of the wizard starts at the top of itself.
|
||||
|
||||
The steps are STATE, not routes, so the shell's own reset — which keys on the
|
||||
pathname — never fires here: the URL is `/admin/onboarding` for all seven of
|
||||
them. Finishing the inventory step from the bottom of a long list and
|
||||
pressing Save & continue therefore opened the next step already scrolled past
|
||||
its heading and its explanation, which is exactly the part a person setting
|
||||
up a shop for the first time needs to read.
|
||||
|
||||
Instant, for the same reason the shell's is: this replaces the whole page
|
||||
body, so there is nothing continuous for a smooth travel to connect.
|
||||
*/
|
||||
useEffect(() => {
|
||||
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
||||
}, [step]);
|
||||
|
||||
const heading = HEADINGS[step];
|
||||
const isFirst = step === 'welcome';
|
||||
const isLast = step === 'done';
|
||||
|
||||
Reference in New Issue
Block a user