From 6f92a4bdc89c296d6fc66c2892ba1c9a98a745dc Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 11 Sep 2023 16:53:08 +0200 Subject: [PATCH] chore: rename to count --- src/components/app/AppLayout.js | 7 ++++--- src/components/app/DetailsPanel.js | 6 +++--- src/components/interpretations/Interpretations.js | 8 +++++--- src/components/interpretations/InterpretationsPanel.js | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/app/AppLayout.js b/src/components/app/AppLayout.js index bbeabc706..21b42a987 100644 --- a/src/components/app/AppLayout.js +++ b/src/components/app/AppLayout.js @@ -16,7 +16,8 @@ import DetailsPanel from './DetailsPanel.js' import styles from './styles/AppLayout.module.css' const AppLayout = () => { - const [interpretationsRenderId, setInterpretationsRenderId] = useState(1) + const [interpretationsRenderCount, setInterpretationsRenderCount] = + useState(1) const dataTableOpen = useSelector((state) => !!state.dataTable) const downloadModeOpen = useSelector( @@ -28,7 +29,7 @@ const AppLayout = () => { const onFileMenuAction = () => detailsPanelOpen && - setInterpretationsRenderId(interpretationsRenderId + 1) + setInterpretationsRenderCount(interpretationsRenderCount + 1) return ( <> @@ -49,7 +50,7 @@ const AppLayout = () => { {!downloadModeOpen && ( )} diff --git a/src/components/app/DetailsPanel.js b/src/components/app/DetailsPanel.js index 82a2f7e4c..ddb88d10e 100644 --- a/src/components/app/DetailsPanel.js +++ b/src/components/app/DetailsPanel.js @@ -6,7 +6,7 @@ import Interpretations from '../interpretations/Interpretations.js' import OrgUnitProfile from '../orgunits/OrgUnitProfile.js' import styles from './styles/DetailsPanel.module.css' -const DetailsPanel = ({ interpretationsRenderId }) => { +const DetailsPanel = ({ interpretationsRenderCount }) => { const detailsPanelOpen = useSelector((state) => state.ui.rightPanelOpen) const viewOrgUnitProfile = useSelector((state) => state.orgUnitProfile) @@ -18,7 +18,7 @@ const DetailsPanel = ({ interpretationsRenderId }) => { return viewOrgUnitProfile ? ( ) : ( - + ) } @@ -34,7 +34,7 @@ const DetailsPanel = ({ interpretationsRenderId }) => { } DetailsPanel.propTypes = { - interpretationsRenderId: PropTypes.number.isRequired, + interpretationsRenderCount: PropTypes.number.isRequired, } export default DetailsPanel diff --git a/src/components/interpretations/Interpretations.js b/src/components/interpretations/Interpretations.js index ff18e4f46..ef7cb361c 100644 --- a/src/components/interpretations/Interpretations.js +++ b/src/components/interpretations/Interpretations.js @@ -6,7 +6,7 @@ import { openInterpretationsPanel } from '../../actions/ui.js' import { getUrlParameter } from '../../util/requests.js' import InterpretationsPanel from './InterpretationsPanel.js' -const Interpretations = ({ renderId }) => { +const Interpretations = ({ renderCount }) => { const isMapLoaded = useSelector( (state) => state.map.id && !state.map.mapViews.find((layer) => !layer.isLoaded) @@ -24,11 +24,13 @@ const Interpretations = ({ renderId }) => { } }, [isMapLoaded, dispatch]) - return isMapLoaded ? : null + return isMapLoaded ? ( + + ) : null } Interpretations.propTypes = { - renderId: PropTypes.number.isRequired, + renderCount: PropTypes.number.isRequired, } export default Interpretations diff --git a/src/components/interpretations/InterpretationsPanel.js b/src/components/interpretations/InterpretationsPanel.js index 17cc762dc..86a4832e0 100644 --- a/src/components/interpretations/InterpretationsPanel.js +++ b/src/components/interpretations/InterpretationsPanel.js @@ -15,7 +15,7 @@ const InterpretationsPanel = ({ interpretationId, map, setInterpretation, - renderId, + renderCount, }) => { const [initialFocus, setInitialFocus] = useState(false) const interpretationsUnitRef = useRef() @@ -41,10 +41,11 @@ const InterpretationsPanel = ({ setInterpretation() }, [setInterpretation]) + console.log('renderCount', renderCount) return ( <> - +