web: a photo can sit in every landing section at once
The picker was one dropdown, so a photo lived in exactly one place. The three destinations are now independent checkboxes on the card, and the column holds the set as a comma list — the landing page draws a photo in every section it was ticked into, each still picking one of its own at random per visit. Ticking nothing is what `off` used to be: the row is kept and the landing page stops drawing it, which is what the old "not on the landing page" option did.
This commit is contained in:
@@ -173,7 +173,7 @@ export function Landing() {
|
||||
// The labels the uploader's studio stored — the tagline, the title and
|
||||
// the ISO/grain line. A contribution from before those existed keeps the
|
||||
// plain community defaults.
|
||||
...photos.filter((p) => p.slot === 'strip' && p.consent !== false).map((p) => ({
|
||||
...photos.filter((p) => p.slots.includes('strip') && p.consent !== false).map((p) => ({
|
||||
tag: p.tag ?? '#COMMUNITY',
|
||||
title: { en: p.title ?? 'Community Frame', vi: p.title ?? 'Khung cộng đồng' },
|
||||
meta: p.meta ?? `#${p.id}`,
|
||||
@@ -184,12 +184,13 @@ export function Landing() {
|
||||
[photos],
|
||||
);
|
||||
|
||||
// The three live slots. One random photo out of each set, drawn once per page
|
||||
// load so the preview does not change under the visitor's eyes on every
|
||||
// render; the built-in sample stands in while a slot has no curation.
|
||||
// The three live sections. One random photo out of each set, drawn once per
|
||||
// page load so the preview does not change under the visitor's eyes on every
|
||||
// render; the built-in sample stands in while a section has no curation. A
|
||||
// photo the curator put in several sections can turn up in each of them.
|
||||
const slotPhoto = useMemo(() => {
|
||||
const pick = (slot: PhotoSlot, fallback: string) => {
|
||||
const list = photos.filter((p) => p.slot === slot);
|
||||
const list = photos.filter((p) => p.slots.includes(slot));
|
||||
return list.length ? api.photoUrl(list[Math.floor(Math.random() * list.length)].id) : fallback;
|
||||
};
|
||||
return { tester: pick('tester', SAMPLE(1043)), creator: pick('creator', SAMPLE(1015)), qr: pick('qr', SAMPLE(1069)) };
|
||||
|
||||
Reference in New Issue
Block a user