Photo wall Presenter changes
This commit is contained in:
parent
0b44e15b50
commit
d110a9065e
|
|
@ -1031,10 +1031,15 @@ export type PhotoWallUploadMeta = {
|
||||||
export type PhotoWallPresentData = {
|
export type PhotoWallPresentData = {
|
||||||
eventId: string;
|
eventId: string;
|
||||||
eventName: string;
|
eventName: string;
|
||||||
|
event?: PhotoWallPublicEvent | null;
|
||||||
|
eventHeader?: PhotoWallEventHeaderDisplay | null;
|
||||||
photosPerRow: number;
|
photosPerRow: number;
|
||||||
maxPhotoWidth: number;
|
maxPhotoWidth: number;
|
||||||
maxPhotoHeight: number;
|
maxPhotoHeight: number;
|
||||||
gapPx: number;
|
gapPx: number;
|
||||||
|
presentMarginTopPx?: number;
|
||||||
|
presentMarginLeftPx?: number;
|
||||||
|
presentMarginRightPx?: number;
|
||||||
showUploaderNameOnWall?: boolean;
|
showUploaderNameOnWall?: boolean;
|
||||||
frameEnabled?: boolean;
|
frameEnabled?: boolean;
|
||||||
frameCanvasWidth?: number;
|
frameCanvasWidth?: number;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { getPhotoWallPresent, type PhotoWallPresentData } from "../lib/api";
|
import { getPhotoWallPresent, type PhotoWallPresentData } from "../lib/api";
|
||||||
|
import { PhotoWallEventHeader } from "../components/PhotoWallEventHeader";
|
||||||
|
|
||||||
const POLL_MS = 4000;
|
const POLL_MS = 4000;
|
||||||
|
|
||||||
|
|
@ -51,6 +52,9 @@ export function PhotoWallPresentPage() {
|
||||||
const maxW = data.maxPhotoWidth || 320;
|
const maxW = data.maxPhotoWidth || 320;
|
||||||
const maxH = data.maxPhotoHeight || 320;
|
const maxH = data.maxPhotoHeight || 320;
|
||||||
const gap = data.gapPx ?? 8;
|
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 showNames = Boolean(data.showUploaderNameOnWall);
|
||||||
const frameEnabled = Boolean(data.frameEnabled);
|
const frameEnabled = Boolean(data.frameEnabled);
|
||||||
const frameW = data.frameCanvasWidth || 1080;
|
const frameW = data.frameCanvasWidth || 1080;
|
||||||
|
|
@ -59,10 +63,22 @@ export function PhotoWallPresentPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="eb-gradient-auth min-h-dvh text-white">
|
<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-[400px] mx-auto mb-3">
|
{data.event ? (
|
||||||
<p className="text-xs uppercase tracking-[0.2em] text-[var(--theme-card-text-color)]/70">Photo Wall</p>
|
<div className="px-4 pb-3 pt-4">
|
||||||
<h1 className="text-xl font-semibold sm:text-2xl text-[var(--theme-card-text-color)]">{data.eventName}</h1>
|
<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>
|
||||||
|
) : (
|
||||||
|
<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 ? (
|
{data.photos.length === 0 ? (
|
||||||
<div className="flex min-h-[60dvh] items-center justify-center px-6 text-center text-white/80">
|
<div className="flex min-h-[60dvh] items-center justify-center px-6 text-center text-white/80">
|
||||||
|
|
@ -70,13 +86,16 @@ export function PhotoWallPresentPage() {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<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={{
|
style={{
|
||||||
display: "grid",
|
display: "grid",
|
||||||
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
||||||
gap: `${gap}px`,
|
gap: `${gap}px`,
|
||||||
justifyItems: "center",
|
justifyItems: "center",
|
||||||
alignItems: "start",
|
alignItems: "start",
|
||||||
|
paddingTop: `${marginTop}px`,
|
||||||
|
paddingLeft: `${marginLeft}px`,
|
||||||
|
paddingRight: `${marginRight}px`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{data.photos.map((p) => (
|
{data.photos.map((p) => (
|
||||||
|
|
@ -98,7 +117,7 @@ export function PhotoWallPresentPage() {
|
||||||
/>
|
/>
|
||||||
{showNames && p.displayName ? (
|
{showNames && p.displayName ? (
|
||||||
<p
|
<p
|
||||||
className="mt- w-full truncate text-center text-xs font-medium text-[var(--theme-card-text-color)]/90 bg-[var(--theme-card-color)] rounded-md p-1 sm:text-sm"
|
className="mt- w-full truncate rounded-md bg-[var(--theme-card-color)] p-1 text-center text-xs font-medium text-[var(--theme-card-text-color)]/90 sm:text-sm"
|
||||||
title={p.displayName}
|
title={p.displayName}
|
||||||
>
|
>
|
||||||
{p.displayName}
|
{p.displayName}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue