1- import { useEffect , useRef } from "react" ;
1+ import { MouseEvent , useEffect , useRef } from "react" ;
22import "./ui/SkipLink.scss" ;
3- import { SkipLinkContainerProps } from ' typings/SkipLinkProps' ;
3+ import { SkipLinkContainerProps } from " typings/SkipLinkProps" ;
44
55/**
66 * Inserts a skip link as the first child of the element with ID 'root'.
@@ -17,7 +17,7 @@ export function SkipLink(props: SkipLinkContainerProps) {
1717 }
1818 } , [ skipLinkRef . current ] ) ;
1919
20- function handleClick ( event : React . MouseEvent < HTMLAnchorElement , MouseEvent > ) : void {
20+ function handleClick ( event : MouseEvent < HTMLAnchorElement , MouseEvent > ) : void {
2121 event . preventDefault ( ) ;
2222 let main : HTMLElement ;
2323 const mainByID = document . getElementById ( props . mainContentId ) ;
@@ -40,16 +40,19 @@ export function SkipLink(props: SkipLinkContainerProps) {
4040 main . addEventListener ( "blur" , ( ) => main . removeAttribute ( "tabindex" ) , { once : true } ) ;
4141 }
4242 } else {
43- console . error ( "Could not find a main element on page and no mainContentId specified in widget properties." )
43+ console . error ( "Could not find a main element on page and no mainContentId specified in widget properties." ) ;
4444 }
4545 }
4646
47- return < a
47+ return (
48+ < a
4849 ref = { skipLinkRef }
49- className = { `skip-link ${ props . class } ` }
50- href = { `#${ props . mainContentId } ` }
50+ className = { `skip-link ${ props . class } ` }
51+ href = { `#${ props . mainContentId } ` }
5152 tabIndex = { props . tabIndex }
52- onClick = { handleClick } >
53+ onClick = { handleClick }
54+ >
5355 { props . linkText }
54- </ a > ;
56+ </ a >
57+ ) ;
5558}
0 commit comments