Skip to content

Commit

Permalink
chore: passage de tous les fichiers jsx en tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Oct 10, 2023
1 parent d63fc1a commit d494c5a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 184 deletions.
79 changes: 0 additions & 79 deletions assets/components/Utils/MapWrapper.jsx

This file was deleted.

90 changes: 25 additions & 65 deletions assets/pages/Home.jsx → assets/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Home = () => {

return (
<AppLayout navItems={defaultNavItems} documentTitle="Le service public des cartes et données du territoire">
{params.authentication_failed === 1 && (
{params?.["authentication_failed"] === 1 && (
<Alert
severity="error"
closable={true}
Expand All @@ -30,12 +30,12 @@ const Home = () => {
)}

{/* Section : Présentation */}
<div className={fr.cx("c-section", "c-section--gray")}>
<div className="c-section c-section--gray">
<div className={fr.cx("fr-container--fluid")}>
<div className={fr.cx("fr-container")}>
<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters")}>
<div className={fr.cx("fr-col-12", "fr-col-lg-6", "fr-px-0v", "fr-pl-md-14v")}>
<p className={fr.cx("fr-mt-4w", "fr-mt-md-7w", "fr-display--xxs")}>
<div className={fr.cx("fr-col-12", "fr-col-lg-6", "fr-px-0", "fr-pl-md-14v")}>
<p className={fr.cx("fr-mt-4w", "fr-mt-md-7w") + " fr-display--xxs"}>
Construisons ensemble le futur portail de la connaissance du territoire
</p>

Expand Down Expand Up @@ -79,43 +79,28 @@ const Home = () => {
<div className={fr.cx("fr-container", "fr-mt-8v", "fr-pb-3v", "fr-mt-md-10v", "fr-mb-2v", "fr-mb-md-8v")}>
<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters")}>
<div className={fr.cx("fr-col-12")}>
<h2 className={fr.cx("fr-my-5w", "fr-text--center")}>Ce que vous pouvez faire avec cartes.gouv.fr</h2>
<h2 className={fr.cx("fr-my-5w") + " fr-text--center"}>Ce que vous pouvez faire avec cartes.gouv.fr</h2>
</div>
</div>

<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters", "fr-text--center")}>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/digital/internet.svg`}
className={fr.cx("fin-service-picto", "svg-fin-fc-finger")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters") + " fr-text--center"}>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/digital/internet.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Consommez des services</h3>
<p>Lorem ipsum dolor sit amet,consectetur adipiscing elit.</p>
<Badge small className={fr.cx("fr-badge--pink")}>
<Badge small className={"fr-badge--pink"}>
Prochainement
</Badge>
</div>

<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/environment/human-cooperation.svg`}
className={fr.cx("fin-service-pict", "svg-fin-majorite")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/environment/human-cooperation.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Stocker et partager des géodonnées</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>

<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/digital/data-visualization.svg`}
className={fr.cx("fin-service-picto", "svg-fin-procuration")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/digital/data-visualization.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Effectuer des traitements</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
{/* <p>
Expand All @@ -137,26 +122,16 @@ const Home = () => {
)}
</p> */}
</div>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/map/map.svg`}
className={fr.cx("fin-service-picto", "svg-fin-service-picto")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-md-6", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/map/map.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Lorem ipsum dolor</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>

<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters", "fr-text--center")}>
<div className={fr.cx("fr-col-lg-3", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/digital/data-visualization.svg`}
className={fr.cx("fin-service-picto", "svg-fin-procuration")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-grid-row", "fr-grid-row--gutters") + " fr-text--center"}>
<div className={fr.cx("fr-col-lg-3", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/digital/data-visualization.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Consectetur adipiscing elit</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
{/* <p>
Expand All @@ -179,37 +154,22 @@ const Home = () => {
</p> */}
</div>

<div className={fr.cx("fr-col-lg-3", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/map/map.svg`}
className={fr.cx("fin-service-picto", "svg-fin-service-picto")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/map/map.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Sit amet</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>

<div className={fr.cx("fr-col-lg-3", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/digital/internet.svg`}
className={fr.cx("fin-service-picto", "svg-fin-fc-finger")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/digital/internet.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Dolor sit amet consectetur</h3>
<p>Lorem ipsum dolor sit amet,consectetur adipiscing elit.</p>
<Badge small className={fr.cx("fr-badge--pink")}>
<Badge small className={"fr-badge--pink"}>
Prochainement
</Badge>
</div>
<div className={fr.cx("fr-col-lg-3", "fr-col-12", "fr-text--center")}>
<img
src={`${appRoot}/dsfr/artwork/pictograms/environment/human-cooperation.svg`}
className={fr.cx("fin-service-picto", "svg-fin-majorite")}
alt=""
role="presentation"
/>
<div className={fr.cx("fr-col-lg-3", "fr-col-12") + " fr-text--center"}>
<img src={`${appRoot}/dsfr/artwork/pictograms/environment/human-cooperation.svg`} alt="" role="presentation" />
<h3 className={fr.cx("fr-text--lead")}>Adipiscing elits</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
Expand Down
36 changes: 0 additions & 36 deletions assets/pages/users/Me.jsx

This file was deleted.

39 changes: 39 additions & 0 deletions assets/pages/users/Me.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import AppLayout from "../../components/Layout/AppLayout";
import BtnBackToHome from "../../components/Utils/BtnBackToHome";
import { defaultNavItems } from "../../config/navItems";
import functions from "../../functions";
import useUser from "../../hooks/useUser";

const Me = () => {
const { user } = useUser();

return (
<AppLayout navItems={defaultNavItems} documentTitle="Mon compte">
<h1>Mon compte</h1>

{user && (
<>
<p>
<strong>Prénom</strong> : {user.firstName}
</p>
<p>
<strong>Nom</strong> : {user.lastName}
</p>
<p>
<strong>Email</strong> : {user.email}
</p>
<p>
<strong>{"Date d'inscription"}</strong> : {functions.date.format(user.accountCreationDate)}
</p>
<p>
<strong>Identifiant technique</strong> : {user.id}
</p>
</>
)}

<BtnBackToHome />
</AppLayout>
);
};

export default Me;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import SymfonyRouting from "../modules/Routing";
import React, { Suspense, lazy } from "react";
import { JSX, Suspense, lazy } from "react";

import AppLayout from "../components/Layout/AppLayout";
import LoadingText from "../components/Utils/LoadingText";
import { defaultNavItems } from "../config/navItems";
import useUser from "../hooks/useUser";
import SymfonyRouting from "../modules/Routing";
import Home from "../pages/Home";
import Redirect from "../pages/Redirect";
import PageNotFound from "../pages/error/PageNotFound";
Expand Down Expand Up @@ -45,7 +45,7 @@ function RouterRenderer() {
const { user } = useUser();

// vérification si la route demandée est bien connue/enregistrée
if (!knownRoutes.includes(route.name)) {
if (route.name === false || !knownRoutes.includes(route.name)) {
return <PageNotFound />;
}

Expand All @@ -58,7 +58,7 @@ function RouterRenderer() {
}
}

let content = null;
let content: JSX.Element;

switch (route.name) {
case "home":
Expand Down

0 comments on commit d494c5a

Please sign in to comment.