Constructor
# <Primary signOut />
Sets up state
PropTypes:
Name | Type | Required | Description | Default |
---|---|---|---|---|
signOut |
func | Yes | Tells Redux to sign the user out |
Parameters:
Name | Type | Description |
---|---|---|
props |
object | See PropTypes |
Extends
- Component
Members
# _isMounted
Indicates if the component is mounted.
Used for asynchronous tasks.
# state
Primary component state
Properties:
Name | Type | Description |
---|---|---|
isMobileScreenWidth |
boolean | Indicates if the screen width is mobile (i.e. < 768px) |
showMobileNav |
boolean | Indicates if the mobile navigation should be shown |
alertData |
object | null | 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
# static mapDispatchToProps(dispatch) → {object}
Passes certain Redux actions to the Primary component as props.
This function is used only by the react-redux connect function.
Parameters:
Name | Type | Description |
---|---|---|
dispatch |
function | The react-redux dispatch function |
Redux actions used in the Primary component
object
# alertIsDoneHandler()
Sets alertData in state to null in state when the alert disappears
# componentDidMount()
Creates an event listener for window resize
# componentWillUnmount()
Removes the window event resize event listener
# getMainNav() → {object}
Gets the main navigation based on the screen size
- A JSX element representing the main navigation
object
# getMainNavTab(name, blueIcon, whiteIcon, isCurrent) → {object}
Creates a main navigation tab
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The tab name |
blueIcon |
string | A blue version of the icon |
whiteIcon |
string | A white version of the icon |
isCurrent |
boolean | Indicates whether the tab is the current tab |
A tab (data only, not JSX)
object
# getMainNavTabs() → {array}
Generates the main navigation tabs
An array of navigation tabs (data only, not JSX)
array
# handleWindowResize()
Updates state when the window resizes
# navLinkClickedHandler(key)
Updates the isCurrentTab boolean for all main navigation tabs based on the tab that was clicked on.
Updates state with the new tabs (data only, not JSX)
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key of the tab that was clicked on (uses the same key prop that React uses) |
# 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 |
# showHideHamburgerMenu()
Shows or hides the hamburger menu
# signOutClickedHandler()
Gets confirmation from user and then signs the user out