Components

Primary

<Primary signOut />

Renders the Primary component. This is the container component for all of the components that should include a header, sidebar, and footer.

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
Author:

View Source pages/Primary/Primary.js, line 52

Extends

  • Component

Members

string
The copyright year for the app

View Source pages/Primary/Primary.js, line 76

# _isMounted

Indicates if the component is mounted. Used for asynchronous tasks.
See:

View Source pages/Primary/Primary.js, line 89

string

# _VERSION_NUMBER

The current app version number

View Source pages/Primary/Primary.js, line 82

# 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

View Source pages/Primary/Primary.js, line 64

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

View Source pages/Primary/Primary.js, line 386

Redux actions used in the Primary component
object

# alertIsDoneHandler()

Sets alertData in state to null in state when the alert disappears

View Source pages/Primary/Primary.js, line 258

# componentDidMount()

Creates an event listener for window resize

View Source pages/Primary/Primary.js, line 94

# componentWillUnmount()

Removes the window event resize event listener

View Source pages/Primary/Primary.js, line 107

# getMainNav() → {object}

Gets the main navigation based on the screen size

View Source pages/Primary/Primary.js, line 267

- 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

View Source pages/Primary/Primary.js, line 169

A tab (data only, not JSX)
object

# getMainNavTabs() → {array}

Generates the main navigation tabs

View Source pages/Primary/Primary.js, line 117

An array of navigation tabs (data only, not JSX)
array

# handleWindowResize()

Updates state when the window resizes

View Source pages/Primary/Primary.js, line 184

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)

View Source pages/Primary/Primary.js, line 214

# render() → {object}

Renders the Primary component

View Source pages/Primary/Primary.js, line 299

The JSX to render
object

# 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

View Source pages/Primary/Primary.js, line 248

# showHideHamburgerMenu()

Shows or hides the hamburger menu

View Source pages/Primary/Primary.js, line 192

# signOutClickedHandler()

Gets confirmation from user and then signs the user out

View Source pages/Primary/Primary.js, line 202