Skip to content

Commit

Permalink
Add clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
martha committed Jan 17, 2025
1 parent 242a7e6 commit a3ef546
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/components/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ const MainLayout: React.FC<Props> = ({ mobileMenuContext, children }) => {
</Toolbar>
</AppBar>
<CssBaseline />
<Box id={FOCUS_TARGET_ID}>{children}</Box>
<Box
// "Skip to content" button should always have a destination, even when content is loading
id={FOCUS_TARGET_ID}
>
{children}
</Box>
</React.Fragment>
);
};
Expand Down
9 changes: 6 additions & 3 deletions src/modules/admin/components/AdminDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useRootPermissions } from '@/modules/permissions/useHasPermissionsHooks
import { AdminDashboardRoutes } from '@/routes/routes';
import { RootPermissionsFragment } from '@/types/gqlTypes';

const ProjectNavHeader: React.FC = () => {
const AdminNavHeader: React.FC = () => {
return (
<Typography
component='p'
Expand Down Expand Up @@ -129,7 +129,7 @@ const AdminDashboard: React.FC = () => {

return (
<DashboardContentContainer
navHeader={<ProjectNavHeader />}
navHeader={<AdminNavHeader />}
contextHeader={<ContextHeaderContent breadcrumbs={breadcrumbs} />}
sidebar={
<SideNavMenu<RootPermissionsFragment>
Expand All @@ -143,8 +143,11 @@ const AdminDashboard: React.FC = () => {
? formEditorContentSx
: {}
}
navLabel={'Admin'}
// On desktop, 'Admin' appears in the AdminNavHeader, so hide it from the dashboard Close Menu row.
// On mobile, include it. We can remove this special case if we add the AdminNavHeader info back on mobile.
hideLabel={!isMobile}
// (Still provide the navLabel for accessible text)
navLabel={'Admin'}
{...dashboardState}
>
<Container
Expand Down

0 comments on commit a3ef546

Please sign in to comment.