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

@@ -24,7 +24,7 @@ export default function AppShell({ children }: AppShellProps) {
const [compassOpen, setCompassOpen] = React.useState(false);
const [notificationsOpen, setNotificationsOpen] = React.useState(false);
const [settingsOpen, setSettingsOpen] = React.useState(false);
const { tasksEnabled, event, token } = useEventData();
const { tasksEnabled, hasActiveTasks, event, token } = useEventData();
const notificationCenter = useOptionalNotificationCenter();
const navigate = useNavigate();
const location = useLocation();
@@ -73,7 +73,8 @@ export default function AppShell({ children }: AppShellProps) {
key: 'tasks',
label: t('navigation.tasks', 'Tasks'),
icon: <Sparkles size={18} color={actionIconColor} />,
onPress: goTo('/tasks'),
onPress: hasActiveTasks ? goTo('/tasks') : undefined,
disabled: !hasActiveTasks,
}
: {
key: 'settings',

View File

@@ -11,6 +11,7 @@ export type CompassAction = {
label: string;
icon?: React.ReactNode;
onPress?: () => void;
disabled?: boolean;
};
type CompassHubProps = {
@@ -128,7 +129,12 @@ export default function CompassHub({
{quadrants.map((action, index) => (
<Button
key={action.key}
disabled={action.disabled}
opacity={action.disabled ? 0.45 : 1}
onPress={() => {
if (action.disabled) {
return;
}
action.onPress?.();
close();
}}