File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 1
- import { useTranslation } from "next-i18next "
1
+ import React from "react "
2
2
import { Box } from "@chakra-ui/react"
3
3
4
- import { MAIN_CONTENT_ID } from "@/lib/constants "
4
+ import { BaseLink } from "../components/Link "
5
5
6
- import { Button } from "./Buttons "
6
+ import Translation from "./Translation "
7
7
8
- export const SkipLink = ( ) => {
9
- const { t } = useTranslation ( "common" )
8
+ export interface IProps {
9
+ hrefId : string
10
+ }
10
11
11
- const handleNavigate = ( ) => {
12
- document ?. getElementById ( MAIN_CONTENT_ID ) ?. focus ( )
13
- }
12
+ export const SkipLink : React . FC < IProps > = ( { hrefId } ) => {
14
13
return (
15
14
< Box bg = "primary.base" >
16
- < Button
17
- h = "8"
18
- onClick = { handleNavigate }
15
+ < BaseLink
16
+ href = { hrefId }
19
17
lineHeight = "taller"
20
18
position = "absolute"
21
19
top = "-12"
@@ -25,8 +23,8 @@ export const SkipLink = () => {
25
23
_hover = { { textDecoration : "none" } }
26
24
_focus = { { position : "static" } }
27
25
>
28
- { t ( "skip-to-main-content" ) }
29
- </ Button >
26
+ < Translation id = "skip-to-main-content" />
27
+ </ BaseLink >
30
28
</ Box >
31
29
)
32
30
}
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { Root } from "@/lib/interfaces"
9
9
import FeedbackWidget from "@/components/FeedbackWidget"
10
10
import Footer from "@/components/Footer"
11
11
import Nav from "@/components/Nav"
12
- import { SkipLink } from "@/components/SkipLink"
13
12
import TranslationBanner from "@/components/TranslationBanner"
14
13
import TranslationBannerLegal from "@/components/TranslationBannerLegal"
15
14
@@ -46,8 +45,6 @@ export const RootLayout = ({
46
45
47
46
return (
48
47
< Container mx = "auto" maxW = { oldTheme . variables . maxPageWidth } >
49
- < SkipLink />
50
-
51
48
< Nav path = { asPath } />
52
49
53
50
< TranslationBanner
Original file line number Diff line number Diff line change 89
89
" ./src/components/SideNavMobile.tsx" ,
90
90
" ./src/components/SimpleTable.tsx" ,
91
91
" ./src/components/Simulator" ,
92
+ " ./src/components/SkipLink.tsx" ,
92
93
" ./src/components/Slider/Slider.stories.tsx" ,
93
94
" ./src/components/Slider/index.tsx" ,
94
95
" ./src/components/StablecoinAccordion/AccordionCustomItem.tsx" ,
You can’t perform that action at this time.
0 commit comments