Constructor
# <Auth />
Extends
- Component
Members
# _isMounted
Indicates if the component is mounted.
Used for asynchronous tasks.
# state
Auth component state
Properties:
Name | Type | Description |
---|---|---|
authStage |
module:authStages | The current auth stage (see authStages enum) |
windowInnerHeight |
number | The inner height of the window (used to resize the component) |
isLoading |
boolean | Indicates whether the component is in a loading state |
alertData |
object | Data used to display an alert |
type |
module:alertBarTypes | The type of alert bar to show |
heading |
string | The alert heading |
message |
string | The alert message |
Methods
# alertIsDoneHandler()
Sets alertData in state to null in state when the alert disappears
# authFlowStageDoneHandler()
Moves to the next auth stage when the current stage is complete.
If the flow is done, signals to Redux that the flow is done (sign in or sign up).
Parameters:
Type | Description |
---|---|
module:authStages | The auth stage that is complete |
# componentDidMount()
Starts the auth flow.
Starts a window resize listener.
# getAuthCard() → {object}
Gets the correct auth card based on the current auth stage
An auth card (JSX)
object
# resizeWindow()
Updates state when the inner height of the window changes
# showAlertHandler()
Sets alertData in state when a new alert is triggered
Parameters:
Type | Description |
---|---|
alertBarTypes | The type of alert bar to show |
string | The alert heading |
string | The alert message |
# switchAuthFlowHandler()
Switches to the opposite auth flow.
If the current auth flow is sign in, switch to sign up, and vice versa.