Components

MusicSelection

<MusicSelection choirId choirName isMobileBrowser history doesUserGetFeedback match showAlert musicSelected setUserGetsFeedback />

Renders the MusicSelection component

Constructor

# <MusicSelection choirId choirName isMobileBrowser history doesUserGetFeedback match showAlert musicSelected setUserGetsFeedback />

PropTypes:
Name Type Required Description Default
choirId string Yes The id of the selected choir
choirName string Yes The name of the selected choir
isMobileBrowser bool Yes Indicates if the browser is a mobile browser
history object Yes React Router history object. This is provided by the withRouter function.
doesUserGetFeedback bool No Indicates if the user gets feedback
match object Yes React Router match object. This is provided by the withRouter function.
showAlert func Yes Shows an alert
musicSelected func Yes Updates Redux with music data
setUserGetsFeedback func Yes Sets if the user gets feedback
Author:

View Source components/MusicSelection/MusicSelection.js, line 33

Extends

  • Component

Members

boolean

# _isMounted

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

View Source components/MusicSelection/MusicSelection.js, line 50

# state

MusicSelection component state
Properties:
Name Type Description
isLoading boolean Indicates if the component is in a loading state
musicList array An array of sheet music associated with the selected choir

View Source components/MusicSelection/MusicSelection.js, line 39

Methods

# static mapDispatchToProps(dispatch) → {object}

Passes certain Redux actions to the MusicSelection 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/MusicSelection/MusicSelection.js, line 315

Redux actions used in the MusicSelection component
object

# static mapStateToProps(state) → {object}

Gets the current state from Redux and passes parts of it to the MusicSelection component as props. This function is used only by the react-redux connect function.
Parameters:
Name Type Description
state object The Redux state

View Source components/MusicSelection/MusicSelection.js, line 299

Redux state properties used in the MusicSelection component
object

# componentDidMount()

Sets _isMounted to true Gets the list of music

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

# componentWillUnmount()

Sets _isMounted to false

View Source components/MusicSelection/MusicSelection.js, line 64

# getMusicCards() → {array}

Gets an array of MusicCard components

View Source components/MusicSelection/MusicSelection.js, line 170

An array of MusicCard components
array

# getMusicList()

Gets the list of music associated with the selected choir. Updates state with the music list.

View Source components/MusicSelection/MusicSelection.js, line 73

# render()

Renders the MusicSelection component

View Source components/MusicSelection/MusicSelection.js, line 212

# showMobileBrowserAlert()

Shows an alert indicating that the user cannot access the selected page on a mobile browser

View Source components/MusicSelection/MusicSelection.js, line 157

# viewPerformanceClickedHandler(id)

If the browser is not a mobile browser, (1) Updates Redux with the selected piece of music, and (2) Routes to the music performance page
Parameters:
Name Type Description
id string The id of the selected piece of music

View Source components/MusicSelection/MusicSelection.js, line 140

# viewSongClickedHandler(id)

If the browser is not a mobile browser, (1) Updates Redux with the selected piece of music, and (2) Routes to the practice music page
Parameters:
Name Type Description
id string The id of the selected piece of music

View Source components/MusicSelection/MusicSelection.js, line 120