From 3a2a06f0be7e43eea68abc0b230a31600170dde0 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 13 Mar 2023 11:00:03 +0100 Subject: [PATCH] fix: fix StatTile and move pages to src (#150) --- src/components/StatTile.tsx | 14 ++++++++------ {pages => src/pages}/404.tsx | 0 {pages => src/pages}/_app.tsx | 0 {pages => src/pages}/_document.tsx | 0 {pages => src/pages}/_error.tsx | 0 {pages => src/pages}/accessibilite.tsx | 2 +- {pages => src/pages}/cgu.tsx | 2 +- {pages => src/pages}/dsfr.tsx | 0 {pages => src/pages}/healthz.tsx | 0 {pages => src/pages}/index.tsx | 13 +++++++++++-- {pages => src/pages}/mentions-legales.tsx | 2 +- {pages => src/pages}/mui.tsx | 0 {pages => src/pages}/politique-confidentialite.tsx | 0 {pages => src/pages}/stats.tsx | 4 ++-- 14 files changed, 24 insertions(+), 13 deletions(-) rename {pages => src/pages}/404.tsx (100%) rename {pages => src/pages}/_app.tsx (100%) rename {pages => src/pages}/_document.tsx (100%) rename {pages => src/pages}/_error.tsx (100%) rename {pages => src/pages}/accessibilite.tsx (90%) rename {pages => src/pages}/cgu.tsx (98%) rename {pages => src/pages}/dsfr.tsx (100%) rename {pages => src/pages}/healthz.tsx (100%) rename {pages => src/pages}/index.tsx (86%) rename {pages => src/pages}/mentions-legales.tsx (98%) rename {pages => src/pages}/mui.tsx (100%) rename {pages => src/pages}/politique-confidentialite.tsx (100%) rename {pages => src/pages}/stats.tsx (92%) diff --git a/src/components/StatTile.tsx b/src/components/StatTile.tsx index df1f5924..481372c8 100644 --- a/src/components/StatTile.tsx +++ b/src/components/StatTile.tsx @@ -1,3 +1,5 @@ +import { fr } from "@codegouvfr/react-dsfr"; + export type StatTileProps = { title: string; stats: string | number; @@ -6,13 +8,13 @@ export type StatTileProps = { export const StatTile = (props: StatTileProps): JSX.Element => { return ( -
-
-
- {props.stats} -

{props.title}

+
+
+
+ {props.stats} +

{props.title}

{props.description && ( -
+

{props.description}

)} diff --git a/pages/404.tsx b/src/pages/404.tsx similarity index 100% rename from pages/404.tsx rename to src/pages/404.tsx diff --git a/pages/_app.tsx b/src/pages/_app.tsx similarity index 100% rename from pages/_app.tsx rename to src/pages/_app.tsx diff --git a/pages/_document.tsx b/src/pages/_document.tsx similarity index 100% rename from pages/_document.tsx rename to src/pages/_document.tsx diff --git a/pages/_error.tsx b/src/pages/_error.tsx similarity index 100% rename from pages/_error.tsx rename to src/pages/_error.tsx diff --git a/pages/accessibilite.tsx b/src/pages/accessibilite.tsx similarity index 90% rename from pages/accessibilite.tsx rename to src/pages/accessibilite.tsx index 21c544f1..89f492ba 100644 --- a/pages/accessibilite.tsx +++ b/src/pages/accessibilite.tsx @@ -4,7 +4,7 @@ import Head from "next/head"; import { Alert } from "@codegouvfr/react-dsfr/Alert"; -import { DeclarationAccessibilite } from "../src/components/DeclarationAccessibilite"; +import { DeclarationAccessibilite } from "../components/DeclarationAccessibilite"; const Accessibilite: NextPage = () => { return ( diff --git a/pages/cgu.tsx b/src/pages/cgu.tsx similarity index 98% rename from pages/cgu.tsx rename to src/pages/cgu.tsx index 21d5b7ea..f1c60374 100644 --- a/pages/cgu.tsx +++ b/src/pages/cgu.tsx @@ -4,7 +4,7 @@ import Head from "next/head"; import { Alert } from "@codegouvfr/react-dsfr/Alert"; -import { MentionPart } from "../src/components/MentionPart"; +import { MentionPart } from "../components/MentionPart"; const Cgu: NextPage = () => { return ( diff --git a/pages/dsfr.tsx b/src/pages/dsfr.tsx similarity index 100% rename from pages/dsfr.tsx rename to src/pages/dsfr.tsx diff --git a/pages/healthz.tsx b/src/pages/healthz.tsx similarity index 100% rename from pages/healthz.tsx rename to src/pages/healthz.tsx diff --git a/pages/index.tsx b/src/pages/index.tsx similarity index 86% rename from pages/index.tsx rename to src/pages/index.tsx index d8e23e98..3c8df563 100644 --- a/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import Head from "next/head"; import { NextPage } from "next"; - +import { push as matomoPush } from "@socialgouv/matomo-next"; import { Alert } from "@codegouvfr/react-dsfr/Alert"; import { Button } from "@codegouvfr/react-dsfr/Button"; import Stack from "@mui/material/Stack"; @@ -52,9 +52,18 @@ const Home: NextPage = () => {
- + + ); diff --git a/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx similarity index 98% rename from pages/mentions-legales.tsx rename to src/pages/mentions-legales.tsx index a45bd01b..ffd9029c 100644 --- a/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -4,7 +4,7 @@ import Head from "next/head"; import { Alert } from "@codegouvfr/react-dsfr/Alert"; -import { MentionPart } from "../src/components/MentionPart"; +import { MentionPart } from "../components/MentionPart"; const MentionsLegales: NextPage = () => { return ( diff --git a/pages/mui.tsx b/src/pages/mui.tsx similarity index 100% rename from pages/mui.tsx rename to src/pages/mui.tsx diff --git a/pages/politique-confidentialite.tsx b/src/pages/politique-confidentialite.tsx similarity index 100% rename from pages/politique-confidentialite.tsx rename to src/pages/politique-confidentialite.tsx diff --git a/pages/stats.tsx b/src/pages/stats.tsx similarity index 92% rename from pages/stats.tsx rename to src/pages/stats.tsx index 110804a8..fec97c31 100644 --- a/pages/stats.tsx +++ b/src/pages/stats.tsx @@ -2,9 +2,9 @@ import React, { useEffect } from "react"; import type { NextPage } from "next"; import Head from "next/head"; -import { StatTile } from "../src/components/StatTile"; +import { StatTile } from "../components/StatTile"; -import { fetchMatomoData, MatomoResult } from "../src/lib"; +import { fetchMatomoData, MatomoResult } from "../lib"; const Stats: NextPage = () => { const [matomoData, setMatomoData] = React.useState({