Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Merge origin/main into locker-web-design

vishnukvmd2f62b5dfaff3
diff --cc web/apps/locker/src/components/ItemList.tsx
index bdfa0e5024,c035d47b19..67df04fc21
--- a/web/apps/locker/src/components/ItemList.tsx
+++ b/web/apps/locker/src/components/ItemList.tsx
@@@ -1397,52 -1387,61 +1392,63 @@@ const ItemsSection: React.FC<
emptyState,
}) =>
items.length > 0 ? (
- <Stack sx={{ maxWidth: 760, gap: 0, mt: 1 }}>
+ <Stack
+ sx={{ maxWidth: contentMaxWidth, mx: "auto", gap: 0, mt: 1 }}
+ >
- {items.map((item) => (
- <ItemCard
- key={item.id}
- item={item}
- masterKey={masterKey}
- isTrashView={isTrashView}
- secondaryText={getSecondaryText(item)}
- onClick={() => onSelectItem(item)}
- onEdit={
- onEditItem &&
- (item.ownerID ?? currentUserID) === currentUserID
- ? onEditItem
- : undefined
- }
- onDelete={
- onDeleteItem &&
- (item.ownerID ?? currentUserID) === currentUserID
- ? onDeleteItem
- : undefined
- }
- onPermanentlyDelete={onPermanentlyDelete}
- onRestore={
- isTrashView
- ? (trashItem) => onRequestRestore(trashItem)
- : undefined
- }
- onShareLink={
- onShareLink &&
- canShareLockerFileLink(item, currentUserID)
- ? onShareLink
- : undefined
- }
- fileShareLink={fileShareLinksByFileID.get(item.id)}
- selectionMode={selectionMode}
- selectable
- selected={selectedItemIDSet?.has(item.id)}
- onToggleSelection={onToggleItemSelection}
- onLongPressSelect={onStartSelection}
- />
- ))}
+ {items.map((item) => {
+ const isOwnedByCurrentUser =
+ (item.ownerID ?? currentUserID) === currentUserID;
+ return (
+ <ItemCard
+ key={item.id}
+ item={item}
+ masterKey={masterKey}
+ isTrashView={isTrashView}
+ secondaryText={getSecondaryText(item)}
+ onClick={() => onSelectItem(item)}
+ onEdit={
+ onEditItem && isOwnedByCurrentUser
+ ? onEditItem
+ : undefined
+ }
+ onDelete={
+ onDeleteItem && isOwnedByCurrentUser
+ ? onDeleteItem
+ : undefined
+ }
+ deleteDisabledHint={
+ onDeleteItem &&
+ !isTrashView &&
+ !isOwnedByCurrentUser
+ ? t("actionNotSupportedForSharedFiles", {
+ count: 1,
+ })
+ : undefined
+ }
+ onPermanentlyDelete={onPermanentlyDelete}
+ onRestore={
+ isTrashView
+ ? (trashItem) => onRequestRestore(trashItem)
+ : undefined
+ }
+ onShareLink={
+ onShareLink &&
+ canShareLockerFileLink(item, currentUserID)
+ ? onShareLink
+ : undefined
+ }
+ fileShareLink={fileShareLinksByFileID.get(item.id)}
+ selectionMode={selectionMode}
+ selectable
+ selected={selectedItemIDSet?.has(item.id)}
+ onToggleSelection={onToggleItemSelection}
+ onLongPressSelect={onStartSelection}
+ />
+ );
+ })}
</Stack>
) : (
- <Box sx={{ maxWidth: 760 }}>{emptyState}</Box>
+ <Box sx={{ maxWidth: contentMaxWidth, mx: "auto" }}>{emptyState}</Box>
);
const SelectionActionBar: React.FC<{