Components

ChoirSelection

<ChoirSelection routing history showAlert choirSelectedForPractice choirSelectedForChoirs />

Renders the choir selection component Shows a card for each choir, as well as card(s) for choir option(s).

Constructor

# <ChoirSelection routing history showAlert choirSelectedForPractice choirSelectedForChoirs />

PropTypes:
Name Type Required Description Default
routing enum Yes Where to route when a choir card is clicked on. see options.
history object Yes React Router history object. This is provided by the withRouter function.
showAlert func Yes Shows an alert
choirSelectedForPractice func Yes Updates Redux with choir data. Used when selecting a choir to practice for.
choirSelectedForChoirs func Yes Updates Redux with choir data. Used when selecting a choir to view members of.
Author:

View Source components/ChoirSelection/ChoirSelection.js, line 40

Extends

  • Component

Members

# _isMounted

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

View Source components/ChoirSelection/ChoirSelection.js, line 56

# choirClickedHandler

Updates Redux with the selected choir id and choir name Routes to the new url

View Source components/ChoirSelection/ChoirSelection.js, line 118

# getChoirComponents

Creates a ChoirCard component for each choir. Also creates a ChoirOptionCard for each choir option.

View Source components/ChoirSelection/ChoirSelection.js, line 187

# state

ChoirSelection component state
Properties:
Name Type Description
isLoading boolean Indicates if the component is in a loading state
choirs array An array of choirs that the user is a member of

View Source components/ChoirSelection/ChoirSelection.js, line 46

Methods

# static mapDispatchToProps(dispatch) → {object}

Passes certain Redux actions to the ChoirSelection 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 components/ChoirSelection/ChoirSelection.js, line 339

Redux actions used in the ChoirSelection component
object

# componentDidMount()

Sets _isMounted to true. Gets the list of choirs.

View Source components/ChoirSelection/ChoirSelection.js, line 62

# componentWillUnmount()

Sets _isMounted to false

View Source components/ChoirSelection/ChoirSelection.js, line 70

# getChoirCards() → {array}

Gets an array of ChoirCard components

View Source components/ChoirSelection/ChoirSelection.js, line 221

An array of ChoirCard components
array

# getChoirList()

Gets the list of choirs that the user is a member of

View Source components/ChoirSelection/ChoirSelection.js, line 78

# newChoirClickHandler()

Attempts to join a new choir

View Source components/ChoirSelection/ChoirSelection.js, line 145

# render()

Renders the ChoirSelection component

View Source components/ChoirSelection/ChoirSelection.js, line 268