Add a second photo gallery with a reversed image order

Modify the PhotoGalleryWidget to accept a `reverseOrder` prop, and add a second instance of the widget to the home page with this prop enabled.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b84dab4e-11bc-44f5-a773-3e57620ac431
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/0ZGabQy
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic
2026-02-28 22:11:20 +00:00
parent 65205f55cd
commit b49b7512e4
3 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -166,10 +166,11 @@ function SingleImageCarousel({
);
}
export function PhotoGalleryWidget() {
const { data: images, isLoading } = useQuery<GalleryImage[]>({
export function PhotoGalleryWidget({ reverseOrder = false }: { reverseOrder?: boolean } = {}) {
const { data: rawImages, isLoading } = useQuery<GalleryImage[]>({
queryKey: ["/api/gallery"],
});
const images = reverseOrder && rawImages ? [...rawImages].reverse() : rawImages;
const [lightboxIndex, setLightboxIndex] = useState<number | null>(null);