fix(app): Administration home cards laid out as board 29 B
- the grid aligns its cards at the start; Espèces and Accès et habilitations stack in one right-hand column at their own height - when the sheets card is refused, that column spans the grid and lays its cards side by side, so no half of the page stays empty - the card's sheet name links are 44 px tall on the phone, unchanged from sm up - the card item keeps the list row's rhythm (space-y-1), a larger gap only above the working copy action No test changed.
This commit is contained in:
1 parent
1758276087
commit
8bb2486a34
1 file changed
+38
-23
@@ -35,6 +35,20 @@ const SUBHEADING =
|
||||
const LINK =
|
||||
'inline-flex min-h-11 items-center text-sm font-medium text-[var(--color-accent-strong)] underline underline-offset-2'
|
||||
|
||||
/** The sheet's name: a 44 px target on the phone, plain text height from `sm` up. */
|
||||
const SHEET_LINK =
|
||||
'mr-auto min-w-0 font-medium text-[var(--color-ink)] underline-offset-2 hover:underline ' +
|
||||
'max-sm:inline-flex max-sm:min-h-11 max-sm:items-center'
|
||||
|
||||
/**
|
||||
* Board 29 B: the sheets card on the left, the entry cards stacked on the right at
|
||||
* their own height. Alone (the sheets card refused), the column spans the grid and
|
||||
* lays its cards side by side, so no half of the page stays empty.
|
||||
*/
|
||||
const CARDS = 'grid items-start gap-4 md:grid-cols-2'
|
||||
const ENTRY_COLUMN =
|
||||
'grid items-start gap-4 md:only:col-span-2 md:only:grid-cols-2'
|
||||
|
||||
/** « Vos habilitations : … · rôle propriétaire · session renforcée … active. » (board 10). */
|
||||
function permissionsLine(t: Translate, permissions: AdminPermissions): string {
|
||||
const list = permissions.capabilities.map((kind) =>
|
||||
@@ -70,12 +84,9 @@ function SheetItem({ sheet, species, editor }: SheetItemProps) {
|
||||
const t = useT()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
return (
|
||||
<li className="space-y-2 py-3 first:pt-0 last:pb-0">
|
||||
<li className="space-y-1 py-3 first:pt-0 last:pb-0">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Link
|
||||
to={`/app/admin/sheets/${sheet.sheet_id}`}
|
||||
className="mr-auto min-w-0 font-medium text-[var(--color-ink)] underline-offset-2 hover:underline"
|
||||
>
|
||||
<Link to={`/app/admin/sheets/${sheet.sheet_id}`} className={SHEET_LINK}>
|
||||
{localized(sheet.name, locale)}
|
||||
</Link>
|
||||
<SheetBadges sheet={sheet} />
|
||||
@@ -88,11 +99,13 @@ function SheetItem({ sheet, species, editor }: SheetItemProps) {
|
||||
</p>
|
||||
{/* The working copy action (W1): editors only, on the historical sheet. */}
|
||||
{sheet.historical && editor && (
|
||||
<WorkingCopyAction
|
||||
slug={sheet.slug}
|
||||
sourceVersionId={sheet.latest_version?.version_id ?? null}
|
||||
copyActive={sheet.working_copy_active === true}
|
||||
/>
|
||||
<div className="pt-1">
|
||||
<WorkingCopyAction
|
||||
slug={sheet.slug}
|
||||
sourceVersionId={sheet.latest_version?.version_id ?? null}
|
||||
copyActive={sheet.working_copy_active === true}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
@@ -260,22 +273,24 @@ export default function AdminHomeRoute() {
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
<div className={CARDS}>
|
||||
<SheetsCard editor={permissions.editor} />
|
||||
<EntryCard
|
||||
id="admin-species-title"
|
||||
title={t('admin.species.title')}
|
||||
body={t('admin.home.species_body')}
|
||||
to="/app/admin/species"
|
||||
/>
|
||||
{permissions.owner && (
|
||||
<div className={ENTRY_COLUMN}>
|
||||
<EntryCard
|
||||
id="admin-access-title"
|
||||
title={t('admin.access.title')}
|
||||
body={t('admin.home.access_body')}
|
||||
to="/app/admin/access"
|
||||
id="admin-species-title"
|
||||
title={t('admin.species.title')}
|
||||
body={t('admin.home.species_body')}
|
||||
to="/app/admin/species"
|
||||
/>
|
||||
)}
|
||||
{permissions.owner && (
|
||||
<EntryCard
|
||||
id="admin-access-title"
|
||||
title={t('admin.access.title')}
|
||||
body={t('admin.home.access_body')}
|
||||
to="/app/admin/access"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user