From 8e4ac922ce7de4d4b16f465684907a45d2b114da Mon Sep 17 00:00:00 2001 From: jerem Date: Mon, 25 Nov 2024 12:14:19 +0100 Subject: [PATCH] feat(openalex): adding an intermediate state --- .../openalex-ror/results/views-selector.jsx | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/client/src/pages/openalex-ror/results/views-selector.jsx b/client/src/pages/openalex-ror/results/views-selector.jsx index 8b7d1ef..08325bf 100644 --- a/client/src/pages/openalex-ror/results/views-selector.jsx +++ b/client/src/pages/openalex-ror/results/views-selector.jsx @@ -2,6 +2,7 @@ import { Badge, Button, Col, Row, Modal, ModalContent, ModalFooter, ModalTitle, + ButtonGroup, } from '@dataesr/dsfr-plus'; import { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; @@ -27,6 +28,10 @@ export default function OpenalexView({ }) { const [searchParams, setSearchParams] = useSearchParams(); const [isModalOpen, setIsModalOpen] = useState(false); + const [selectSortOnNumberOfRors, setSelectSortOnNumberOfRors] = useState('default'); + const [selectShowAffiliations, setSelectShowAffiliations] = useState('all'); + const [selectRorCountry, setSelectRorCountry] = useState('all'); + const [sortsAndFilters, setSortsAndFilters] = useState({ sortOnNumberOfRors: 'default', showAffiliations: 'all', @@ -188,9 +193,9 @@ export default function OpenalexView({ className="fr-select" id="select-sort-on-number-of-rors" onChange={(e) => { - setSortsAndFilters({ ...sortsAndFilters, sortOnNumberOfRors: e.target.value }); + setSelectSortOnNumberOfRors(e.target.value); }} - value={sortsAndFilters.sortOnNumberOfRors} + value={selectSortOnNumberOfRors} > @@ -208,9 +213,9 @@ export default function OpenalexView({ className="fr-select" id="select-show-affiliations" onChange={(e) => { - setSortsAndFilters({ ...sortsAndFilters, showAffiliations: e.target.value }); + setSelectShowAffiliations(e.target.value); }} - value={sortsAndFilters.showAffiliations} + value={selectShowAffiliations} > @@ -225,10 +230,10 @@ export default function OpenalexView({