selected filters
This commit is contained in:
parent
f9ea03e64c
commit
9d861a9768
@ -12,6 +12,7 @@ import FilterBox from "./FilterBox";
|
|||||||
import Container from "react-bootstrap/Container";
|
import Container from "react-bootstrap/Container";
|
||||||
import Row from "react-bootstrap/Row";
|
import Row from "react-bootstrap/Row";
|
||||||
import Col from "react-bootstrap/Col";
|
import Col from "react-bootstrap/Col";
|
||||||
|
import SelectedFilters from "./SelectedFilters";
|
||||||
|
|
||||||
import Icon1 from "../../../Icons/icon1.svg";
|
import Icon1 from "../../../Icons/icon1.svg";
|
||||||
import Icon2 from "../../../Icons/icon2.svg";
|
import Icon2 from "../../../Icons/icon2.svg";
|
||||||
@ -82,6 +83,8 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
regional_treaties: [],
|
regional_treaties: [],
|
||||||
international_treaties: [],
|
international_treaties: [],
|
||||||
intsruments: [],
|
intsruments: [],
|
||||||
|
internationalIntsruments: [],
|
||||||
|
africanIntsruments: [],
|
||||||
|
|
||||||
loading: true,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
@ -96,6 +99,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedRegion: "",
|
selectedRegion: "",
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "", // For the Slescted filters box
|
||||||
|
|
||||||
selectedCountriesNamesRegions: [],
|
selectedCountriesNamesRegions: [],
|
||||||
selectedCountriesNamesTreaties: [],
|
selectedCountriesNamesTreaties: [],
|
||||||
@ -112,17 +116,15 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
infoBox: [],
|
infoBox: [],
|
||||||
showInfoBox: false,
|
showInfoBox: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
window.addEventListener("resize", this.handleResize);
|
window.addEventListener("resize", this.handleResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
window.removeEventListener('resize', this.handleResize);
|
window.removeEventListener("resize", this.handleResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchData = async () => {
|
fetchData = async () => {
|
||||||
@ -170,6 +172,18 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const internationalIntsruments = data.internationalIntsruments.map(
|
||||||
|
(instrument) => ({
|
||||||
|
...instrument,
|
||||||
|
icon: iconMap[instrument.icon] || null,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const africanIntsruments = data.africanIntsruments.map((instrument) => ({
|
||||||
|
...instrument,
|
||||||
|
icon: iconMap[instrument.icon] || null,
|
||||||
|
}));
|
||||||
|
|
||||||
const intsruments = data.intsruments.map((instrument) => ({
|
const intsruments = data.intsruments.map((instrument) => ({
|
||||||
...instrument,
|
...instrument,
|
||||||
icon: iconMap[instrument.icon] || null,
|
icon: iconMap[instrument.icon] || null,
|
||||||
@ -180,6 +194,8 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
geographical_organisations: data.geographical_organisations,
|
geographical_organisations: data.geographical_organisations,
|
||||||
regional_treaties,
|
regional_treaties,
|
||||||
international_treaties,
|
international_treaties,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
intsruments,
|
intsruments,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
@ -277,6 +293,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedRegion: "",
|
selectedRegion: "",
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "",
|
||||||
|
|
||||||
selectedCountriesNamesRegions: [],
|
selectedCountriesNamesRegions: [],
|
||||||
selectedCountriesNamesTreaties: [],
|
selectedCountriesNamesTreaties: [],
|
||||||
@ -300,6 +317,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountry: countryName,
|
selectedCountry: countryName,
|
||||||
selectedRegion: "",
|
selectedRegion: "",
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "",
|
||||||
|
|
||||||
selectedCountriesNamesRegions: [],
|
selectedCountriesNamesRegions: [],
|
||||||
selectedCountriesNamesTreaties: [],
|
selectedCountriesNamesTreaties: [],
|
||||||
@ -367,20 +385,24 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
prevStatuesRegion: status,
|
prevStatuesRegion: status,
|
||||||
selectedCountriesFeaturesRegions,
|
selectedCountriesFeaturesRegions,
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "",
|
||||||
showInfoBox: true,
|
showInfoBox: true,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
handleTreatiesClick = (name, status) => {
|
handleTreatiesClick = (name, status, official_name) => {
|
||||||
const {
|
const {
|
||||||
selectedRegion,
|
selectedRegion,
|
||||||
selectedTreaty,
|
selectedTreaty,
|
||||||
|
selectedTreatyOfficialName,
|
||||||
selectedCountriesNamesRegions,
|
selectedCountriesNamesRegions,
|
||||||
prevStatuesTreaty,
|
prevStatuesTreaty,
|
||||||
africaCountries,
|
africaCountries,
|
||||||
regional_treaties,
|
regional_treaties,
|
||||||
international_treaties,
|
international_treaties,
|
||||||
intsruments,
|
intsruments,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
// get the icon of the selected treaty based on the name and status of the treaty
|
// get the icon of the selected treaty based on the name and status of the treaty
|
||||||
@ -390,7 +412,12 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
regional_treaties.find((org) => org.name2 === name) ||
|
regional_treaties.find((org) => org.name2 === name) ||
|
||||||
international_treaties.find((org) => org.name2 === name);
|
international_treaties.find((org) => org.name2 === name);
|
||||||
|
|
||||||
let instrument = intsruments.find(
|
let instrument =
|
||||||
|
internationalIntsruments.find(
|
||||||
|
(instrument) => instrument.name2 === name
|
||||||
|
) || africanIntsruments.find((instrument) => instrument.name2 === name);
|
||||||
|
|
||||||
|
let instrument_ = intsruments.find(
|
||||||
(instrument) => instrument.name2 === name
|
(instrument) => instrument.name2 === name
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -418,6 +445,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountryColor: "yellow",
|
selectedCountryColor: "yellow",
|
||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "",
|
||||||
prevStatuesTreaty: "",
|
prevStatuesTreaty: "",
|
||||||
prevStatuesRegion: "",
|
prevStatuesRegion: "",
|
||||||
selectedIcon: "none",
|
selectedIcon: "none",
|
||||||
@ -434,6 +462,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountriesNamesTreaties: [],
|
selectedCountriesNamesTreaties: [],
|
||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedTreaty: "",
|
selectedTreaty: "",
|
||||||
|
selectedTreatyOfficialName: "",
|
||||||
prevStatuesTreaty: "",
|
prevStatuesTreaty: "",
|
||||||
selectedIcon: "none",
|
selectedIcon: "none",
|
||||||
showInfoBox: true,
|
showInfoBox: true,
|
||||||
@ -464,6 +493,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountriesNamesTreaties: intersection,
|
selectedCountriesNamesTreaties: intersection,
|
||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedTreaty: name,
|
selectedTreaty: name,
|
||||||
|
selectedTreatyOfficialName: official_name,
|
||||||
prevStatuesTreaty: status,
|
prevStatuesTreaty: status,
|
||||||
showInfoBox: true,
|
showInfoBox: true,
|
||||||
});
|
});
|
||||||
@ -474,6 +504,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountriesNamesTreaties,
|
selectedCountriesNamesTreaties,
|
||||||
selectedCountry: "",
|
selectedCountry: "",
|
||||||
selectedTreaty: name,
|
selectedTreaty: name,
|
||||||
|
selectedTreatyOfficialName: official_name,
|
||||||
prevStatuesTreaty: status,
|
prevStatuesTreaty: status,
|
||||||
selectedCountriesFeaturesTreaties,
|
selectedCountriesFeaturesTreaties,
|
||||||
});
|
});
|
||||||
@ -485,6 +516,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
) {
|
) {
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedTreaty: name,
|
selectedTreaty: name,
|
||||||
|
selectedTreatyOfficialName: official_name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -494,6 +526,8 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountriesFeaturesRegions,
|
selectedCountriesFeaturesRegions,
|
||||||
regional_treaties,
|
regional_treaties,
|
||||||
international_treaties,
|
international_treaties,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
intsruments,
|
intsruments,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
@ -524,11 +558,29 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Helper function to process instruments
|
||||||
|
const processInstruments = (instruments) => {
|
||||||
|
return instruments.map((instrument) => {
|
||||||
|
const countris = selectedCountriesFeaturesRegions.filter(
|
||||||
|
(feature) => feature.properties[instrument.name2] === 1
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
name: instrument.name,
|
||||||
|
countries: countris.length,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const organisationsRegionalTreaties = processTreaties(regional_treaties);
|
const organisationsRegionalTreaties = processTreaties(regional_treaties);
|
||||||
const organisationsInternationalTreaties = processTreaties(
|
const organisationsInternationalTreaties = processTreaties(
|
||||||
international_treaties
|
international_treaties
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const internationalIntsruments_ = processInstruments(
|
||||||
|
internationalIntsruments
|
||||||
|
);
|
||||||
|
const africanIntsruments_ = processInstruments(africanIntsruments);
|
||||||
|
|
||||||
const organisationsInstruments = intsruments.map((instrument) => {
|
const organisationsInstruments = intsruments.map((instrument) => {
|
||||||
const countris = selectedCountriesFeaturesRegions.filter(
|
const countris = selectedCountriesFeaturesRegions.filter(
|
||||||
(feature) => feature.properties[instrument.name2] === 1
|
(feature) => feature.properties[instrument.name2] === 1
|
||||||
@ -543,6 +595,8 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
organisationsRegionalTreaties,
|
organisationsRegionalTreaties,
|
||||||
organisationsInternationalTreaties,
|
organisationsInternationalTreaties,
|
||||||
organisationsInstruments,
|
organisationsInstruments,
|
||||||
|
internationalIntsruments_,
|
||||||
|
africanIntsruments_,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -599,11 +653,15 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
selectedCountryColor,
|
selectedCountryColor,
|
||||||
selectedRegion,
|
selectedRegion,
|
||||||
selectedTreaty,
|
selectedTreaty,
|
||||||
|
selectedTreatyOfficialName,
|
||||||
selectedIcon,
|
selectedIcon,
|
||||||
geographical_organisations,
|
geographical_organisations,
|
||||||
regional_organisations,
|
regional_organisations,
|
||||||
regional_treaties,
|
regional_treaties,
|
||||||
international_treaties,
|
international_treaties,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
|
intsruments,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@ -615,7 +673,7 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Container fluid>
|
<Container fluid>
|
||||||
<Row>
|
<Row>
|
||||||
<Col className="filter-section" sm={3} >
|
<Col className="filter-section" sm={3}>
|
||||||
<FilterBox
|
<FilterBox
|
||||||
selectedCountry={selectedCountry}
|
selectedCountry={selectedCountry}
|
||||||
countriesNames={countriesNames}
|
countriesNames={countriesNames}
|
||||||
@ -626,6 +684,9 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
regional_organisations={regional_organisations}
|
regional_organisations={regional_organisations}
|
||||||
regional_treaties={regional_treaties}
|
regional_treaties={regional_treaties}
|
||||||
international_treaties={international_treaties}
|
international_treaties={international_treaties}
|
||||||
|
internationalIntsruments={internationalIntsruments}
|
||||||
|
africanIntsruments={africanIntsruments}
|
||||||
|
intsruments={intsruments}
|
||||||
></FilterBox>
|
></FilterBox>
|
||||||
</Col>
|
</Col>
|
||||||
<Col className="map-section" sm={9}>
|
<Col className="map-section" sm={9}>
|
||||||
@ -729,6 +790,15 @@ class ControlInAfricaMap extends React.Component {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{selectedRegion || selectedTreatyOfficialName ? (
|
||||||
|
<SelectedFilters
|
||||||
|
selectedRegion={selectedRegion}
|
||||||
|
selectedTreatyOfficialName={selectedTreatyOfficialName}
|
||||||
|
></SelectedFilters>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
|
||||||
{this.state.showInfoBox && (
|
{this.state.showInfoBox && (
|
||||||
<MapInfoBox
|
<MapInfoBox
|
||||||
className="info-box"
|
className="info-box"
|
||||||
|
@ -29,6 +29,9 @@ const FilterBox = (props) => {
|
|||||||
regional_treaties,
|
regional_treaties,
|
||||||
international_treaties,
|
international_treaties,
|
||||||
geographical_organisations,
|
geographical_organisations,
|
||||||
|
instruments,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -59,6 +62,9 @@ const FilterBox = (props) => {
|
|||||||
<Treaties_Filter
|
<Treaties_Filter
|
||||||
regional_treaties={regional_treaties}
|
regional_treaties={regional_treaties}
|
||||||
international_treaties={international_treaties}
|
international_treaties={international_treaties}
|
||||||
|
instruments={instruments}
|
||||||
|
internationalIntsruments={internationalIntsruments}
|
||||||
|
africanIntsruments={africanIntsruments}
|
||||||
handleTreatiesClick={handleTreatiesClick}
|
handleTreatiesClick={handleTreatiesClick}
|
||||||
language={language}
|
language={language}
|
||||||
/>
|
/>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import Button from "react-bootstrap/Button";
|
|
||||||
import Collapse from "react-bootstrap/Collapse";
|
import Collapse from "react-bootstrap/Collapse";
|
||||||
|
import Card_ from "../../UI/Card_/Card_";
|
||||||
|
|
||||||
const MapInfoBox = (props) => {
|
const MapInfoBox = (props) => {
|
||||||
|
const { internationalIntsruments_, africanIntsruments_ } = props.info;
|
||||||
const regional_treaties = props.info.organisationsRegionalTreaties;
|
const regional_treaties = props.info.organisationsRegionalTreaties;
|
||||||
const international_treaties = props.info.organisationsInternationalTreaties;
|
const international_treaties = props.info.organisationsInternationalTreaties;
|
||||||
const instruments = props.info.organisationsInstruments;
|
const instruments = props.info.organisationsInstruments;
|
||||||
@ -10,15 +11,22 @@ const MapInfoBox = (props) => {
|
|||||||
const [isHidden, setIsHidden] = useState(false);
|
const [isHidden, setIsHidden] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={props.className}>
|
<Card_ className={props.className}>
|
||||||
<div
|
<div
|
||||||
onClick={() => {setOpen(!open); setIsHidden(!isHidden);}}
|
onClick={() => {
|
||||||
|
setOpen(!open);
|
||||||
|
setIsHidden(!isHidden);
|
||||||
|
}}
|
||||||
aria-controls="example-collapse-text"
|
aria-controls="example-collapse-text"
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
style={{ display: "flex", justifyContent: "space-between" }}
|
style={{ display: "flex", justifyContent: "space-between" }}
|
||||||
>
|
>
|
||||||
<span><h3>{props.selectedRegion}</h3></span>
|
<span>
|
||||||
<span><h3>{isHidden ? 'Show' : 'Hide'}</h3></span>
|
<h3>{props.selectedRegion}</h3>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<h3>{isHidden ? "Show" : "Hide"}</h3>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Collapse in={open}>
|
<Collapse in={open}>
|
||||||
<div className="example-collapse-text">
|
<div className="example-collapse-text">
|
||||||
@ -144,8 +152,29 @@ const MapInfoBox = (props) => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{instruments &&
|
{internationalIntsruments_ &&
|
||||||
instruments.map((item, index) => {
|
internationalIntsruments_.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<p className="mb-1" key={index}>
|
||||||
|
<strong>{item.name}:</strong>{" "}
|
||||||
|
<span
|
||||||
|
style={
|
||||||
|
item.countries
|
||||||
|
? {
|
||||||
|
color: props.selectedCountryColor,
|
||||||
|
fontWeight: "bold",
|
||||||
|
fontSize: "16px",
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{item.countries}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
{africanIntsruments_ &&
|
||||||
|
africanIntsruments_.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<p className="mb-1" key={index}>
|
<p className="mb-1" key={index}>
|
||||||
<strong>{item.name}:</strong>{" "}
|
<strong>{item.name}:</strong>{" "}
|
||||||
@ -167,7 +196,7 @@ const MapInfoBox = (props) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</div>
|
</Card_>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
15
src/Components/Layout/ControlInAfrica/SelectedFilters.jsx
Normal file
15
src/Components/Layout/ControlInAfrica/SelectedFilters.jsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import React from "react";
|
||||||
|
import Card_ from "../../UI/Card_/Card_";
|
||||||
|
|
||||||
|
const SelectedFilters = (props) => {
|
||||||
|
const { selectedRegion, selectedTreatyOfficialName } = props;
|
||||||
|
return (
|
||||||
|
<Card_ className="selected-filters p-2">
|
||||||
|
<h5>Selected Filter/s:</h5>
|
||||||
|
{selectedRegion && <li>{selectedRegion}</li>}
|
||||||
|
{selectedTreatyOfficialName && <li>{selectedTreatyOfficialName}</li>}
|
||||||
|
</Card_>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SelectedFilters;
|
@ -19,12 +19,15 @@ const Treaties_Filter = (props) => {
|
|||||||
en: "African Guidelines & Instrumentss",
|
en: "African Guidelines & Instrumentss",
|
||||||
fr: "Directives & instruments africains",
|
fr: "Directives & instruments africains",
|
||||||
ar: "المبادىء التوجيهية و الأدوات السياسية في افريقيا",
|
ar: "المبادىء التوجيهية و الأدوات السياسية في افريقيا",
|
||||||
}
|
};
|
||||||
const {
|
const {
|
||||||
international_treaties,
|
international_treaties,
|
||||||
handleTreatiesClick,
|
handleTreatiesClick,
|
||||||
regional_treaties,
|
regional_treaties,
|
||||||
language,
|
language,
|
||||||
|
instruments,
|
||||||
|
internationalIntsruments,
|
||||||
|
africanIntsruments,
|
||||||
} = props;
|
} = props;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -67,7 +70,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Eligible`}
|
title={`${treaty.name}-Eligible`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon"
|
className="icon"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Eligible")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Eligible", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -79,7 +84,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Signed`}
|
title={`${treaty.name}-Signed`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon"
|
className="icon"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Signed")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Signed", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -91,7 +98,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Ratified`}
|
title={`${treaty.name}-Ratified`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon"
|
className="icon"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Ratified")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Ratified", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -116,7 +125,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Eligible`}
|
title={`${treaty.name}-Eligible`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon-2"
|
className="icon-2"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Eligible")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Eligible", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -128,7 +139,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Signed`}
|
title={`${treaty.name}-Signed`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon-2"
|
className="icon-2"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Signed")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Signed", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -140,7 +153,9 @@ const Treaties_Filter = (props) => {
|
|||||||
title={`${treaty.name}-Ratified`}
|
title={`${treaty.name}-Ratified`}
|
||||||
srcSet=""
|
srcSet=""
|
||||||
className="icon-2"
|
className="icon-2"
|
||||||
onClick={() => handleTreatiesClick(treaty.name2, "Ratified")}
|
onClick={() =>
|
||||||
|
handleTreatiesClick(treaty.name2, "Ratified", treaty.name)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="icon"></div>
|
<div className="icon"></div>
|
||||||
@ -151,58 +166,70 @@ const Treaties_Filter = (props) => {
|
|||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{language === "en" && <h5>
|
{language === "en" && (
|
||||||
International Guidelines & Instruments <br />
|
<h5>
|
||||||
<small>(countries with recent activities only, 2014 - 2019)</small>
|
International Guidelines & Instruments <br />
|
||||||
</h5>}
|
<small>(countries with recent activities only, 2014 - 2019)</small>
|
||||||
{language === "fr" && <h5>
|
</h5>
|
||||||
Directives & instruments internationaux <br />
|
)}
|
||||||
<small>(pays avec activité récente uniquement, 2014 - 2019)</small>
|
{language === "fr" && (
|
||||||
</h5>}
|
<h5>
|
||||||
{language === "ar" && <h5>
|
Directives & instruments internationaux <br />
|
||||||
المبادىء التوجيهية و الأدوات الدولية <br />
|
<small>(pays avec activité récente uniquement, 2014 - 2019)</small>
|
||||||
<small>(فقط الدول ذات النشاطات الحديثة 2014-2019)</small>
|
</h5>
|
||||||
</h5>}
|
)}
|
||||||
<div className="treaty-item-2">
|
{language === "ar" && (
|
||||||
<img
|
<h5>
|
||||||
src={Icon20}
|
المبادىء التوجيهية و الأدوات الدولية <br />
|
||||||
alt=""
|
<small>(فقط الدول ذات النشاطات الحديثة 2014-2019)</small>
|
||||||
className="icon-2"
|
</h5>
|
||||||
onClick={() =>
|
)}
|
||||||
handleTreatiesClick("UNProgrammeofAction", "Checked")
|
{internationalIntsruments.map((instrument) => (
|
||||||
}
|
<div key={instrument.name} className="treaty-item">
|
||||||
/>
|
<img
|
||||||
<div className="treaty-item-name">UN Programme of Action</div>
|
src={instrument.icon}
|
||||||
</div>
|
alt={instrument.name}
|
||||||
<div className="treaty-item-2">
|
title={instrument.name}
|
||||||
<img
|
srcSet=""
|
||||||
src={Icon16}
|
className="icon-2"
|
||||||
alt=""
|
onClick={() =>
|
||||||
className="icon-2"
|
handleTreatiesClick(
|
||||||
onClick={() =>
|
instrument.name2,
|
||||||
handleTreatiesClick("InternationalTracingInstrument", "Checked")
|
"checked",
|
||||||
}
|
instrument.name
|
||||||
/>
|
)
|
||||||
<div className="treaty-item-name">
|
}
|
||||||
International Tracing Instrument
|
/>
|
||||||
|
<div className="treaty-item-name">{instrument.name}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
))}
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h5>{africanGuidelinesHeadings[language] || africanGuidelinesHeadings['en']}</h5>
|
<h5>
|
||||||
|
{africanGuidelinesHeadings[language] ||
|
||||||
|
africanGuidelinesHeadings["en"]}
|
||||||
|
</h5>
|
||||||
|
|
||||||
<div className="treaty-item-2">
|
{africanIntsruments.map((instrument) => (
|
||||||
<img
|
<div key={instrument.name} className="treaty-item">
|
||||||
src={Icon1}
|
<img
|
||||||
alt=""
|
src={instrument.icon}
|
||||||
className="icon-2"
|
alt={instrument.name}
|
||||||
onClick={() => handleTreatiesClick("StG-PoA", "Checked")}
|
title={instrument.name}
|
||||||
/>
|
srcSet=""
|
||||||
<div className="treaty-item-name">
|
className="icon-2"
|
||||||
Silencing the Guns in Africa Programme of Action
|
onClick={() =>
|
||||||
|
handleTreatiesClick(
|
||||||
|
instrument.name2,
|
||||||
|
"checked",
|
||||||
|
instrument.name
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<div className="treaty-item-name">{instrument.name}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import classes from './Card_.module.css'
|
|
||||||
|
|
||||||
const Card_ = props => {
|
const Card_ = props => {
|
||||||
return (
|
return (
|
||||||
<div className={`${classes.card} ${props.className} `}>{props.children}</div>
|
<div className={`card ${props.className} `}>{props.children}</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,109 +1,132 @@
|
|||||||
{"regional_organisations": [
|
{
|
||||||
{ "name": "AU", "color": "#b2df8a" },
|
"regional_organisations": [
|
||||||
{ "name": "EAC", "color": "#33a02c" },
|
{ "name": "AU", "color": "#b2df8a" },
|
||||||
{ "name": "IGAD", "color": "#fb9a99" },
|
{ "name": "EAC", "color": "#33a02c" },
|
||||||
{ "name": "UMA", "color": "#e31a1c" },
|
{ "name": "IGAD", "color": "#fb9a99" },
|
||||||
{ "name": "COMESA", "color": "#fdbf6f" },
|
{ "name": "UMA", "color": "#e31a1c" },
|
||||||
{ "name": "ECOWAS", "color": "#ff7f00" },
|
{ "name": "COMESA", "color": "#fdbf6f" },
|
||||||
{ "name": "CEN-SAD", "color": "#cab2d6" },
|
{ "name": "ECOWAS", "color": "#ff7f00" },
|
||||||
{ "name": "SADC", "color": "#6a3d9a" },
|
{ "name": "CEN-SAD", "color": "#cab2d6" },
|
||||||
{ "name": "ECCAS", "color": "#ffff99" },
|
{ "name": "SADC", "color": "#6a3d9a" },
|
||||||
{ "name": "ICGLR", "color": "#b15928" },
|
{ "name": "ECCAS", "color": "#ffff99" },
|
||||||
{ "name": "RECSA", "color": "#a6cee3" },
|
{ "name": "ICGLR", "color": "#b15928" },
|
||||||
{ "name": "SARCOM", "color": "#1f78b4" }
|
{ "name": "RECSA", "color": "#a6cee3" },
|
||||||
],
|
{ "name": "SARCOM", "color": "#1f78b4" }
|
||||||
|
],
|
||||||
|
|
||||||
"geographical_organisations": [
|
"geographical_organisations": [
|
||||||
{ "name": "Northern-Africa", "color": "#e3e3e3" },
|
{ "name": "Northern-Africa", "color": "#e3e3e3" },
|
||||||
{ "name": "Eastern-Africa", "color": "#e3e3e3" },
|
{ "name": "Eastern-Africa", "color": "#e3e3e3" },
|
||||||
{ "name": "Southern-Africa", "color": "#e3e3e3" },
|
{ "name": "Southern-Africa", "color": "#e3e3e3" },
|
||||||
{ "name": "Western-Africa", "color": "#e3e3e3" },
|
{ "name": "Western-Africa", "color": "#e3e3e3" },
|
||||||
{ "name": "Central-Africa", "color": "#e3e3e3" }
|
{ "name": "Central-Africa", "color": "#e3e3e3" }
|
||||||
],
|
],
|
||||||
|
|
||||||
"regional_treaties": [
|
"regional_treaties": [
|
||||||
{
|
{
|
||||||
"name": "Bamako Declaration",
|
"name": "Bamako Declaration",
|
||||||
"name2": "BamakoDeclaration",
|
"name2": "BamakoDeclaration",
|
||||||
"icon_eligible": "Icon26",
|
"icon_eligible": "Icon26",
|
||||||
"icon_signed": "Icon24",
|
"icon_signed": "Icon24",
|
||||||
"icon_ratified": "none"
|
"icon_ratified": "none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kinshasa Convention",
|
"name": "Kinshasa Convention",
|
||||||
"name2": "KinshasaConvention",
|
"name2": "KinshasaConvention",
|
||||||
"icon_eligible": "Icon4",
|
"icon_eligible": "Icon4",
|
||||||
"icon_signed": "Icon6",
|
"icon_signed": "Icon6",
|
||||||
"icon_ratified": "Icon5"
|
"icon_ratified": "Icon5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ECOWAS Convention",
|
"name": "ECOWAS Convention",
|
||||||
"name2": "ECOWASConvention",
|
"name2": "ECOWASConvention",
|
||||||
"icon_eligible": "Icon2",
|
"icon_eligible": "Icon2",
|
||||||
"icon_signed": "Icon3",
|
"icon_signed": "Icon3",
|
||||||
"icon_ratified": "none"
|
"icon_ratified": "none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Khartoum Declaration",
|
"name": "Khartoum Declaration",
|
||||||
"name2": "KhartoumDeclaration",
|
"name2": "KhartoumDeclaration",
|
||||||
"icon_eligible": "Icon21",
|
"icon_eligible": "Icon21",
|
||||||
"icon_signed": "Icon23",
|
"icon_signed": "Icon23",
|
||||||
"icon_ratified": "none"
|
"icon_ratified": "none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Nairobi Protocol",
|
"name": "Nairobi Protocol",
|
||||||
"name2": "NairobiProtocol",
|
"name2": "NairobiProtocol",
|
||||||
"icon_eligible": "Icon22",
|
"icon_eligible": "Icon22",
|
||||||
"icon_signed": "Icon25",
|
"icon_signed": "Icon25",
|
||||||
"icon_ratified": "none"
|
"icon_ratified": "none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "SADC Firearms Protocol",
|
"name": "SADC Firearms Protocol",
|
||||||
"name2": "SADCFirearmsProtocol",
|
"name2": "SADCFirearmsProtocol",
|
||||||
"icon_eligible": "Icon8",
|
"icon_eligible": "Icon8",
|
||||||
"icon_signed": "Icon7",
|
"icon_signed": "Icon7",
|
||||||
"icon_ratified": "Icon9"
|
"icon_ratified": "Icon9"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"international_treaties": [
|
"international_treaties": [
|
||||||
{
|
{
|
||||||
"name": "Arms Trade Treaty",
|
"name": "Arms Trade Treaty",
|
||||||
"name2": "ArmsTradeTreaty",
|
"name2": "ArmsTradeTreaty",
|
||||||
"icon_eligible": "Icon19",
|
"icon_eligible": "Icon19",
|
||||||
"icon_signed": "Icon17",
|
"icon_signed": "Icon17",
|
||||||
"icon_ratified": "Icon18"
|
"icon_ratified": "Icon18"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Firearms Protocol",
|
"name": "Firearms Protocol",
|
||||||
"name2": "FirearmsProtocol",
|
"name2": "FirearmsProtocol",
|
||||||
"icon_eligible": "Icon12",
|
"icon_eligible": "Icon12",
|
||||||
"icon_signed": "Icon10",
|
"icon_signed": "Icon10",
|
||||||
"icon_ratified": "Icon11"
|
"icon_ratified": "Icon11"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Wassenaar Agreement",
|
"name": "Wassenaar Agreement",
|
||||||
"name2": "WassenaarAgreement",
|
"name2": "WassenaarAgreement",
|
||||||
"icon_eligible": "Icon15",
|
"icon_eligible": "Icon15",
|
||||||
"icon_signed": "Icon13",
|
"icon_signed": "Icon13",
|
||||||
"icon_ratified": "Icon14"
|
"icon_ratified": "Icon14"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"intsruments": [
|
"internationalIntsruments": [
|
||||||
{
|
{
|
||||||
"name2": "UNProgrammeofAction",
|
"name2": "UNProgrammeofAction",
|
||||||
"name": "UN Programme of Action",
|
"name": "UN Programme of Action",
|
||||||
"icon": "Icon20"
|
"icon": "Icon20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name2": "InternationalTracingInstrument",
|
"name2": "InternationalTracingInstrument",
|
||||||
"name": "International Tracing Instrument",
|
"name": "International Tracing Instrument",
|
||||||
"icon": "Icon16"
|
"icon": "Icon16"
|
||||||
},
|
}
|
||||||
{
|
],
|
||||||
"name2": "StG-PoA",
|
|
||||||
"name": "Silencing the Guns in Africa Programme of Action",
|
"africanIntsruments": [
|
||||||
"icon": "Icon1"
|
{
|
||||||
}
|
"name2": "StG-PoA",
|
||||||
]}
|
"name": "Silencing the Guns in Africa Programme of Action",
|
||||||
|
"icon": "Icon1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"intsruments": [
|
||||||
|
{
|
||||||
|
"name2": "UNProgrammeofAction",
|
||||||
|
"name": "UN Programme of Action",
|
||||||
|
"icon": "Icon20"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name2": "InternationalTracingInstrument",
|
||||||
|
"name": "International Tracing Instrument",
|
||||||
|
"icon": "Icon16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name2": "StG-PoA",
|
||||||
|
"name": "Silencing the Guns in Africa Programme of Action",
|
||||||
|
"icon": "Icon1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
.card{
|
||||||
|
// background-color: red;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
@ -20,6 +20,13 @@
|
|||||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected-filters{
|
||||||
|
position: absolute;
|
||||||
|
top: 60px;
|
||||||
|
left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 200px) {
|
@media (min-width: 200px) {
|
||||||
.col-sm-9 {
|
.col-sm-9 {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
// Components
|
// Components
|
||||||
@import 'Components/zoom_control';
|
@import 'Components/zoom_control';
|
||||||
|
@import 'Components/cards';
|
||||||
// Import other components partials...
|
// Import other components partials...
|
||||||
|
|
||||||
// Import other partials as needed...
|
// Import other partials as needed...
|
||||||
|
Loading…
Reference in New Issue
Block a user