Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
fix: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Mar 7, 2022
1 parent 60b1844 commit c5db38f
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"type-check:watch": "npm run type-check -- --watch"
},
"dependencies": {
"@dataesr/react-dsfr": "^1.0.4",
"@dataesr/react-dsfr": "^1.0.5",
"@gouvfr/dsfr": "^1.3.1",
"@sentry/nextjs": "^6.17.9",
"@socialgouv/matomo-next": "^1.2.2",
Expand Down
3 changes: 2 additions & 1 deletion public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://template.fabrique.social.gouv.fr</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2022-03-04T18:00:28.304Z</lastmod></url>
<url><loc>https://template.fabrique.social.gouv.fr</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2022-03-07T11:06:49.613Z</lastmod></url>
<url><loc>https://template.fabrique.social.gouv.fr/healthz</loc><changefreq>daily</changefreq><priority>0.7</priority><lastmod>2022-03-07T11:06:49.613Z</lastmod></url>
</urlset>
1 change: 0 additions & 1 deletion src/components/footer/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Logo,
FooterBodyItem,
Link,
//@ts-ignore
FooterOperator,
} from "@dataesr/react-dsfr";
import { FooterBodySectionProps } from "./type";
Expand Down
8 changes: 1 addition & 7 deletions src/components/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import {
HeaderNav,
//@ts-ignore
NavItem,
//@ts-ignore
NavSubItem,
Header,
//@ts-ignore
ToolItem,
Logo,
HeaderBody,
//@ts-ignore
Service,
HeaderOperator,
//@ts-ignore
ToolItemGroup,
//@ts-ignore
Tool,
} from "@dataesr/react-dsfr";
import { MegaNav } from "./megaNav";
Expand Down Expand Up @@ -55,7 +49,7 @@ const Index = (props: HeaderProps): JSX.Element => (
</HeaderBody>
<HeaderNav>
{props.navItems.map((item, index) => {
if ("headingLevel" in item) {
if ("linkName" in item) {
return <MegaNav key={`${index}-${item.title}`} {...item} />;
} else if ("items" in item) {
return (
Expand Down
10 changes: 1 addition & 9 deletions src/components/header/megaNav.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import {
//@ts-ignore
MegaNavItem,
//@ts-ignore
MegaNavSubItem,
Link,
} from "@dataesr/react-dsfr";
import { MegaNavItem, MegaNavSubItem, Link } from "@dataesr/react-dsfr";
import { MegaNavProps } from "./type";

export const MegaNav = (props: MegaNavProps): JSX.Element => (
<MegaNavItem
title={props.title}
description={props.description}
as={props.headingLevel}
closeButtonLabel={props.closeButtonLabel}
linkLabel={props.linkName}
link={props.linkHref}
Expand All @@ -21,7 +14,6 @@ export const MegaNav = (props: MegaNavProps): JSX.Element => (
key={`${index}-${item.title}`}
title={item.title}
link={item.href}
current={item.current}
>
{item.links.map((link, index) => (
<Link
Expand Down
6 changes: 1 addition & 5 deletions src/components/header/switch.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
SwitchTheme,
//@ts-ignore
ToolItem,
} from "@dataesr/react-dsfr";
import { SwitchTheme, ToolItem } from "@dataesr/react-dsfr";
import { useState } from "react";
import { SwitchProps } from "./type";

Expand Down
1 change: 0 additions & 1 deletion src/components/header/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type RegularNavProps = {
export type MegaNavProps = {
title: string;
description: string;
headingLevel: string;
linkHref: string;
linkName: string;
closeButtonLabel: string;
Expand Down
1 change: 0 additions & 1 deletion src/config/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const headerProps: HeaderProps = {
{
title: "Titre 3",
description: "Navigation",
headingLevel: "h5",
linkHref: "/",
linkName: "Link",
closeButtonLabel: "Fermer",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1174,10 +1174,10 @@
debug "^3.1.0"
lodash.once "^4.1.1"

"@dataesr/react-dsfr@^1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@dataesr/react-dsfr/-/react-dsfr-1.0.4.tgz#ad6f806a4ff613abd3748ded8bf3571721136373"
integrity sha512-I6G3JM1KPy+4KL4qOp0mfjS/kKtpKX11zZbF3JQACOvRc+f2z3mDbA5tPFSr/XNb6xG2ofk4+N2qmbNhCNWSqQ==
"@dataesr/react-dsfr@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@dataesr/react-dsfr/-/react-dsfr-1.0.5.tgz#3d78aef1e253ce306c5e1073e8fda9d8eeda7b8e"
integrity sha512-Yna7mcO+vu46OW/q4QNkZOz9bDSJDBfwCBn/2fU9Mm8accHzpmFZwq4QiOql8+sV7cin/+CBC4HWzm26P287CQ==
dependencies:
"@babel/runtime" "^7.16.3"
"@gouvfr/dsfr" "1.3.1"
Expand Down

0 comments on commit c5db38f

Please sign in to comment.