-
Notifications
You must be signed in to change notification settings - Fork 3
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 component #316
Add upload component #316
Conversation
Preview link: https://316.react-ui.aboutbits.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work! I have added some suggestions and questions for discussion.
fileUploadObject: FileUploadObject<CustomRemoteFile>, | ||
) => { | ||
setIsDeleting(true) | ||
await axiosInstance.post('/delete') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a try/catch here to have a good example code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should be in the catch in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. We could just ignore it in this example and add a comment Handle error accordingly
or something. Wdyt?
src/components/files/index.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to export the actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we don't have any icons in this lib. I see the following possibilities for this:
- Keep it for internal use only (no export)
- Export it as component for projects
- Remove it and require the user to set a custom
spinnerIcon
prop where needed. - Do not use a custom animated icon, but use the Progress Activity icon from our icon lib and rotate it.
Maybe option 4 is the most consistend, otherwise I would go with option 2.
Wdyt @alexlanz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean that we do not have any custom icons in ReactUI, but we are using our Material Icons package right?
Allowing to add a custom spinner icon is a bit of an overkill or not? I would try to go with option 4, because then we stick to the same icons that we already use and the animation could be done with only CSS.
What do you both think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, option 4 sounds also good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one too many tsx's in that filename ;)
No description provided.