Skip to content

Commit

Permalink
Merge pull request #18966 from newrelic/liz/add-french-nav-component
Browse files Browse the repository at this point in the history
Add french nav component
  • Loading branch information
LizBaker authored Oct 28, 2024
2 parents 31a654a + 7cd8584 commit ef67e18
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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

0 comments on commit ef67e18

Please sign in to comment.