-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/state machine #90
Conversation
// Render the component if it exists, otherwise a fallback or null | ||
return ( | ||
<ErrorBoundary | ||
globalError={globalError} | ||
isDevMode={isDevMode} | ||
customerSupportEmail={customerSupportEmail} | ||
> | ||
{ScreenComponent ? <ScreenComponent /> : <EndComponent />} | ||
{initialized ? ScreenComponent ? <ScreenComponent /> : <EndComponent /> : <LoadingScreen />} |
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.
My opinion for loader is, since Auth components are more like login/signup pages we should let the user handler their loaders and, if not that, then atleast make it customizable so that they can replace the loaders.
My suggested solution is to just let users handle the loader and emit an event when our component has been initialized.
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 easiest way for now is to have the Loading Spinner I think (for us its just adding this single component here and a bit less for the developer to take care of). If people ask for that functionality (controlling the loading by themselves), we can just as you say expose the initialised info).
</div> | ||
<div className='error-details'> | ||
<div className='error-detail-row'> | ||
<div className='error-detail-title'>Message</div> | ||
<div className='error-detail-title'>:Message</div> |
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.
should we add translations for error boundary component?
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.
Yes valid point. For the NonRecoverableError component that we only show in DEV mode, English is fine I think. But for the generic error page, we should have a translation I think. I will add one.
@@ -100,6 +100,13 @@ | |||
"button_start": "Create passkey", | |||
"button_skip": "Maybe later" | |||
} | |||
}, | |||
"unexpectedError": { |
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.
let's follow a similar convention to:
"passkeySuccess": {
"header": "Welcome!",
"subheader": "Passkey created",
"body_text1": "You can now confirm your identity using your ",
"body_text2": "passkey or via email one time code",
"body_text3": " when you log in.",
"button": "Continue"
}
then we can call this:
"unexpectedErrorSupport": {
"header": "Something went wrong",
"subheader": "We’re sorry that our service is currently not available.",
"body_withCustomerSupport": "Please try again in a few moments and if the issue persists, please contact {{customerSupportEmail}}.",
"body_noCustomerSupport": "Please try again in a few moments.",
"button": "Refresh Page"
}
* added error handling for invalid otp * added new translation schema * updated translation schema * added error handling for initiate signup * added error handling for initiate login * added email otp error cases * added error handling for all screens * added error boundary for handling non recoverable errors * fixed styling issues in error boundary * updated german translation * updated french translation * Feature/state machine (#90) * State machine for signup flows * Update login flows * Removed unused code, synced translations * Added missing fields to NonRecoverabelError page * Removed console.logs * Temporarily deactivate the react-sdk-example * PR feedback: Formatting, translations for generic error page, general feedback * Fix hardcoded isDevMode in example * Fixed react-sdk-example * PR feedback: error translation structure --------- Co-authored-by: Incorbador <[email protected]> --------- Co-authored-by: Incorbador <[email protected]> Co-authored-by: Incorbador <[email protected]>
The main idea of this PR is to remove all "hard" logic from @corabdo/react and to move it into the flowHandler.
Basic concept:
Advantages of this approach:
Disadvantages:
Future refactoring:
Additional changes: