-
Notifications
You must be signed in to change notification settings - Fork 317
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
chore(file-uploader): Fixed bugs related to visuals and pausing #3072
Conversation
|
packages/react/src/components/Storage/FileUploader/FileUploader.tsx
Outdated
Show resolved
Hide resolved
@@ -74,7 +74,7 @@ Array [ | |||
style={ | |||
Object { | |||
"alignItems": "center", | |||
"borderColor": "hsl(210, 8%, 55%)", | |||
"borderColor": "hsl(210, 10%, 58%)", |
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 are a bunch of snapshot test updates because I changed a border color.
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.
👍
packages/react/src/components/Storage/FileUploader/FileUploader.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/Storage/FileUploader/FileUploader.tsx
Outdated
Show resolved
Hide resolved
@@ -100,11 +100,15 @@ | |||
--amplify-components-fileuploader-file-image-border-radius | |||
); | |||
color: var(--amplify-components-fileuploader-file-image-color); | |||
img { | |||
max-height: 100%; |
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.
Just curious, why is this needed?
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.
It's defaulting to auto
and it needs to be 100% for it to fill the container.
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.
Does inherit
do the trick? 100% may cause issues if the parent's width is specified. non-blocking tho.
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.
In inherit does not work. It overflows on that value. I can change it to height
100% if that's better.
const isValidExtension = (fileName: string, fileName2: string): boolean => { | ||
const extension = fileName.split('.').pop(); | ||
const fileExtension = fileName2.split('.').pop(); | ||
return fileExtension === extension; | ||
}; |
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.
I would either memoize this function with a useCallback, or better yet, move it outside the component in a util file, to prevent unnecessary re-renders from happenning.
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.
OK, I'll move it into the uploader utils.
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.
Description of changes
This PR fixes the following issues
resume
file state in the file trackerIssue #, if available
Asana
Description of how you validated changes
Added tests
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.