From 2d0a44dcea26b7c3ac68c1f0892a06bc39e6c988 Mon Sep 17 00:00:00 2001 From: Hanbyul Jo Date: Thu, 5 Oct 2023 16:44:49 -0400 Subject: [PATCH] Add styles to make panel scrollable --- .../components/datasets/s-explore/index.tsx | 124 +++++++++++------- app/scripts/styles/panel.tsx | 1 + 2 files changed, 79 insertions(+), 46 deletions(-) diff --git a/app/scripts/components/datasets/s-explore/index.tsx b/app/scripts/components/datasets/s-explore/index.tsx index 31fca123f..e7a5a42e4 100644 --- a/app/scripts/components/datasets/s-explore/index.tsx +++ b/app/scripts/components/datasets/s-explore/index.tsx @@ -100,7 +100,6 @@ const DatesWrapper = styled.div` position: relative; z-index: 10; box-shadow: 0 1px 0 0 ${themeVal('color.base-100a')}; - > ${PanelWidget} { width: 100%; position: relative; @@ -109,6 +108,34 @@ const DatesWrapper = styled.div` } `; +const PositionPlaceHoderForScroll = styled.div` + position: absolute; + pointer-events: none; + z-index: 1000; + top: 0px; + left: 0px; + width: 1.5rem; + height: 100%; + background: linear-gradient( + to left, + rgba(255, 255, 255, 0) 0%, + rgb(255, 255, 255) 100% + ); +`; + +const ScrollArea = styled.div` + position: relative; + overflow: hidden; + width: 100%; + height: 100%; +`; + +const ScrollAreaInner = styled.div` + position: absolute; + inset: 0px; + overflow: scroll; +`; + const isSelectedDateValid = (dateList, selectedDate) => { if (dateList) { // Since the available dates changes, check if the currently selected @@ -557,7 +584,7 @@ function DatasetsExplore() { }} hideFooter /> - + @@ -587,52 +614,57 @@ function DatasetsExplore() { - - {activeLayerTimeseries && ( - - {activeLayerCompareTimeseries && ( - setIsComparing((v) => !v)} + + + + + {activeLayerTimeseries && ( + - Toggle date comparison - + {activeLayerCompareTimeseries && ( + setIsComparing((v) => !v)} + > + Toggle date comparison + + )} + + )} + {isComparing && activeLayerCompareTimeseries && ( + )} - - )} - {isComparing && activeLayerCompareTimeseries && ( - - )} - - - - Layers - - - - - + + + + Layers + + + + + + + diff --git a/app/scripts/styles/panel.tsx b/app/scripts/styles/panel.tsx index 43081cdff..f2cef62ab 100644 --- a/app/scripts/styles/panel.tsx +++ b/app/scripts/styles/panel.tsx @@ -105,6 +105,7 @@ export const PanelBody = styled.div` display: flex; flex-direction: column; flex-grow: 1; + position:relative; > div > div:nth-child(2), > div > div:nth-child(3) {