guest pwa: hide tasks when inactive and improve empty gallery state
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-08 21:53:47 +01:00
parent 6cc463fc70
commit 83cf863548
6 changed files with 228 additions and 5 deletions

View File

@@ -164,7 +164,7 @@ function normalizeImageUrl(src?: string | null) {
}
export default function HomeScreen() {
const { tasksEnabled, token, event } = useEventData();
const { tasksEnabled, hasActiveTasks, token, event } = useEventData();
const navigate = useNavigate();
const revealStage = useStaggeredReveal({ steps: 5, intervalMs: 140, delayMs: 120 });
const { stats } = usePollStats(token ?? null);
@@ -537,6 +537,7 @@ export default function HomeScreen() {
selectRandomTask(tasks);
setHasSwiped(true);
}, [selectRandomTask, tasks]);
const showTaskHero = tasksEnabled && hasActiveTasks;
return (
<AppShell>
@@ -595,7 +596,7 @@ export default function HomeScreen() {
</YStack>
) : null}
{tasksEnabled ? (
{showTaskHero ? (
<YStack
animation="slow"
animateOnly={['transform', 'opacity']}
@@ -704,7 +705,7 @@ export default function HomeScreen() {
paddingBottom: 6,
}}
>
{(galleryLoading || preview.length === 0 ? [1, 2, 3, 4] : preview).map((tile) => {
{(galleryLoading ? [1, 2, 3, 4] : preview).map((tile) => {
if (typeof tile === 'number') {
return (
<YStack key={tile} flexShrink={0} width={140}>
@@ -736,6 +737,32 @@ export default function HomeScreen() {
);
})}
</XStack>
{!galleryLoading && preview.length === 0 ? (
<YStack
padding="$3"
borderRadius="$bento"
backgroundColor={isDark ? 'rgba(255, 255, 255, 0.03)' : 'rgba(15, 23, 42, 0.03)'}
borderWidth={1}
borderColor={bentoSurface.borderColor}
gap="$2"
alignItems="center"
>
<Text fontSize="$3" fontWeight="$7" textAlign="center">
{t('homeV2.galleryPreview.emptyTitle', 'No photos yet')}
</Text>
<Text fontSize="$2" color="$color" opacity={0.75} textAlign="center">
{t('homeV2.galleryPreview.emptyDescription', 'You should start taking some and fill this gallery with moments.')}
</Text>
<Button
size="$3"
backgroundColor="$primary"
borderRadius="$pill"
onPress={goTo('/upload')}
>
{t('homeV2.galleryPreview.emptyCta', 'Take first photo')}
</Button>
</YStack>
) : null}
</YStack>
<YStack