-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1141 from SocialGouv/feat/us-2096-lien-evitement
feat(US-209): Ajoute lien d'évitement
- Loading branch information
Showing
4 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useRouter } from 'next/router' | ||
import React, { useEffect, useRef } from 'react' | ||
|
||
import styles from 'styles/components/Layouts.module.css' | ||
|
||
export default function LienEvitement() { | ||
const router = useRouter() | ||
const refContainer = useRef<HTMLDivElement>(null) | ||
|
||
useEffect(() => { | ||
if (refContainer.current) { | ||
refContainer.current.focus() | ||
} | ||
}, [router.pathname]) | ||
|
||
return ( | ||
<> | ||
<div ref={refContainer} tabIndex={-1} /> | ||
<div className='h-0 overflow-hidden focus-within:h-auto focus-within:bg-blanc '> | ||
<a | ||
href='#contenu' | ||
title='Aller au contenu' | ||
className='text-primary_darken hover:text-primary' | ||
> | ||
Aller au contenu | ||
</a> | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters