-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Dashboard: Single file mode #4188
Changes from all commits
e3e74ad
396e995
a1363f7
56717da
ea80f81
2e8db05
1bc09da
b276986
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ const HEIGHT_MD = 400 | |
|
||
export default function Dashboard (props) { | ||
const noFiles = props.totalFileCount === 0 | ||
const singleFile = props.totalFileCount === 1 | ||
|
||
const isSizeMD = props.containerWidth > WIDTH_MD | ||
|
||
const dashboardClassName = classNames({ | ||
|
@@ -35,6 +37,7 @@ export default function Dashboard (props) { | |
'uppy-size--height-md': props.containerHeight > HEIGHT_MD, | ||
'uppy-Dashboard--isAddFilesPanelVisible': props.showAddFilesPanel, | ||
'uppy-Dashboard--isInnerWrapVisible': props.areInsidesReadyToBeVisible, | ||
'uppy-Dashboard--singleFile': singleFile, | ||
}) | ||
|
||
// Important: keep these in sync with the percent width values in `src/components/FileItem/index.scss`. | ||
|
@@ -135,6 +138,7 @@ export default function Dashboard (props) { | |
<FileList | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
singleFile={singleFile} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's based on width, so it's |
||
itemsPerRow={itemsPerRow} | ||
/> | ||
) : ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
width: 38px; | ||
height: 38px; | ||
opacity: 0.9; | ||
color: $white; | ||
|
||
.uppy-size--md & { | ||
width: 55px; | ||
|
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.
The need for
const LARGE_THUMBNAIL = 600
is not evident for all images, so here is one example where it does matter.Without
#generateLargeThumbnailIfSingleFile
:With
#generateLargeThumbnailIfSingleFile
: