From e0c9e7a8e36e53eed5c8c9c17473baef135f897c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Sat, 16 Oct 2021 20:18:35 +0100 Subject: [PATCH] refactor chevron to its own component to address buggy behaviour --- .../src/lib/components/Chevron.tsx | 18 ++++++++++++++++ .../src/lib/remix-ui-vertical-icons-panel.css | 9 ++++++-- .../src/lib/remix-ui-vertical-icons-panel.tsx | 21 ++++++++++--------- 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx new file mode 100644 index 0000000000..c3c5c472ba --- /dev/null +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx @@ -0,0 +1,18 @@ +/* eslint-disable no-use-before-define */ +import React, { MutableRefObject } from 'react' + +export interface ChevronProps { + divElementRef: MutableRefObject + cssRule: string +} + +function Chevron (props: ChevronProps) { + return ( + <> + { props.divElementRef.current && props.divElementRef.current.scrollHeight > props.divElementRef.current.clientHeight + ? : null } + + ) +} + +export { Chevron } diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css index d2c2856318..c4339942e1 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css @@ -83,7 +83,7 @@ -ms-overflow-style: none; } .remixui_scrollable-container { - max-height: 570px; + height: 540px; /* border-bottom: 3px solid #3f4455; */ } .remixui_scrollbar::-webkit-scrollbar { /* Chrome, Safari and other Webkit browsers*/ @@ -100,7 +100,12 @@ } .remixui_settings { - min-height: 30px; + height: 30px; + } + + .remixui_requiredSection { + min-height: 180px; + max-height: 330px; } #menuitems { diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx index 407168cc2d..192e6eaee0 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx @@ -14,6 +14,7 @@ import { VerticalIcons } from '../../types/vertical-icons-panel' import Home from './components/Home' import Icon from './components/Icon' import Settings from './components/Settings' +import { Chevron } from './components/Chevron' export interface RemixUiVerticalIconsPanelProps { verticalIconsPlugin: VerticalIcons } @@ -90,7 +91,7 @@ export function RemixUiVerticalIconsPanel ({ }, []) useEffect(() => { - const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp') + // const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp') if (verticalIconsPlugin.targetProfileForChange && verticalIconsPlugin.targetProfileForChange.udapp) { const doWalkThroughEvent = new Event('doWalkThrough') document.dispatchEvent(doWalkThroughEvent) @@ -100,7 +101,7 @@ export function RemixUiVerticalIconsPanel ({ return (
-
+
{verticalIconsPlugin.targetProfileForChange && Object.keys(verticalIconsPlugin.targetProfileForChange).length @@ -309,10 +310,10 @@ export function RemixUiVerticalIconsPanel ({ } /> ))} - {scrollableRef.current && scrollableRef.current!.scrollHeight > scrollableRef.current!.clientHeight - ? - : null - } +
- {scrollableRef.current && scrollableRef.current!.scrollHeight > scrollableRef.current!.clientHeight - ? - : null - } + {Object.keys(verticalIconsPlugin.targetProfileForChange) .filter(p => p === 'settings') .map(p => (