Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add french nav component #18966

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/components/FrNav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import Navigation from './Navigation';
import { useStaticQuery, graphql } from 'gatsby';

const FrNav = ({ className }) => {
const { nav } = useStaticQuery(frQuery);
return <Navigation nav={nav} className={className} />;
};

const frQuery = graphql`
query {
nav(slug: "/") {
id
title(locale: "fr")
url
filterable
pages {
...MainLayout_navPagesfr
pages {
...MainLayout_navPagesfr
pages {
...MainLayout_navPagesfr
pages {
...MainLayout_navPagesfr
pages {
...MainLayout_navPagesfr
pages {
...MainLayout_navPagesfr
}
}
}
}
}
}
}
}

fragment MainLayout_navPagesfr on NavItem {
title(locale: "fr")
url
icon
label
}
`;

export default FrNav;
2 changes: 2 additions & 0 deletions src/components/RootNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import JpNav from './JpNav';
import EsNav from './EsNav';
import PtNav from './PtNav';
import EnNav from './EnNav';
import FrNav from './FrNav';
import StyleGuideNav from './StyleGuideNav';

const RootNavigation = ({ locale, className, isStyleGuide }) => {
Expand All @@ -13,6 +14,7 @@ const RootNavigation = ({ locale, className, isStyleGuide }) => {
en: <EnNav className={className} />,
es: <EsNav className={className} />,
pt: <PtNav className={className} />,
fr: <FrNav className={className} />,
};
if (isStyleGuide) {
return <StyleGuideNav className={className} />;
Expand Down
Loading