-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added stepper with next and back button functionality #1053
Added stepper with next and back button functionality #1053
Conversation
nmoon4
commented
Apr 20, 2023
- Added the stepper component
- The pages for the onboarding can be found in apps/user-profile/src/components/modules/UserOnboardingModal/PlatformOnboarding
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two code refinements needed, once done, then can approve
|
||
const backButton = | ||
// This hides the button if index == 0 | ||
index == 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always use strict equality "===" instead of "=="
|
||
const backOnClickHandler = () => { | ||
if ( | ||
(buttonConfig.back.useDefaultOnClick === undefined) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to if(buttonConfig?.back?.useDefaultOnClick) {...}
if it's undefined it's going to be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ?.
is known as Optional Chaining operator, it returns undefined if the properties does not exist in the object
|
||
const nextOnClickHandler = () => { | ||
if ( | ||
(buttonConfig.next.useDefaultOnClick === undefined) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow same logic as i've added for backOnClickHandler