Skip to content

Commit

Permalink
feat: Fix PropTypes warning & fonts files & renderifsiren/siret hoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ImenOuidou committed Jul 15, 2024
1 parent 9da132d commit 1f1069c
Show file tree
Hide file tree
Showing 59 changed files with 277 additions and 107 deletions.
1 change: 0 additions & 1 deletion src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"react-select": "^5.8.0",
"react-toggle": "^4.1.1",
"react-transition-group": "^4.4.1",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.2.0",
Expand Down
Binary file added src/client/src/assets/fonts/Marianne-Bold.woff
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Light.woff
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Light.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Medium.woff
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Regular.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Thin.woff
Binary file not shown.
Binary file added src/client/src/assets/fonts/Marianne-Thin.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Roboto-Black.ttf
Binary file not shown.
Binary file not shown.
Binary file modified src/client/src/assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Roboto-Italic.ttf
Binary file not shown.
Binary file added src/client/src/assets/fonts/Roboto-Light.ttf
Binary file not shown.
Binary file not shown.
Binary file added src/client/src/assets/fonts/Roboto-Medium.ttf
Binary file not shown.
Binary file not shown.
Binary file modified src/client/src/assets/fonts/Roboto-Regular.ttf
Binary file not shown.
Binary file added src/client/src/assets/fonts/Roboto-Thin.ttf
Binary file not shown.
Binary file not shown.
187 changes: 171 additions & 16 deletions src/client/src/components/App/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,87 @@

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Regular.eot");
src: url("../../assets/fonts/Roboto-Regular.eot?#iefix")
format("embedded-opentype"),
url("../../assets/fonts/Roboto-Regular.woff2") format("woff2"),
url("../../assets/fonts/Roboto-Regular.woff") format("woff"),
url("../../assets/fonts/Roboto-Regular.ttf") format("truetype");
src: url("../../assets/fonts/Roboto-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}

@font-face {
}
@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Bold.eot");
src: url("../../assets/fonts/Roboto-Bold.eot?#iefix")
format("embedded-opentype"),
url("../../assets/fonts/Roboto-Bold.woff2") format("woff2"),
url("../../assets/fonts/Roboto-Bold.woff") format("woff"),
url("../../assets/fonts/Roboto-Bold.ttf") format("truetype");
src: url("../../assets/fonts/Roboto-Bold.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Italic.ttf") format("truetype");
font-weight: normal;
font-style: italic;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-BoldItalic.ttf") format("truetype");
font-weight: bold;
font-style: italic;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Light.ttf") format("truetype");
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-LightItalic.ttf") format("truetype");
font-weight: 300;
font-style: italic;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-MediumItalic.ttf") format("truetype");
font-weight: 500;
font-style: italic;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Black.ttf") format("truetype");
font-weight: 900;
font-style: normal;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-BlackItalic.ttf") format("truetype");
font-weight: 900;
font-style: italic;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-Thin.ttf") format("truetype");
font-weight: 100;
font-style: normal;
}

@font-face {
font-family: "Roboto";
src: url("../../assets/fonts/Roboto-ThinItalic.ttf") format("truetype");
font-weight: 100;
font-style: italic;
}

@font-face {
font-family: "Evolventa";
Expand All @@ -69,3 +129,98 @@
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Regular.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Bold.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Regular_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Regular_Italic.woff") format("woff");
font-weight: normal;
font-style: italic;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Bold_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Bold_Italic.woff") format("woff");
font-weight: bold;
font-style: italic;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-ExtraBold.woff2") format("woff2"),
url("../../assets/fonts/Marianne-ExtraBold.woff") format("woff");
font-weight: 800;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-ExtraBold_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-ExtraBold_Italic.woff") format("woff");
font-weight: 800;
font-style: italic;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Light.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Light_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Light_Italic.woff") format("woff");
font-weight: 300;
font-style: italic;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Medium.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Medium_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Medium_Italic.woff") format("woff");
font-weight: 500;
font-style: italic;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Thin.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Thin.woff") format("woff");
font-weight: 100;
font-style: normal;
}

@font-face {
font-family: "Marianne";
src: url("../../assets/fonts/Marianne-Thin_Italic.woff2") format("woff2"),
url("../../assets/fonts/Marianne-Thin_Italic.woff") format("woff");
font-weight: 100;
font-style: italic;
}
3 changes: 2 additions & 1 deletion src/client/src/components/App/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ $font-size-title: 1.5rem;
/* TYPOGRAPHY */
$segoe: "Segoe Pro", sans-serif;
$evolventa: "Evolventa", sans-serif;
$roboto: Roboto, sans-serif;
$roboto: "Roboto", sans-serif;
$marianne: "Marianne", arial, sans-serif;


/* SPACING (values from Bulma) */
$spacing-1: map-get($spacing-values, "1"); // 0.25rem
$spacing-2: map-get($spacing-values, "2"); // 0.5rem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import PropTypes from "prop-types";
import React, { useState } from "react";

import { renderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../helpers/hoc/renderIfSiren.js";
import BlocTitle from "../../SharedComponents/BlocTitle/BlocTitle.jsx";
import { useInteractionsBySiren } from "./Interactions.gql";
import InteractionType from "./InteractionType";

const Direccte = ({ entreprise: { siren } }) => {
const Direccte = ({ entreprise }) => {
const { siren } = entreprise;
const { loading, data, error } = useInteractionsBySiren(siren);
const [direccteAccordionOpen, setDireccteAccordionOpen] = useState(true);
const shouldNotRender = useRenderIfSiren({ entreprise, siren });

if (loading || error) {
if (loading || error || shouldNotRender) {
return null;
}

Expand Down Expand Up @@ -39,4 +41,4 @@ Direccte.propTypes = {
entreprise: PropTypes.object.isRequired,
};

export default renderIfSiren(Direccte);
export default Direccte;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { prop, sum } from "lodash/fp";
import PropTypes from "prop-types";
import React from "react";

import { renderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../helpers/hoc/renderIfSiren.js";
import {
getCity,
getSiret,
Expand All @@ -21,10 +21,12 @@ import { useAccidentsTravailBySiren } from "./AccidentTravail.gql";
const getWorkAccidentsTotal = (workAccidents) =>
sum(workAccidents.map(prop("total")));

const AccidentTravail = ({ entreprise: { siren } }) => {
const AccidentTravail = ({ entreprise }) => {
const { siren } = entreprise;
const { data, error, loading } = useAccidentsTravailBySiren(siren);
const shouldNotRender = useRenderIfSiren({ entreprise, siren });

if (error || loading) {
if (loading || error || shouldNotRender) {
return null;
}

Expand Down Expand Up @@ -111,4 +113,4 @@ AccidentTravail.propTypes = {
}),
};

export default renderIfSiren(AccidentTravail);
export default AccidentTravail;
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
import PropTypes from "prop-types";
import React from "react";

import { renderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";

const AnnuaireEntreprisesLink = ({ siren }) => {
const shouldNotRender = useRenderIfSiren({ siren });

if (shouldNotRender) {
return null;
}

return (
<a
className="is-link"
Expand All @@ -21,4 +27,4 @@ AnnuaireEntreprisesLink.propTypes = {
siren: PropTypes.string.isRequired,
};

export default renderIfSiren(AnnuaireEntreprisesLink);
export default AnnuaireEntreprisesLink;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropTypes from "prop-types";
import React from "react";

import { getCustomPastYear } from "../../../../../../helpers/Date";
import { renderIfSiren } from "../../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../../helpers/hoc/renderIfSiren.js";
import { formatSiret } from "../../../../../../helpers/utils";
import {
formatApprentissage,
Expand All @@ -23,10 +23,12 @@ import SeeDetailsLink from "../../../SharedComponents/SeeDetailsLink";
import Subcategory from "../../../SharedComponents/Subcategory";
import { useApprentissageBySiren } from "./Apprentissage.gql";

const Apprentissage = ({ entreprise: { siren } }) => {
const Apprentissage = ({ entreprise }) => {
const { siren } = entreprise;
const { data, loading, error } = useApprentissageBySiren(siren);
const shouldNotRender = useRenderIfSiren({ entreprise, siren });

if (loading || error) {
if (loading || error || shouldNotRender) {
return null;
}

Expand Down Expand Up @@ -114,4 +116,4 @@ Apprentissage.propTypes = {
}),
};

export default renderIfSiren(Apprentissage);
export default Apprentissage;
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import PropTypes from "prop-types";
import React from "react";

import { renderIfSiren } from "../../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../../helpers/hoc/renderIfSiren";
import Data from "../../../SharedComponents/Data";
import NonBorderedTable from "../../../SharedComponents/NonBorderedTable/NonBorderedTable";
import Subcategory from "../../../SharedComponents/Subcategory";
import { usePlanRelanceBySiren } from "./PlanDeRelance.gql";

const PlanDeRelance = ({ entreprise: { siren } }) => {
const PlanDeRelance = ({ entreprise }) => {
const { siren } = entreprise;
const {
data: planRelanceData,
loading,
error,
} = usePlanRelanceBySiren(siren);
const shouldNotRender = useRenderIfSiren({ entreprise, siren });

if (loading || error || shouldNotRender) {
return null;
}

if (loading || error) {
return null;
Expand Down Expand Up @@ -63,4 +69,4 @@ PlanDeRelance.propTypes = {
}),
};

export default renderIfSiren(PlanDeRelance);
export default PlanDeRelance;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getDateYear,
sortByPeriode,
} from "../../../../../helpers/Date";
import { renderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";
import { useRenderIfSiren } from "../../../../../helpers/hoc/renderIfSiren";
import LoadableContent from "../../../../shared/LoadableContent/LoadableContent";
import Value from "../../../../shared/Value";
import Data from "../../SharedComponents/Data";
Expand All @@ -32,6 +32,11 @@ const Effectis = ({ siren }) => {
const handleChange = (event) => {
setDisplayTable(event.target.checked);
};
const shouldNotRender = useRenderIfSiren({ siren });

if (shouldNotRender) {
return null;
}
if (!effectifsMensuels || effectifsMensuels.length == 0) {
return (
<Data
Expand Down Expand Up @@ -149,4 +154,4 @@ Effectis.propTypes = {
siren: PropTypes.string.isRequired,
};

export default renderIfSiren(Effectis);
export default Effectis;
Loading

0 comments on commit 1f1069c

Please sign in to comment.