Skip to content

Commit

Permalink
fix(modal): add modal from dsfr-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Feb 15, 2024
1 parent 4dee4a4 commit 34ee693
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.6",
"private": true,
"dependencies": {
"@dataesr/dsfr-plus": "^0.0.9",
"@dataesr/react-dsfr": "^3.4.13",
"@jonkoops/matomo-tracker-react": "^0.7.0",
"@testing-library/jest-dom": "^5.16.5",
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/directory-blocs/structure-card.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useState } from 'react';
import PropTypes from 'prop-types';
// eslint-disable-next-line import/no-unresolved
import { Modal, ModalTitle, ModalContent } from '@dataesr/dsfr-plus';
import {
Button,
Col,
Expand All @@ -8,7 +10,7 @@ import {
Row,
Text,
Title,
Modal, ModalContent, ModalTitle } from '@dataesr/react-dsfr';
} from '@dataesr/react-dsfr';

function AddressCard({ address, displayName }) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Button, Col, Row, Modal, ModalContent, ModalTitle, Icon, Text } from '@dataesr/react-dsfr';
import { Button, Col, Row, Icon, Text } from '@dataesr/react-dsfr';
// eslint-disable-next-line import/no-unresolved
import { Modal, ModalTitle, ModalContent } from '@dataesr/dsfr-plus';

import PropTypes from 'prop-types';
import { useState } from 'react';
import { useOutletContext, useParams } from 'react-router-dom';
Expand Down
6 changes: 4 additions & 2 deletions client/src/pages/country/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
ButtonGroup,
Col, Container, Row, Link,
Icon,
Modal, ModalClose, ModalContent, ModalTitle,
SideMenu, SideMenuLink,
Text,
Title,
Checkbox,
Highlight,
} from '@dataesr/react-dsfr';
// eslint-disable-next-line import/no-unresolved
import { Modal, ModalTitle, ModalContent, ModalClose } from '@dataesr/dsfr-plus';

import { FormattedDate } from 'react-intl';
import { v4 as uuidV4 } from 'uuid';
import Button from '../../components/button';
Expand All @@ -37,7 +39,7 @@ export default function Fiche({ exportState }) {
const { data, isLoading, error, isUnknownCountry } = useFetchData(isoCode);
let actorName = '';

// const dataPays = data['curiexplore-pays']?.filter((country) => country.fields.curiexplore === 'TRUE').find((country) => country.fields.iso3 === isoCode).fields;
// const dataPays = data['curiexplore-pays']?.filter((country) => country?.fields?.curiexplore === 'TRUE').find((country) => country?.fields?.iso3 === isoCode)?.fields;
const dataPays = data['curiexplore-pays']?.find((country) => country.fields.iso3 === isoCode).fields;
const dataTimestamp = data['curiexplore-timestamp']?.[0]?.fields;
const campusFrance = dataPays?.cf_mobility;
Expand Down
4 changes: 2 additions & 2 deletions client/src/utils/getLabel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import countriesList from '../assets/data/countriesList.json';

export default function getLabel(isoCode, en = false) {
if (en) return countriesList.find((el) => el.ISO_alpha3 === isoCode).Pays_eng;
return countriesList.find((el) => el.ISO_alpha3 === isoCode).Pays;
if (en) return countriesList.find((el) => el?.ISO_alpha3 === isoCode)?.Pays_eng;
return countriesList?.find((el) => el?.ISO_alpha3 === isoCode)?.Pays;
}

0 comments on commit 34ee693

Please sign in to comment.