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

Add Upload to Storybook and make it reusable and move it into it's own component #1095

Closed
Traxmaxx opened this issue Oct 16, 2023 · 4 comments · Fixed by #1117
Closed

Add Upload to Storybook and make it reusable and move it into it's own component #1095

Traxmaxx opened this issue Oct 16, 2023 · 4 comments · Fixed by #1117
Assignees

Comments

@Traxmaxx
Copy link
Contributor

Traxmaxx commented Oct 16, 2023

We introduced a new Feedback widget width a drag'n'drop file upload. We would like to make this component reusable in other pages and add it to our Storybook.

Figma designs are here

Screenshot 2023-10-17 at 10 26 50

You will find the current upload form inside /Users/traxmaxx/Sites/tailwarden/komiser/dashboard/components/feedback-widget/FeedbackWidget.tsx:1. Look for something like

 <FileUploader
                    classes={
                      fileAttachement === null
                        ? `grow cursor-pointer rounded border-2 border-dashed border-black-170 py-5 text-center text-xs transition hover:border-[#B6EAEA] hover:bg-black-100 w-[50%]`
                        : `grow min-h-full flex-1 rounded border-2 border-[#B6EAEA] text-center text-xs transition w-full`
                    }
                    disabled={
                      fileAttachement !== null ||
                      isSendingFeedback ||
                      isTakingScreenCapture
                    }
                    handleChange={uploadFile}
                    name="attachement"
                    types={FILE_TYPES}
                    fileOrFiles={fileAttachement}
                    hoverTitle="drop here"
                    maxSize={MAX_FILE_SIZE_MB}
                    onTypeError={(err: string) =>
                      setToast({
                        hasError: true,
                        title: 'File upload failed',
                        message: err
                      })
                    }
                    onSizeError={(err: string) =>
                      setToast({
                        hasError: true,
                        title: 'File upload failed',
                        message: err
                      })
                    }
                    dropMessageStyle={{
                      width: '100%',
                      height: '100%',
                      position: 'absolute',
                      background: '#F4F9F9',
                      top: 0,
                      right: 2,
                      display: 'flex',
                      flexGrow: 2,
                      opacity: 1,
                      zIndex: 20,
                      color: '#008484',
                      fontSize: 14,
                      border: 'none'
                    }}
                  >
...
 </FileUploader>

Please move this into it's own component with all necessary props and stylings and make sure the FeedbackWidget is using the new implementation. Also please add the new component to Storybook with all necessary variants and a proper documentation.

Additional context
If you want to tackle this task, feel free to share with us your email address so we can give you access to the Figma project :)

@faisal7008
Copy link
Contributor

hey @Traxmaxx i would like to do this task, Can you assign this to me ?

@Traxmaxx
Copy link
Contributor Author

Hei @faisal7008! It's all your's! Do you already have access to our Figma? If not we would need your email to give you access : )

@faisal7008
Copy link
Contributor

Hei @faisal7008! It's all your's! Do you already have access to our Figma? If not we would need your email to give you access : )
Thanks @Traxmaxx
I already started working on it. Also, Please share the access to figma on [email protected]

@Traxmaxx
Copy link
Contributor Author

You should have received an invite!

faisal7008 added a commit to faisal7008/komiser that referenced this issue Oct 19, 2023
mlabouardy added a commit that referenced this issue Oct 20, 2023
feat: add reusable upload component to storybook #1095
faisal7008 added a commit to faisal7008/komiser that referenced this issue Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants