Skip to content

Commit

Permalink
chore(ally): add a quick navigation at the top of the page
Browse files Browse the repository at this point in the history
# Conflicts:
#	components/banner/info-banner.tsx
#	components/header/header-core/index.tsx
  • Loading branch information
johangirod committed Sep 3, 2024
1 parent bd6a72c commit eb104c3
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 19 deletions.
4 changes: 3 additions & 1 deletion app/(header-default)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default async function LayoutWithSearchBar({
<>
<NPSBanner />
<HeaderServer useSearchBar={true} useAgentCTA={true} />
<main className="fr-container">{children}</main>
<main className="fr-container" id="contenu">
{children}
</main>
<SocialNetworks />
<QuestionOrFeedback session={session} />
<Footer />
Expand Down
4 changes: 3 additions & 1 deletion app/(header-home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default async function HomeLayout({
<>
<NPSBanner />
<HeaderServer useSearchBar={false} useAgentCTA={true} />
<main className="fr-container">{children}</main>
<main className="fr-container" id="contenu">
{children}
</main>
<SocialNetworks />
<QuestionOrFeedback session={session} />
<Footer />
Expand Down
4 changes: 3 additions & 1 deletion app/(header-minimal)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default async function HomeLayout({
return (
<>
<HeaderServer useSearchBar={false} useAgentCTA={false} />
<main className="fr-container">{children}</main>
<main className="fr-container" id="contenu">
{children}
</main>
<QuestionOrFeedback session={session} />
</>
);
Expand Down
6 changes: 5 additions & 1 deletion app/(header-search)/rechercher/carte/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ const MapSearchResultPage = async function UniteLegalePage(
searchParams={searchFilterParamsJSON}
currentSearchTerm={searchTerm}
/>
<main style={{ maxWidth: '100%', marginBottom: 0 }} className="map">
<main
id="contenu"
style={{ maxWidth: '100%', marginBottom: 0 }}
className="map"
>
<StructuredDataSearchAction />
<HiddenH1 title="Résultats de recherche" />
<SearchResultsMap
Expand Down
2 changes: 1 addition & 1 deletion app/(header-search)/rechercher/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const SearchResultPage = async function UniteLegalePage(props: AppRouterProps) {
searchParams={searchFilterParamsJSON}
currentSearchTerm={searchTerm}
/>
<main className="fr-container">
<main className="fr-container" id="contenu">
<StructuredDataSearchAction />
<HiddenH1 title="Résultats de recherche" />
<div className="content-container">
Expand Down
6 changes: 4 additions & 2 deletions app/(header-without-search)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Metadata } from 'next';
import { NPSBanner } from '#components/banner/nps';
import Footer from '#components/footer';
import { HeaderServer } from '#components/header/header-server';
import { meta } from '#components/meta/meta-server';
import SocialNetworks from '#components/social-network';
import getSession from '#utils/server-side-helper/app/get-session';
import QuestionOrFeedback from 'app/_component/question-or-feedback';
import { Metadata } from 'next';

export const metadata: Metadata = meta({});

Expand All @@ -19,7 +19,9 @@ export default async function LayoutWithSearchBar({
<>
<NPSBanner />
<HeaderServer useSearchBar={false} useAgentCTA={true} useLogo />
<main className="fr-container">{children}</main>
<main className="fr-container" id="contenu">
{children}
</main>
<SocialNetworks />
<QuestionOrFeedback session={session} />
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function NotFound() {
return (
<>
<HeaderServer useSearchBar={true} useAgentCTA={true} />
<main className="fr-container">
<main className="fr-container" id="contenu">
<ErrorNotFoundExplanations />
</main>
<QuestionOrFeedback session={null} />
Expand Down
4 changes: 1 addition & 3 deletions components-ui/icon/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ type IProps = {
size?: number;
color?: string;
slug: IIconsSlug;
alt: string;
};

export const Icon: React.FC<PropsWithChildren<IProps>> = ({
id,
className = '',
size = 18,
color,
alt,
children,
slug,
}) => {
Expand All @@ -27,6 +25,7 @@ export const Icon: React.FC<PropsWithChildren<IProps>> = ({
return (
<span id={id} className={styles.icon + ' ' + className}>
<span
aria-hidden
style={{
height: size + 'px',
width: size + 'px',
Expand All @@ -37,7 +36,6 @@ export const Icon: React.FC<PropsWithChildren<IProps>> = ({
alignItems: 'center',
justifyContent: 'center',
}}
alt={alt}
>
{icon}
</span>
Expand Down
23 changes: 20 additions & 3 deletions components/header/header-core/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,27 @@ export const HeaderCore: React.FC<IProps> = ({
}) => {
return (
<>
<div id="top" className="fr-skiplinks">
<nav
className="fr-container"
role="navigation"
aria-label="Accès rapide"
>
<ul className="fr-skiplinks__list">
<li>
<a className="fr-link" href="#contenu">
Contenu
</a>
</li>
<li>
<a className="fr-link" href="#footer">
Pied de page
</a>
</li>
</ul>
</nav>
</div>
<LoadBar session={session} />
<aside>
<InfoBanner />
</aside>
<header
role="banner"
className="fr-header"
Expand Down
8 changes: 5 additions & 3 deletions components/header/menu/espace-agent-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ export const EspaceAgentLink = ({ pathFrom }: { pathFrom: string }) => (
onClick={() => logConversionEvent('HEADER_LOGIN')}
aria-label="Accéder à la page de connexion de l'espace agent public"
>
<span className="fr-sr-only">Accéder à l’espace agent public</span>
<Icon slug="accountLine" alt="" aria-hidden>
<span className={styles.menuText}>Espace agent public</span>
<Icon slug="accountLine">
<span className="fr-sr-only">Accéder à l’espace agent public</span>
<span aria-hidden className={styles.menuText}>
Espace agent public
</span>
</Icon>
</a>
);
4 changes: 2 additions & 2 deletions components/header/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Menu: React.FC<{
>
<span className="fr-sr-only">{userText}</span>
<span aria-hidden className={styles.menuText}>
<Icon slug="accountLine" alt="">
<Icon slug="accountLine">
{userText}
&nbsp;(
<strong
Expand Down Expand Up @@ -101,7 +101,7 @@ const Menu: React.FC<{
aria-label="Se déconnecter de l'espace agent public"
href={logoutUrl}
tabIndex={-1}
className="fr-link"
className="fr-link no-style-link"
onMouseDown={logout}
role="menuitem"
>
Expand Down
1 change: 1 addition & 0 deletions components/header/menu/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.menuLogout {
position: relative;
font-size: small;
}
.menuLogout > button {
margin: 0 !important;
Expand Down

0 comments on commit eb104c3

Please sign in to comment.