Add dashboard action colors and admin help translations
This commit is contained in:
@@ -22,7 +22,7 @@ import { useEventContext } from '../context/EventContext';
|
||||
import { getEventStats, EventStats, TenantEvent, getEventPhotos, TenantPhoto, updateEvent } from '../api';
|
||||
import { formatEventDate } from '../lib/events';
|
||||
import { useAuth } from '../auth/context';
|
||||
import { useAdminTheme } from './theme';
|
||||
import { ADMIN_ACTION_COLORS, useAdminTheme } from './theme';
|
||||
import { buildLimitWarnings } from '../lib/limitWarnings';
|
||||
import { withAlpha } from './components/colors';
|
||||
import { useEventReadiness } from './hooks/useEventReadiness';
|
||||
@@ -606,15 +606,15 @@ function UnifiedToolGrid({ event, navigate, permissions, isMember, isCompleted }
|
||||
|
||||
const operationsItems = [
|
||||
!isCompleted ? { label: t('management:invites.badge', 'QR Codes'), icon: QrCode, path: `/mobile/events/${slug}/qr`, color: '#10B981' } : null,
|
||||
{ label: t('management:events.quick.guests', 'Guests'), icon: Users, path: `/mobile/events/${slug}/members`, color: theme.text },
|
||||
!isCompleted ? { label: t('management:events.quick.guestMessages', 'Messages'), icon: Megaphone, path: `/mobile/events/${slug}/guest-notifications`, color: theme.text } : null,
|
||||
!isCompleted ? { label: t('events.branding.titleShort', 'Branding'), icon: Layout, path: `/mobile/events/${slug}/branding`, color: theme.text } : null,
|
||||
{ label: t('management:events.quick.guests', 'Guests'), icon: Users, path: `/mobile/events/${slug}/members`, color: ADMIN_ACTION_COLORS.guests },
|
||||
!isCompleted ? { label: t('management:events.quick.guestMessages', 'Messages'), icon: Megaphone, path: `/mobile/events/${slug}/guest-notifications`, color: ADMIN_ACTION_COLORS.guestMessages } : null,
|
||||
!isCompleted ? { label: t('events.branding.titleShort', 'Branding'), icon: Layout, path: `/mobile/events/${slug}/branding`, color: ADMIN_ACTION_COLORS.branding } : null,
|
||||
].filter((item): item is { label: string; icon: any; path: string; color?: string } => Boolean(item));
|
||||
|
||||
const adminItems = [
|
||||
{ label: t('management:mobileDashboard.shortcutAnalytics', 'Analytics'), icon: TrendingUp, path: `/mobile/events/${slug}/analytics` },
|
||||
!isCompleted ? { label: t('events.recap.exportTitleShort', 'Exports'), icon: Download, path: `/mobile/exports` } : null,
|
||||
{ label: t('management:mobileProfile.settings', 'Settings'), icon: Settings, path: `/mobile/events/${slug}/edit` },
|
||||
{ label: t('management:mobileDashboard.shortcutAnalytics', 'Analytics'), icon: TrendingUp, path: `/mobile/events/${slug}/analytics`, color: ADMIN_ACTION_COLORS.analytics },
|
||||
!isCompleted ? { label: t('events.recap.exportTitleShort', 'Exports'), icon: Download, path: `/mobile/exports`, color: ADMIN_ACTION_COLORS.recap } : null,
|
||||
{ label: t('management:mobileProfile.settings', 'Settings'), icon: Settings, path: `/mobile/events/${slug}/edit`, color: ADMIN_ACTION_COLORS.settings },
|
||||
].filter((item): item is { label: string; icon: any; path: string; color?: string } => Boolean(item));
|
||||
|
||||
const sections = [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { HelpCircle } from 'lucide-react';
|
||||
import { XStack } from '@tamagui/stacks';
|
||||
import { SizableText as Text } from '@tamagui/text';
|
||||
import { Pressable } from '@tamagui/react-native-web-lite';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { adminPath } from '../../constants';
|
||||
import { useAdminTheme } from '../theme';
|
||||
@@ -13,14 +14,16 @@ type ContextHelpLinkProps = {
|
||||
label?: string;
|
||||
};
|
||||
|
||||
export function ContextHelpLink({ slug, label = 'Help' }: ContextHelpLinkProps) {
|
||||
export function ContextHelpLink({ slug, label }: ContextHelpLinkProps) {
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation('common');
|
||||
const { border, primary, surfaceMuted, textStrong } = useAdminTheme();
|
||||
const resolvedLabel = label ?? t('common.help', 'Help');
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
onPress={() => navigate(adminPath(`/mobile/help/${encodeURIComponent(slug)}`))}
|
||||
aria-label={label}
|
||||
aria-label={resolvedLabel}
|
||||
>
|
||||
<XStack
|
||||
alignItems="center"
|
||||
@@ -34,7 +37,7 @@ export function ContextHelpLink({ slug, label = 'Help' }: ContextHelpLinkProps)
|
||||
>
|
||||
<HelpCircle size={14} color={primary} />
|
||||
<Text fontSize="$xs" fontWeight="700" color={textStrong}>
|
||||
{label}
|
||||
{resolvedLabel}
|
||||
</Text>
|
||||
</XStack>
|
||||
</Pressable>
|
||||
|
||||
Reference in New Issue
Block a user