Compare commits

...

2 Commits

Author SHA1 Message Date
Ravi Gulhane 77c77ff9db Photo wall Presenter changes 2026-08-18 15:30:02 +05:30
Ravi Gulhane d110a9065e Photo wall Presenter changes 2026-08-18 14:47:04 +05:30
2 changed files with 33 additions and 11 deletions

View File

@ -1031,10 +1031,15 @@ export type PhotoWallUploadMeta = {
export type PhotoWallPresentData = {
eventId: string;
eventName: string;
event?: PhotoWallPublicEvent | null;
eventHeader?: PhotoWallEventHeaderDisplay | null;
photosPerRow: number;
maxPhotoWidth: number;
maxPhotoHeight: number;
gapPx: number;
presentMarginTopPx?: number;
presentMarginLeftPx?: number;
presentMarginRightPx?: number;
showUploaderNameOnWall?: boolean;
frameEnabled?: boolean;
frameCanvasWidth?: number;

View File

@ -1,6 +1,7 @@
import { useCallback, useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { getPhotoWallPresent, type PhotoWallPresentData } from "../lib/api";
import { PhotoWallEventHeader } from "../components/PhotoWallEventHeader";
const POLL_MS = 4000;
@ -51,6 +52,9 @@ export function PhotoWallPresentPage() {
const maxW = data.maxPhotoWidth || 320;
const maxH = data.maxPhotoHeight || 320;
const gap = data.gapPx ?? 8;
const marginTop = Math.max(0, data.presentMarginTopPx ?? 0);
const marginLeft = Math.max(0, data.presentMarginLeftPx ?? 0);
const marginRight = Math.max(0, data.presentMarginRightPx ?? 0);
const showNames = Boolean(data.showUploaderNameOnWall);
const frameEnabled = Boolean(data.frameEnabled);
const frameW = data.frameCanvasWidth || 1080;
@ -59,12 +63,22 @@ export function PhotoWallPresentPage() {
return (
<div className="eb-gradient-auth min-h-dvh text-white">
<div className="px-4 pb-3 pt-4 text-center card-bg rounded-lg shadow-sm max-w-[720px] mx-auto mb-3">
<p className="text-xs uppercase tracking-[0.2em] text-[var(--theme-card-text-color)]/70 mb-1">Photo Wall</p>
<h1 className="text-lg font-semibold sm:text-xl text-[var(--theme-card-text-color)]">
{data.eventName}
</h1>
</div>
{data.event ? (
<div className="px-4 pb-3 pt-4">
<div className="card-bg mx-auto mb-3 max-w-[400px] rounded-lg p-4 shadow-sm [&:not(:has(header))]:hidden">
<PhotoWallEventHeader
event={data.event}
display={data.eventHeader || null}
eyebrow={data.eventHeader?.showTitle === false ? null : "Photo Wall"}
/>
</div>
</div>
) : (
<div className="card-bg mx-auto mb-3 max-w-[400px] rounded-lg px-4 pb-3 pt-4 text-center shadow-sm">
<p className="text-xs uppercase tracking-[0.2em] text-[var(--theme-card-text-color)]/70">Photo Wall</p>
<h1 className="text-xl font-semibold text-[var(--theme-card-text-color)] sm:text-2xl">{data.eventName}</h1>
</div>
)}
{data.photos.length === 0 ? (
<div className="flex min-h-[60dvh] items-center justify-center px-6 text-center text-white/80">
@ -72,25 +86,28 @@ export function PhotoWallPresentPage() {
</div>
) : (
<div
className="mx-auto w-full max-w-[100vw] px-3 pb-6 "
className="mx-auto w-full max-w-[100vw] pb-6"
style={{
display: "grid",
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
gap: `${gap}px`,
justifyItems: "center",
alignItems: "start",
paddingTop: `${marginTop}px`,
paddingLeft: `${marginLeft}px`,
paddingRight: `${marginRight}px`,
}}
>
{data.photos.map((p) => (
<div
key={p._id}
className="flex w-full flex-col items-center bg-[var(--theme-card-color)]/50 rounded-xl"
className="flex w-full flex-col items-center rounded-xl bg-[var(--theme-card-color)]/50"
style={{ maxWidth: maxW }}
>
<img
src={p.url}
alt={`${p.displayName || 'Photo Wall'}`}
className={`w-full object-cover shadow-lg relative z-1`}
alt={p.displayName || "Photo Wall"}
className="relative z-1 w-full object-cover shadow-lg"
style={{
maxWidth: maxW,
maxHeight: maxH,
@ -100,7 +117,7 @@ export function PhotoWallPresentPage() {
/>
{showNames && p.displayName ? (
<p
className="w-full truncate text-center text-sm font-bold text-[var(--theme-card-text-color)]/90 rounded-md p-2"
className="mt-1 w-full truncate rounded-md p-2 text-center text-sm font-bold text-[var(--theme-card-text-color)]/90"
title={p.displayName}
>
{p.displayName}