guest pwa: hide tasks when inactive and improve empty gallery state
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user