mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
BrowseStep: Remove useless Fragment
This commit is contained in:
parent
1a8117710e
commit
ebda35b916
@ -64,121 +64,119 @@ export const BrowseStep = ({
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={4}>
|
||||
{assets.length > 0 && onSelectAllAsset && (
|
||||
<Box>
|
||||
<Box paddingBottom={4}>
|
||||
<Flex justifyContent="space-between" alignItems="flex-start">
|
||||
<StartBlockActions wrap="wrap">
|
||||
{multiple && (
|
||||
<Flex
|
||||
paddingLeft={2}
|
||||
paddingRight={2}
|
||||
background="neutral0"
|
||||
hasRadius
|
||||
borderColor="neutral200"
|
||||
height={`${32 / 16}rem`}
|
||||
>
|
||||
<BaseCheckbox
|
||||
aria-label={formatMessage({
|
||||
id: getTrad('bulk.select.label'),
|
||||
defaultMessage: 'Select all assets',
|
||||
})}
|
||||
indeterminate={!areAllAssetSelected && hasSomeAssetSelected}
|
||||
value={areAllAssetSelected}
|
||||
onChange={onSelectAllAsset}
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
<SortPicker onChangeSort={onChangeSort} />
|
||||
<Filters
|
||||
appliedFilters={queryObject.filters.$and}
|
||||
onChangeFilters={onChangeFilters}
|
||||
/>
|
||||
</StartBlockActions>
|
||||
<EndBlockActions pullRight>
|
||||
<SearchAsset onChangeSearch={onChangeSearch} queryValue={queryObject._q || ''} />
|
||||
</EndBlockActions>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{folders.length > 0 && (
|
||||
<FolderList
|
||||
folders={folders}
|
||||
size="S"
|
||||
onChangeFolder={onChangeFolder}
|
||||
onEditFolder={null}
|
||||
onSelectFolder={null}
|
||||
title={formatMessage({
|
||||
id: getTrad('list.folders.title'),
|
||||
defaultMessage: 'Folders',
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
|
||||
{assets.length > 0 ? (
|
||||
<AssetList
|
||||
allowedTypes={allowedTypes}
|
||||
size="S"
|
||||
assets={assets}
|
||||
onSelectAsset={onSelectAsset}
|
||||
selectedAssets={selectedAssets}
|
||||
onEditAsset={onEditAsset}
|
||||
title={formatMessage({
|
||||
id: getTrad('list.assets.title'),
|
||||
defaultMessage: 'Assets',
|
||||
})}
|
||||
/>
|
||||
) : (
|
||||
<Box paddingBottom={6}>
|
||||
<EmptyAssets
|
||||
size="S"
|
||||
count={6}
|
||||
action={
|
||||
canCreate && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
id="asset-dialog-title"
|
||||
startIcon={<PlusIcon />}
|
||||
onClick={onAddAsset}
|
||||
<Stack spacing={4}>
|
||||
{assets.length > 0 && onSelectAllAsset && (
|
||||
<Box>
|
||||
<Box paddingBottom={4}>
|
||||
<Flex justifyContent="space-between" alignItems="flex-start">
|
||||
<StartBlockActions wrap="wrap">
|
||||
{multiple && (
|
||||
<Flex
|
||||
paddingLeft={2}
|
||||
paddingRight={2}
|
||||
background="neutral0"
|
||||
hasRadius
|
||||
borderColor="neutral200"
|
||||
height={`${32 / 16}rem`}
|
||||
>
|
||||
{formatMessage({
|
||||
id: getTrad('header.actions.add-assets'),
|
||||
defaultMessage: 'Add new assets',
|
||||
})}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
content={
|
||||
canCreate
|
||||
? formatMessage({
|
||||
id: getTrad('list.assets.empty'),
|
||||
defaultMessage: 'Upload your first assets...',
|
||||
})
|
||||
: formatMessage({
|
||||
id: getTrad('list.assets.empty.no-permissions'),
|
||||
defaultMessage: 'The asset list is empty',
|
||||
})
|
||||
}
|
||||
/>
|
||||
<BaseCheckbox
|
||||
aria-label={formatMessage({
|
||||
id: getTrad('bulk.select.label'),
|
||||
defaultMessage: 'Select all assets',
|
||||
})}
|
||||
indeterminate={!areAllAssetSelected && hasSomeAssetSelected}
|
||||
value={areAllAssetSelected}
|
||||
onChange={onSelectAllAsset}
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
<SortPicker onChangeSort={onChangeSort} />
|
||||
<Filters
|
||||
appliedFilters={queryObject.filters.$and}
|
||||
onChangeFilters={onChangeFilters}
|
||||
/>
|
||||
</StartBlockActions>
|
||||
<EndBlockActions pullRight>
|
||||
<SearchAsset onChangeSearch={onChangeSearch} queryValue={queryObject._q || ''} />
|
||||
</EndBlockActions>
|
||||
</Flex>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{pagination.pageCount > 0 && (
|
||||
<Flex justifyContent="space-between">
|
||||
<PageSize pageSize={queryObject.pageSize} onChangePageSize={onChangePageSize} />
|
||||
<PaginationFooter
|
||||
activePage={queryObject.page}
|
||||
onChangePage={onChangePage}
|
||||
pagination={pagination}
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
</Stack>
|
||||
</>
|
||||
{folders.length > 0 && (
|
||||
<FolderList
|
||||
folders={folders}
|
||||
size="S"
|
||||
onChangeFolder={onChangeFolder}
|
||||
onEditFolder={null}
|
||||
onSelectFolder={null}
|
||||
title={formatMessage({
|
||||
id: getTrad('list.folders.title'),
|
||||
defaultMessage: 'Folders',
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
|
||||
{assets.length > 0 ? (
|
||||
<AssetList
|
||||
allowedTypes={allowedTypes}
|
||||
size="S"
|
||||
assets={assets}
|
||||
onSelectAsset={onSelectAsset}
|
||||
selectedAssets={selectedAssets}
|
||||
onEditAsset={onEditAsset}
|
||||
title={formatMessage({
|
||||
id: getTrad('list.assets.title'),
|
||||
defaultMessage: 'Assets',
|
||||
})}
|
||||
/>
|
||||
) : (
|
||||
<Box paddingBottom={6}>
|
||||
<EmptyAssets
|
||||
size="S"
|
||||
count={6}
|
||||
action={
|
||||
canCreate && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
id="asset-dialog-title"
|
||||
startIcon={<PlusIcon />}
|
||||
onClick={onAddAsset}
|
||||
>
|
||||
{formatMessage({
|
||||
id: getTrad('header.actions.add-assets'),
|
||||
defaultMessage: 'Add new assets',
|
||||
})}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
content={
|
||||
canCreate
|
||||
? formatMessage({
|
||||
id: getTrad('list.assets.empty'),
|
||||
defaultMessage: 'Upload your first assets...',
|
||||
})
|
||||
: formatMessage({
|
||||
id: getTrad('list.assets.empty.no-permissions'),
|
||||
defaultMessage: 'The asset list is empty',
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{pagination.pageCount > 0 && (
|
||||
<Flex justifyContent="space-between">
|
||||
<PageSize pageSize={queryObject.pageSize} onChangePageSize={onChangePageSize} />
|
||||
<PaginationFooter
|
||||
activePage={queryObject.page}
|
||||
onChangePage={onChangePage}
|
||||
pagination={pagination}
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user