Skip to content

Commit

Permalink
fix responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Oct 27, 2023
1 parent 7b24c98 commit 6dc33fa
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Chart({ countryCode, data, hasDataHandler, otherCodes })
hasDataHandler(true);

return (
<Col n="6">
<Col n="12 md-6">
<HighchartsReact
highcharts={Highcharts}
options={options}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function PopulationComponent({ data, isoCode }) {

return (
(evolution.data !== null) ? (
<Col n="4">
<Col n="12 md-4">
<PopulationCard
badgeLabel={lastYear}
description={description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function EducationIndex({ data }) {
<Row gutters className="fr-mb-1w">
{
MOYSCO.year && (
<Col n="6">
<Col n="12 md-6">
<IndicatorCard
badgeLabel={MOYSCO.year}
indicator={getIndicator(MOYSCO)}
Expand All @@ -57,7 +57,7 @@ export default function EducationIndex({ data }) {
}
{
ESPSCO.year && (
<Col n="6">
<Col n="12 md-6">
<IndicatorCard
badgeLabel={ESPSCO.year}
indicator={getIndicator(ESPSCO)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ export default function Overview({ data }) {
const MOYSCO = { ...data.find((el) => el.fields.code === 'MOYSCO')?.fields };

// Effectif total supérieur
const total = { ...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === '25053')?.fields };
const total = {
...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === '25053')?.fields,
};

// Effectif par domaine d'études
for (let j = 0; j < charts.length; j += 1) {
Expand Down Expand Up @@ -74,7 +76,7 @@ export default function Overview({ data }) {
<Row gutters className="fr-mb-1w">
{
(Object.keys(total).length !== 0) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={total.year}
indicator={getIndicator(total)}
Expand All @@ -85,7 +87,7 @@ export default function Overview({ data }) {
}
{
((Object.keys(seriesCountry[0]).length !== 0) && (seriesCountry[0].value !== 0)) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={seriesCountry[0].year}
indicator={getIndicator(seriesCountry[0])}
Expand All @@ -96,7 +98,7 @@ export default function Overview({ data }) {
}
{
(Object.keys(MOYSCO).length !== 0) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={MOYSCO.year}
indicator={getIndicator(MOYSCO)}
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/country/components/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function CountryProfilePage() {
<PopulationComponent isoCode={isoCode} data={el} key={isoCode} />
))}
{Object.keys(RNB).length !== 0 ? (
<Col n="4">
<Col n="12 md-4">
<GenericCard
badgeLabel={RNB.year}
indicator={getNumber(RNB)}
Expand All @@ -99,7 +99,7 @@ export default function CountryProfilePage() {
</Col>
) : null}
{Object.keys(IDH).length !== 0 ? (
<Col n="4">
<Col n="12 md-4">
<GenericCard
badgeLabel={IDH.year}
indicator={getNumber(IDH)}
Expand All @@ -108,7 +108,7 @@ export default function CountryProfilePage() {
</Col>
) : null}
{Object.keys(ESPVIE).length !== 0 ? (
<Col n="4">
<Col n="12 md-4">
<GenericCard
badgeLabel={ESPVIE.year}
indicator={getNumber(ESPVIE)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,28 @@ export default function Overview({ data }) {
const ID_DIRD = 'G_XGDP';

// Effectif total personnel R-D
const totalRD = { ...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_TOTAL_PERSO)?.fields };
const totalRD = {
...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_TOTAL_PERSO)?.fields,
};

// Total des Crédits budgétaires
const totalCB = { ...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_CREDITS)?.fields };
const totalCB = {
...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_CREDITS)?.fields,
};

// DIRD en % du PIB
const totalDIRD = { ...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_DIRD)?.fields };
const totalDIRD = {
...data
// récupérer la donnée la plus récente
.sort((a, b) => b.fields.year - a.fields.year)
.find((el) => el.fields.code === ID_DIRD)?.fields,
};

const getIndicator = (code) => {
if (code.code === ID_TOTAL_PERSO) {
Expand Down Expand Up @@ -66,7 +72,7 @@ export default function Overview({ data }) {
<Row gutters className="fr-mb-1w">
{
(Object.keys(totalRD).length !== 0) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={totalRD.year}
indicator={getIndicator(totalRD)}
Expand All @@ -77,7 +83,7 @@ export default function Overview({ data }) {
}
{
(Object.keys(totalCB).length !== 0) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={totalCB.year}
indicator={getIndicator(totalCB)}
Expand All @@ -88,7 +94,7 @@ export default function Overview({ data }) {
}
{
(Object.keys(totalDIRD).length !== 0) ? (
<Col n="4">
<Col n="12 md-4">
<IndicatorCard
badgeLabel={totalDIRD.year}
indicator={getIndicator(totalDIRD)}
Expand Down

0 comments on commit 6dc33fa

Please sign in to comment.