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