Class: MemoryUpload

MemoryUpload()

MemoryUpload component, allows user to upload image and apply filters on their image then create a new memory.

Constructor

new MemoryUpload()

Source:

Methods

blobToBase64(blob) → {Promise}

This function simply converts the Blob data given as input to a base64 string.

Parameters:
Name Type Description
blob Object
Source:
Returns:

Promise on the converted base64

Type
Promise

fileSelectedHandler(event)

Picks up the file selected by user and converts it to base64 image and updates the state of component accordingly.

Parameters:
Name Type Description
event Object

Event object

Source:

filterHandler(event)

This function applies filter to the uploaded image, and updates the state of the component accordingly.

Parameters:
Name Type Description
event event

Event object

Source:

onImageContainerClick()

This function simply makes a click to actual Input Element.

Source:

render()

Renders the input form based on current state of the component.

Source:

textInputHandler(event)

Executes at each keystroke of user for any input text field in the component. As soon as it receives any keystroke from user, this method updates the state of the component accordingly.

Parameters:
Name Type Description
event Object

Event object

Source:

uploadHandler()

Once the user is happy with their image, caption and filters this function fires up as soon as they click "Create a memory". Further, the memory data is sent to the backend.

Source: