diff --git a/src/components/SelectTileOverlay.tsx b/src/components/SelectTileOverlay.tsx new file mode 100644 index 00000000..d9b54adf --- /dev/null +++ b/src/components/SelectTileOverlay.tsx @@ -0,0 +1,45 @@ +import { clsx } from 'clsx/lite'; +import Checkbox from './primitives/Checkbox'; + +export default function SelectTileOverlay({ + isSelected, + onSelectChange, +}: { + isSelected: boolean + onSelectChange: () => void +}) { + return ( + <> + {/* Admin Select Border */} +
+
+
+ {/* Admin Select Action */} +
+ +
+ + ); +} diff --git a/src/photo/PhotoGrid.tsx b/src/photo/PhotoGrid.tsx index 5e2d3db0..b9a06a62 100644 --- a/src/photo/PhotoGrid.tsx +++ b/src/photo/PhotoGrid.tsx @@ -8,7 +8,7 @@ import { Camera } from '@/camera'; import { FilmSimulation } from '@/simulation'; import { GRID_ASPECT_RATIO, HIGH_DENSITY_GRID } from '@/site/config'; import { useAppState } from '@/state/AppState'; -import Checkbox from '@/components/primitives/Checkbox'; +import SelectTileOverlay from '@/components/SelectTileOverlay'; export default function PhotoGrid({ photos, @@ -106,41 +106,13 @@ export default function PhotoGrid({ }} /> {canSelect && isUserSignedIn && - <> - {/* Admin Select Border */} -
-
-
- {/* Admin Select Action */} -
- setSelectedPhotoIds?.(isSelected - ? selectedPhotoIds.filter(id => id !== photo.id) - : selectedPhotoIds.concat(photo.id), - )} - /> -
- } + setSelectedPhotoIds?.(isSelected + ? selectedPhotoIds.filter(id => id !== photo.id) + : selectedPhotoIds.concat(photo.id), + )} + />}
; }).concat(additionalTile ?? [])} itemKeys={photos.map(photo => photo.id)