Skip to content

Commit

Permalink
feat: [WD-15078] Add skip to content button (#965)
Browse files Browse the repository at this point in the history
## Done

- Added Skip to content button using the React Components Skip link
component.

Fixes [list issues/bugs if needed]

## QA

1. Run the LXD-UI:
- On the demo server via the link posted by @webteam-app below. This is
only available for PRs created by collaborators of the repo. Ask
@mas-who or @edlerd for access.
- With a local copy of this branch, [build and run as described in the
docs](../CONTRIBUTING.md#setting-up-for-development).
2. Perform the following QA steps:
    -  Start LXD UI, and press tab to reveal the skip link button.

## Screenshots

N/A
  • Loading branch information
Kxiru authored Oct 22, 2024
2 parents 61a25fe + 4a4f979 commit 31726be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { FC } from "react";
import Navigation from "components/Navigation";
import { Application, QueuedNotification } from "@canonical/react-components";
import {
Application,
QueuedNotification,
SkipLink,
} from "@canonical/react-components";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { AuthProvider } from "context/auth";
import { EventQueueProvider } from "context/eventQueue";
Expand Down Expand Up @@ -33,6 +37,7 @@ const Root: FC = () => {
<OperationsProvider>
<EventQueueProvider>
<Application id="l-application">
<SkipLink mainId="main-content" />
<Navigation />
<ErrorBoundary fallback={ErrorPage}>
<App />
Expand Down
2 changes: 1 addition & 1 deletion src/components/BaseLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const BaseLayout: FC<Props> = ({
contentClassName,
}: Props) => {
return (
<AppMain className={mainClassName}>
<AppMain className={mainClassName} id="main-content">
<Panel
title={title}
controls={controls}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CustomLayout: FC<Props> = ({
contentClassName,
}: Props) => {
return (
<AppMain className={mainClassName}>
<AppMain className={mainClassName} id="main-content">
<Panel contentClassName={contentClassName} header={header}>
{children}
</Panel>
Expand Down

0 comments on commit 31726be

Please sign in to comment.