Skip to content

Commit 1714616

Browse files
committed
Revert "update and implement SkipLink"
This reverts commit e0e51c8.
1 parent 1265890 commit 1714616

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

src/components/SkipLink.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import { useTranslation } from "next-i18next"
1+
import React from "react"
22
import { Box } from "@chakra-ui/react"
33

4-
import { MAIN_CONTENT_ID } from "@/lib/constants"
4+
import { BaseLink } from "../components/Link"
55

6-
import { Button } from "./Buttons"
6+
import Translation from "./Translation"
77

8-
export const SkipLink = () => {
9-
const { t } = useTranslation("common")
8+
export interface IProps {
9+
hrefId: string
10+
}
1011

11-
const handleNavigate = () => {
12-
document?.getElementById(MAIN_CONTENT_ID)?.focus()
13-
}
12+
export const SkipLink: React.FC<IProps> = ({ hrefId }) => {
1413
return (
1514
<Box bg="primary.base">
16-
<Button
17-
h="8"
18-
onClick={handleNavigate}
15+
<BaseLink
16+
href={hrefId}
1917
lineHeight="taller"
2018
position="absolute"
2119
top="-12"
@@ -25,8 +23,8 @@ export const SkipLink = () => {
2523
_hover={{ textDecoration: "none" }}
2624
_focus={{ position: "static" }}
2725
>
28-
{t("skip-to-main-content")}
29-
</Button>
26+
<Translation id="skip-to-main-content" />
27+
</BaseLink>
3028
</Box>
3129
)
3230
}

src/layouts/RootLayout.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Root } from "@/lib/interfaces"
99
import FeedbackWidget from "@/components/FeedbackWidget"
1010
import Footer from "@/components/Footer"
1111
import Nav from "@/components/Nav"
12-
import { SkipLink } from "@/components/SkipLink"
1312
import TranslationBanner from "@/components/TranslationBanner"
1413
import TranslationBannerLegal from "@/components/TranslationBannerLegal"
1514

@@ -46,8 +45,6 @@ export const RootLayout = ({
4645

4746
return (
4847
<Container mx="auto" maxW={oldTheme.variables.maxPageWidth}>
49-
<SkipLink />
50-
5148
<Nav path={asPath} />
5249

5350
<TranslationBanner

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"./src/components/SideNavMobile.tsx",
9090
"./src/components/SimpleTable.tsx",
9191
"./src/components/Simulator",
92+
"./src/components/SkipLink.tsx",
9293
"./src/components/Slider/Slider.stories.tsx",
9394
"./src/components/Slider/index.tsx",
9495
"./src/components/StablecoinAccordion/AccordionCustomItem.tsx",

0 commit comments

Comments
 (0)