Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reusable upload component to storybook #1095 #1117

Merged

Conversation

faisal7008
Copy link
Contributor

@faisal7008 faisal7008 commented Oct 19, 2023

Problem

The existing Feedback widget in our application had a file upload feature that wasn’t reusable and wasn’t included in our Storybook.

fixes #1095

Solution

To address this issue, I refactored the file upload feature into its own Upload component. This new component includes all the necessary props and stylings, making it easily reusable across different parts of our application. I also ensured that the FeedbackWidget is now using this new Upload component. In addition, I added the Upload component to our Storybook. This includes all necessary variants (supporting both single and multiple file uploads)

Changes Made

  • Refactored file upload feature into a new, reusable Upload component.
  • Updated FeedbackWidget to use the new Upload component.
  • Added Upload component to Storybook with support for both single and multiple file uploads.

Screenshots

Screenshot 2023-10-19 at 8 41 57 PM Screenshot 2023-10-19 at 8 42 22 PM

Checklist

  • Code follows the contributing guidelines
  • Changes have been thoroughly tested
  • Documentation has been updated, if necessary
  • Any dependencies have been added to the project, if necessary

Reviewers

@Traxmaxx

</div>
)}
{fileAttachement !== null && (
<div className="relative h-full w-full px-6 py-5">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we adjust the Upload component so it will accept children for the feedback screenshot functionality? It already takes care of assigning a proper file type to the Upload component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we can do that. should i make changes and raise PR

@Traxmaxx
Copy link
Contributor

Really great PR so far. Thanks for taking care of the issue! 🙏

@mlabouardy mlabouardy added the ui label Oct 19, 2023
@mlabouardy mlabouardy added this to the v3.1.2 milestone Oct 19, 2023
@mlabouardy
Copy link
Collaborator

@faisal7008 can you fix the conflict so the PR can be merged please

@faisal7008
Copy link
Contributor Author

@faisal7008 can you fix the conflict so the PR can be merged please
fixed the conflict, you can merge the PR now

@mlabouardy mlabouardy merged commit 793bc3c into tailwarden:develop Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Upload to Storybook and make it reusable and move it into it's own component
3 participants