Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

Create a component for submitting images to the backend #15

@rj-calvin

Description

@rj-calvin

We need to introduce two new form components to our library, FormFileInput and ImageTransform.

FormFileInput will be our React abstraction for <input type="file" /> elements that allow users to select a file from their filesystem for submitting to our backend. Likewise, ImageTransform will be a component that allows an image supplied as a prop to be manipulated/cropped.

Both components should leave most of their interface abstract, making it the responsibility of the caller to handle state involving the files themselves. The caller will supply a callback method to be fired on the onChange event of FormFileInput so that the selected file can be stored in a stateful variable. This update to state can then be used to chain the file into ImageTransform where the cropped image can be stored in a second state variable that can be used when a custom onSubmit callback is fired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions