The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
admin: the allowance and the sharing blocks take the settings' own card head
Maurice56536ae80389
diff --git a/client/src/components/Admin/PlaceContribPanel.tsx b/client/src/components/Admin/PlaceContribPanel.tsxindex 4f7ee256e..0fbaa7c9b 100644--- a/client/src/components/Admin/PlaceContribPanel.tsx+++ b/client/src/components/Admin/PlaceContribPanel.tsx@@ -4,7 +4,7 @@ import { useState } from 'react';import { useTranslation } from '../../i18n';import type { TranslationFn } from '../../types';import { getApiErrorMessage } from '../../utils/apiError';-import { StatusPill } from '../Settings/settingsKit';+import { SettingsCard, StatusPill } from '../Settings/settingsKit';import ToggleSwitch from '../Settings/ToggleSwitch';import ConfirmDialog from '../shared/ConfirmDialog';import { fs } from '../shared/DialogShell';@@ -97,38 +97,27 @@ export default function PlaceContribPanel() {setConfirm(null);contrib.withdraw().then((r) => {const total = Object.values(r.withdrawn).reduce((a, b) => a + b, 0);- toast.success(t('admin.contribute.withdrawn', { count: total }));+ toast.success(t('admin.contribute.withdrawn', { total }));}, fail);};return (- <section- className="flex flex-col gap-3 rounded-[14px] border border-edge-faint bg-surface-secondary p-3"- aria-labelledby="place-contrib-title"- >- <div className="flex items-start gap-3">- <span className="grid h-9 w-9 flex-none place-items-center rounded-[10px] bg-surface-card text-content shadow-sm">- <HeartHandshake size={18} aria-hidden="true" />- </span>- <div className="min-w-0 flex-1">- <div className="flex flex-wrap items-center gap-2">- <h3 id="place-contrib-title" className="m-0 font-semibold text-content" style={fs(13.5, 'body')}>- {t('admin.contribute.title')}- </h3>- <StatusPill tone={PILL_TONE[status]}>{t(`admin.contribute.status.${status}`)}</StatusPill>- </div>- <p className="m-0 mt-0.5 leading-normal text-content-muted" style={fs(12, 'body')}>- {contribNote(t, state)}- </p>- </div>+ <SettingsCard+ flush+ icon={HeartHandshake}+ title={t('admin.contribute.title')}+ badge={<StatusPill tone={PILL_TONE[status]}>{t(`admin.contribute.status.${status}`)}</StatusPill>}+ hint={contribNote(t, state)}+ action={<ToggleSwitchon={agreed && state.consent.enabled}label={t('admin.contribute.title')}disabled={!state.eligible || contrib.busy}onToggle={() => (agreed && state.consent.enabled ? setConfirm('off') : setPrompting(true))}/>- </div>-+ }+ bodyClassName="flex flex-col gap-3 p-4"+ >{agreed && state.consent.enabled && (<><Figures state={state} t={t} />@@ -206,6 +195,6 @@ export default function PlaceContribPanel() {confirmLabel={t('admin.contribute.withdraw')}danger/>- </section>+ </SettingsCard>);}diff --git a/client/src/components/Admin/ServiceIdentityPanel.tsx b/client/src/components/Admin/ServiceIdentityPanel.tsxindex aa58649b3..5078c2e95 100644--- a/client/src/components/Admin/ServiceIdentityPanel.tsx+++ b/client/src/components/Admin/ServiceIdentityPanel.tsx@@ -1,11 +1,12 @@import type { ServiceAllowance, ServiceIdentityState, ServiceIdentityStatus, ServiceQuotaView } from '@trek/shared';-import { MapPin, RefreshCw, Route, Search, type LucideIcon } from 'lucide-react';+import { MapPin, RefreshCw, Route, Search, Signal, type LucideIcon } from 'lucide-react';import { useRef, useState } from 'react';import { useTranslation } from '../../i18n';import { useSettingsStore } from '../../store/settingsStore';import type { TranslationFn } from '../../types';import { getApiErrorMessage } from '../../utils/apiError';import { formatClockTime } from '../../utils/formatters';+import { SettingsCard } from '../Settings/settingsKit';import ConfirmDialog from '../shared/ConfirmDialog';import { useToast } from '../shared/Toast';import { FigureBadge } from '../Tours/paddle/FigureBadge';@@ -121,7 +122,7 @@ function stateHint(t: TranslationFn, status: ServiceIdentityStatus | null, faileexport default function ServiceIdentityPanel({ managed = false }: { managed?: boolean }) {const { t } = useTranslation();const toast = useToast();- const panel = useRef<HTMLElement>(null);+ const panel = useRef<HTMLDivElement>(null);const { status, failed, regenerating, regenerate } = useServiceIdentity(panel);const [confirming, setConfirming] = useState(false);const resetAt = useResetTime(status);@@ -140,31 +141,34 @@ export default function ServiceIdentityPanel({ managed = false }: { managed?: boconst canRegenerate = !managed && status !== null && status.keySource !== 'env' && status.state !== 'off';return (- <section- ref={panel}- aria-label={t('admin.trekApi.quota.title')}- className="flex flex-col overflow-hidden rounded-xl border border-edge-faint bg-surface-secondary"- >- {/* Head band: where the installation stands, apart from the figures below it. */}- <div className="flex flex-wrap items-center justify-between gap-2 border-b border-edge-faint bg-surface-card px-3 py-2.5">- <p className="m-0 inline-flex h-[26px] items-center gap-2 rounded-full bg-surface-card px-2.5 text-caption font-semibold text-content shadow-sm">- <span aria-hidden="true" className={`h-2 w-2 flex-none rounded-full ${STATE_DOT[status?.state ?? 'off']}`} />- {status ? t(`admin.trekApi.quota.state.${status.state}`) : t('admin.trekApi.quota.title')}- </p>- <div className="flex flex-wrap items-center gap-1.5">- {status?.tier && <FigureBadge value={t(`admin.trekApi.quota.tier.${status.tier}`)} />}- {status?.keySource === 'env' && (- <FigureBadge- label={t('admin.trekApi.quota.key')}- value="TREK_SERVICES_KEY"- info={t('admin.trekApi.quota.envKey')}+ <div ref={panel}>+ <SettingsCard+ flush+ icon={Signal}+ title={t('admin.trekApi.quota.title')}+ badge={+ <span className="inline-flex items-center gap-1.5 rounded-full bg-surface-card px-2 py-[2px] text-caption font-semibold text-content shadow-sm">+ <span+ aria-hidden="true"+ className={`h-2 w-2 flex-none rounded-full ${STATE_DOT[status?.state ?? 'off']}`}/>- )}- {resetAt && <FigureBadge label={t('admin.trekApi.quota.resets')} value={resetAt} />}- </div>- </div>-- <div className="flex flex-col gap-3 p-3">+ {status ? t(`admin.trekApi.quota.state.${status.state}`) : '…'}+ </span>+ }+ action={+ <>+ {status?.tier && <FigureBadge value={t(`admin.trekApi.quota.tier.${status.tier}`)} />}+ {status?.keySource === 'env' && (+ <FigureBadge+ label={t('admin.trekApi.quota.key')}+ value="TREK_SERVICES_KEY"+ info={t('admin.trekApi.quota.envKey')}+ />+ )}+ {resetAt && <FigureBadge label={t('admin.trekApi.quota.resets')} value={resetAt} />}+ </>+ }+ >{status && status.services.length > 0 && (<ularia-label={t('admin.trekApi.quota.title')}@@ -176,27 +180,27 @@ export default function ServiceIdentityPanel({ managed = false }: { managed?: bo</ul>)}{hint && <p className="m-0 text-caption leading-snug text-content-muted">{hint}</p>}- </div>- {/* Foot band: the one action, kept off the figures. */}- {canRegenerate && (- <div className="flex items-center justify-end border-t border-edge-faint bg-surface-card px-3 py-2">- <button- type="button"- onClick={() => setConfirming(true)}- disabled={regenerating}- className="inline-flex items-center gap-1.5 rounded-lg border border-edge-faint bg-surface-card px-2.5 py-1 text-caption font-medium text-content-secondary shadow-sm hover:bg-surface-hover hover:text-content disabled:opacity-50"- >- <RefreshCw- size={13}- strokeWidth={2}- className={regenerating ? 'motion-safe:animate-spin' : ''}- aria-hidden="true"- />- {t('admin.trekApi.quota.regenerate')}- </button>- </div>- )}+ {/* The one action, on a rule of its own below the figures. */}+ {canRegenerate && (+ <div className="-mx-4 -mb-4 flex items-center justify-end border-t border-edge-faint px-4 py-2.5">+ <button+ type="button"+ onClick={() => setConfirming(true)}+ disabled={regenerating}+ className="inline-flex items-center gap-1.5 rounded-lg border border-edge-faint bg-surface-card px-2.5 py-1 text-caption font-medium text-content-secondary shadow-sm hover:bg-surface-hover hover:text-content disabled:opacity-50"+ >+ <RefreshCw+ size={13}+ strokeWidth={2}+ className={regenerating ? 'motion-safe:animate-spin' : ''}+ aria-hidden="true"+ />+ {t('admin.trekApi.quota.regenerate')}+ </button>+ </div>+ )}+ </SettingsCard><ConfirmDialogisOpen={confirming}@@ -207,6 +211,6 @@ export default function ServiceIdentityPanel({ managed = false }: { managed?: boconfirmLabel={t('admin.trekApi.quota.regenerate')}danger={false}/>- </section>+ </div>);}diff --git a/client/src/components/Settings/settingsKit.tsx b/client/src/components/Settings/settingsKit.tsxindex c05d86513..150d156aa 100644--- a/client/src/components/Settings/settingsKit.tsx+++ b/client/src/components/Settings/settingsKit.tsx@@ -38,7 +38,7 @@ export function SettingsHeader({ icon: Icon, title, subtitle, actions }: {* badge and an action on the right) and its body below. `tone` tints the band:* neutral for ordinary groups, danger for the destructive ones.*/-export function SettingsCard({ icon: Icon, title, hint, badge, action, tone = 'neutral', children, id, bodyClassName }: {+export function SettingsCard({ icon: Icon, title, hint, badge, action, tone = 'neutral', children, id, bodyClassName, flush = false }: {icon?: IconLiketitle: ReactNode/** One line under the title in the band. */@@ -50,10 +50,12 @@ export function SettingsCard({ icon: Icon, title, hint, badge, action, tone = 'nid?: string/** Replaces the body's padded column. */bodyClassName?: string+ /** Inside another card: no gap below, the parent spaces its children. */+ flush?: boolean}) {const tint = tone === 'danger' ? 'color-mix(in srgb, var(--danger) 9%, transparent)' : NEUTRAL_TINTreturn (- <section id={id} className="mb-5 overflow-hidden rounded-2xl border border-edge-faint bg-surface-secondary">+ <section id={id} className={`${flush ? '' : 'mb-5 '}overflow-hidden rounded-2xl border border-edge-faint bg-surface-secondary`}><div className="flex items-center gap-3 border-b border-edge-faint px-4 py-3" style={{ background: tint }}>{Icon && (<span className={`grid h-8 w-8 flex-none place-items-center rounded-[10px] bg-surface-card shadow-sm ${tone === 'danger' ? 'text-danger' : 'text-content-secondary'}`}>diff --git a/client/src/components/Tours/paddle/FigureBadge.tsx b/client/src/components/Tours/paddle/FigureBadge.tsxindex f419c38ce..63fcf1503 100644--- a/client/src/components/Tours/paddle/FigureBadge.tsx+++ b/client/src/components/Tours/paddle/FigureBadge.tsx@@ -35,7 +35,7 @@ export function FigureBadge({style={fs(11)}>{icon}- <span className="truncate">{value}</span>+ <span className="whitespace-nowrap">{value}</span></span></span>);