Skip to content

Commit

Permalink
fix(Upload): add gap between file and remove button (#4382)
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker authored Dec 11, 2024
1 parent 43a64d4 commit 04c1f6a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const UploadPrefilledFileList = () => (
errorMessage: 'This is no real file!',
},
])
}, [])
}, [setFiles])

return <Upload acceptedFileTypes={['jpg', 'png']} id="file-list" />
}
Expand Down Expand Up @@ -128,7 +128,7 @@ export const UploadRemoveFile = () => (

reader.readAsDataURL(file)
})
}, [files])
}, [files, images])

return (
<Section aria-label="List of chosen images">
Expand Down Expand Up @@ -368,8 +368,15 @@ export const UploadOnFileClick = () => (
{
file: createMockFile('1501870.jpg', 123, 'image/png'),
},
{
file: createMockFile(
'file-name-that-is-very-long-and-has-letters.png',
123,
'image/png',
),
},
])
}, [])
}, [setFiles])

async function mockAsyncFileFetching({ fileItem }) {
const request = createRequest()
Expand All @@ -385,13 +392,11 @@ export const UploadOnFileClick = () => (
}

return (
<>
<Upload
acceptedFileTypes={['jpg', 'png']}
id="upload-on-file-click"
onFileClick={mockAsyncFileFetching}
/>
</>
<Upload
acceptedFileTypes={['jpg', 'png']}
id="upload-on-file-click"
onFileClick={mockAsyncFileFetching}
/>
)
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -818,13 +818,13 @@ button .dnb-form-status__text {
}
.dnb-upload__file-cell__content {
display: flex;
flex-direction: row;
column-gap: var(--spacing-small);
justify-content: space-between;
align-items: center;
}
.dnb-upload__file-cell__content__left {
display: flex;
flex-direction: row;
column-gap: var(--spacing-small);
align-items: center;
}
.dnb-upload__file-cell__content__left .dnb-icon {
Expand All @@ -839,7 +839,6 @@ button .dnb-form-status__text {
.dnb-upload__file-cell__text-container {
display: flex;
flex-direction: column;
margin-left: var(--spacing-small);
}
.dnb-upload__file-cell__text-container--loading {
font-size: var(--font-size-basis);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@

&__content {
display: flex;
flex-direction: row;
column-gap: var(--spacing-small);

justify-content: space-between;
align-items: center;

&__left {
display: flex;
flex-direction: row;
column-gap: var(--spacing-small);
align-items: center;

.dnb-icon {
Expand All @@ -134,8 +134,6 @@
display: flex;
flex-direction: column;

margin-left: var(--spacing-small);

&--loading {
font-size: var(--font-size-basis);
}
Expand Down

0 comments on commit 04c1f6a

Please sign in to comment.