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

Commit

Permalink
fix: fix StatTile and move pages to src (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon authored Mar 13, 2023
1 parent 6762ccb commit 3a2a06f
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 13 deletions.
14 changes: 8 additions & 6 deletions src/components/StatTile.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { fr } from "@codegouvfr/react-dsfr";

export type StatTileProps = {
title: string;
stats: string | number;
Expand All @@ -6,13 +8,13 @@ export type StatTileProps = {

export const StatTile = (props: StatTileProps): JSX.Element => {
return (
<div className="fr-col-12 fr-col-md-3">
<div className="fr-card fr-centered fr-card--no-arrow">
<div className="fr-card__body">
<strong className="fr-display-xs">{props.stats}</strong>
<h2 className="fr-card__title fr-mb-4w">{props.title}</h2>
<div className={fr.cx("fr-col-12", "fr-col-md-4")}>
<div className={fr.cx("fr-card", "fr-card--no-arrow")}>
<div className={fr.cx("fr-card__body")}>
<strong className={fr.cx("fr-display--md")}>{props.stats}</strong>
<h2 className={fr.cx("fr-card__title", "fr-mb-4w")}>{props.title}</h2>
{props.description && (
<div className="fr-card__desc">
<div className={fr.cx("fr-card__desc")}>
<p>{props.description}</p>
</div>
)}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/accessibilite.tsx → src/pages/accessibilite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pages/cgu.tsx → src/pages/cgu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 11 additions & 2 deletions pages/index.tsx → src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -52,9 +52,18 @@ const Home: NextPage = () => {
</div>
</div>
<Stack spacing={2} sx={{ mt: 5 }} direction="row">
<Button title="nbla" onClick={onClick1}>
<Button title="Trigger sentry event" onClick={onClick1}>
Trigger sentry error
</Button>

<Button
title="Trigger matomo event"
onClick={() => {
matomoPush(["click", "button", "homepage"]);
}}
>
Trigger matomo event
</Button>
</Stack>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pages/stats.tsx → src/pages/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<MatomoResult>({
Expand Down

0 comments on commit 3a2a06f

Please sign in to comment.