diff --git a/js/app/dashboard/components/App.js b/js/app/dashboard/components/App.js new file mode 100644 index 0000000000..2a22faf877 --- /dev/null +++ b/js/app/dashboard/components/App.js @@ -0,0 +1,81 @@ +import React, { createRef } from "react" + +import Split from 'react-split' +import { Rnd } from 'react-rnd' + +import FiltersModalContent from './FiltersModalContent' +import RightPanel from './RightPanel' +import LeafletMap from './LeafletMap' +import Navbar from './Navbar' +import Modals from './Modals' +import { useDispatch } from "react-redux" +import { updateRightPanelSize } from "../redux/actions" +import { useSelector } from "react-redux" + +const App = ({ loadingAnim }) => { + + const mapRef = createRef() + const dispatch = useDispatch() + const showFiltersPanel = useSelector(state => state.filtersModalIsOpen) + + const saveFilterPanelSize = ({ref}) => { + localStorage.setItem('cpccl__dshbd__fltrs__size', JSON.stringify({width: ref.style.width, height: ref.style.height})) + } + const saveFilterPanelPosition = ({d}) => { + // FIXME : I don't really get what x, y values from the "d" variable are indicating... position is not saved correctly between page loads + localStorage.setItem('cpccl__dshbd__fltrs__position', JSON.stringify({x: d.x, y: d.y})) + } + + const initialFilterPanelSize = {width: 1000, height: 510} + // const initialFilterPanelPosition = {x: 0, y: 0,...JSON.parse(localStorage.getItem('cpccl__dshbd__fltrs__position'))} + const initialFilterPanelPosition = {x: 0, y: 0} + + return ( + <> +