Components

ProfileCard

<ProfileCard isAuthenticated setLoading showAlert updateUserInfo showWelcomePage done />

Renders the ProfileCard component. Handles the user profile setup.

Constructor

# <ProfileCard isAuthenticated setLoading showAlert updateUserInfo showWelcomePage done />

PropTypes:
Name Type Required Description Default
isAuthenticated bool Yes Indicates if a user is authenticated
setLoading func Yes Tells Redux to show/hide the loading HUD (true for show and false for hide (i.e. remove))
showAlert func Yes Tells Redux to show an alert
updateUserInfo func Yes Tells Redux to get updated user data from the server
showWelcomePage func Yes Tells Redux to show the welcome page
done func Yes Tells Redux that this component is no longer needed (i.e. done)
Author:

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 34

Extends

  • Component

Members

# state

ProfileCard component state
Properties:
Name Type Description
formData object Form input values
profilePicture object A profile picture image file
firstName string The first name input value
lastName string The last name input value

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 42

Methods

# static mapDispatchToProps(dispatch) → {object}

Passes certain Redux actions to the ProfileCard 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/AuthCards/ProfileCard/ProfileCard.js, line 411

Redux actions used in the ProfileCard component
object

# static mapStateToProps(state) → {object}

Gets the current state from Redux and passes parts of it to the ProfileCard 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/AuthCards/ProfileCard/ProfileCard.js, line 398

Redux state properties used in the ProfileCard component
object

# getImageInputElement()

Gets the image input element

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 227

The image input element (JSX)

# imageInputErrorHandler()

Shows an alert and removes the image from state

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 74

# imageInputValueChangedHandler(event)

Updates state with new file input image
Parameters:
Name Type Description
event The event that called this function

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 55

# removeImageHandler()

Removes the current image from state

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 92

# render()

Renders the ProfileCard component

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 296

# submitHandler(event)

Submits the profile form
Parameters:
Name Type Description
event object The event that called this function

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 126

# textInputValueChangedHandler(event)

Updates state with new text input value
Parameters:
Name Type Description
event The event that called this function

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 107

# uploadData() → {promise}

Uploads the profile picture to Firebase storage Sends the user's first name and last name to the AWS server

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 167

A promise that is waiting for the user data to upload
promise

# uploadProfilePicture() → {promise}

Uploads the profile picture in the form to Firebase storage

View Source components/AuthCards/ProfileCard/ProfileCard.js, line 212

A promise that is waiting for the user's profile picture to upload
promise