diff --git a/src/app/styles.css b/src/app/styles.css index e722b5f..c554bd3 100644 --- a/src/app/styles.css +++ b/src/app/styles.css @@ -32,15 +32,10 @@ a { .bottom-nav { display: none; } -.breadcrumbs { - display: flex; - gap: 0.5rem; +[data-depth] { margin-bottom: 1rem; } -.breadcrumbs-entry { - display: contents; -} -.breadcrumbs a { +[data-depth] a { color: var(--ft-color-accent); } .auth-page { @@ -75,8 +70,7 @@ a { color: var(--ft-color-accent); font-weight: 600; } - .breadcrumbs[data-depth="3"] .breadcrumbs-item-0, - .breadcrumbs[data-depth="3"] .breadcrumbs-separator-1 { + [data-depth="3"] > :nth-child(-n + 2) { display: none; } .mantine-AppShell-main { diff --git a/src/app/ui/AppBreadcrumbs.test.tsx b/src/app/ui/AppBreadcrumbs.test.tsx index e0caede..5628e70 100644 --- a/src/app/ui/AppBreadcrumbs.test.tsx +++ b/src/app/ui/AppBreadcrumbs.test.tsx @@ -1,3 +1,4 @@ +import { MantineProvider } from "@mantine/core"; import { cleanup, render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router"; import { afterEach, describe, expect, it, vi } from "vitest"; @@ -15,9 +16,11 @@ function renderBreadcrumbs( ) { useBrokerageAccounts.mockReturnValue({ data: accounts }); return render( - - - , + + + + + , ); } @@ -67,6 +70,9 @@ describe("AppBreadcrumbs", () => { "page", ); expect(screen.getByRole("navigation")).toHaveAttribute("data-depth", "3"); + for (const separator of screen.getAllByText("→")) { + expect(separator).toHaveAttribute("aria-hidden", "true"); + } }); it("uses the account fallback without exposing the identifier", () => { diff --git a/src/app/ui/AppBreadcrumbs.tsx b/src/app/ui/AppBreadcrumbs.tsx index 8c0f076..65ee04e 100644 --- a/src/app/ui/AppBreadcrumbs.tsx +++ b/src/app/ui/AppBreadcrumbs.tsx @@ -1,3 +1,4 @@ +import { Breadcrumbs } from "@mantine/core"; import type { FC } from "react"; import { useTranslation } from "react-i18next"; import { Link, useMatch } from "react-router"; @@ -20,31 +21,24 @@ const BreadcrumbTrail: FC = (props) => { const { t } = useTranslation(); return ( - + ), + )} + ); };