/* * [모바일] 관람객(B2C) 행사 — 참여 행사 목록 + 선택 행사 라이브 공지 피드(전체). * 참여 행사는 로그인 워크스페이스에서 수신(계약 발명 없음). 없으면 데모 라이브 행사로 공개 공지 노출. * 라이브 공지 = 공개 API(cms_backlog_contract.md). */ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native'; import { Banner } from '../../components/Banner'; import { Card } from '../../components/Card'; import { DdayChip } from '../../components/DdayChip'; import { LiveNoticeFeed } from '../../components/LiveNoticeFeed'; import { useAuth } from '../../context/AuthContext'; import { DEFAULT_PUBLIC_EVENT_ID } from '../../lib/config'; import { colors, radius, spacing, type } from '../../theme'; export default function VisitorEventsScreen() { const { t } = useTranslation(); const { workspaces, activeWorkspace } = useAuth(); const [selected, setSelected] = useState( activeWorkspace?.eventId ?? workspaces[0]?.eventId ?? null, ); const selectedWs = workspaces.find((w) => w.eventId === selected) ?? null; const feedEventId = selected ?? DEFAULT_PUBLIC_EVENT_ID; return ( {t('vevents.title')} {workspaces.length === 0 ? ( {t('vevents.empty')} ) : ( <> {/* 참여 행사 선택 칩 */} {workspaces.map((w) => { const on = w.eventId === selected; return ( setSelected(w.eventId)} style={[styles.chip, on && styles.chipOn]} > {w.eventName} ); })} {/* 선택 행사 요약 카드 */} {selectedWs ? ( {selectedWs.eventName} {selectedWs.hallLabel} · {selectedWs.startDate} ~ {selectedWs.endDate} ) : null} )} {/* 라이브 공지(전체) */} ); } const styles = StyleSheet.create({ scroll: { padding: spacing.md, gap: spacing.md, paddingBottom: 40 }, title: { fontSize: type.h2.fontSize, fontWeight: '700', color: colors.neutral900 }, chips: { flexDirection: 'row', flexWrap: 'wrap', gap: 8 }, chip: { paddingHorizontal: 12, paddingVertical: 8, borderRadius: radius.pill, borderWidth: 1, borderColor: colors.neutral200, maxWidth: 240, }, chipOn: { backgroundColor: colors.primary100, borderColor: colors.primary600 }, chipText: { color: colors.neutral700, fontSize: type.caption.fontSize }, chipTextOn: { color: colors.primary700, fontWeight: '700' }, eventTop: { flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'space-between', gap: 8 }, eventName: { flex: 1, fontSize: type.h3.fontSize, fontWeight: '700', color: colors.neutral900 }, eventMeta: { marginTop: 4, fontSize: type.caption.fontSize, color: colors.neutral500 }, });