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. |
Extends
- Component
Members
# _isMounted
Indicates if the component is mounted.
Used for asynchronous tasks.
# choirClickedHandler
Updates Redux with the selected choir id and choir name
Routes to the new url
# getChoirComponents
Creates a ChoirCard component for each choir.
Also creates a ChoirOptionCard for each choir option.
# 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 |
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 |
Redux actions used in the ChoirSelection component
object
# componentDidMount()
Sets _isMounted to true.
Gets the list of choirs.
# componentWillUnmount()
Sets _isMounted to false
# getChoirCards() → {array}
Gets an array of ChoirCard components
An array of ChoirCard components
array
# getChoirList()
Gets the list of choirs that the user is a member of
# newChoirClickHandler()
Attempts to join a new choir
# render()
Renders the ChoirSelection component