scroll parameters now dependent on state

pull/1831/head^2
Joseph Izang 3 years ago committed by yann300
parent 7a7b211aad
commit f005b222fe
  1. 8
      libs/remix-ui/vertical-icons-panel/src/lib/reducers/verticalScrollReducer.ts
  2. 8
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -6,12 +6,10 @@ export type actionType = {
export function verticalScrollReducer (prevState: any, actionPayload: actionType) {
if (actionPayload.type === 'resize') {
// actionPayload.payload.scrollHeight > actionPayload.payload.clientHeight
console.log(`values being checked are ${actionPayload.payload.scrollHeight} > ${actionPayload.payload.clientHeight}`)
const newvals = actionPayload.payload
return { ...newvals }
} else if (actionPayload.type === 'other') {
// actionPayload.payload.scrollHeight > actionPayload.payload.clientHeight
let { scrollHeight, clientHeight, scrollState } = actionPayload.payload
if (scrollHeight > clientHeight) scrollState = true
return { scrollHeight, clientHeight, scrollState }
}
return prevState
}

@ -53,10 +53,6 @@ export function RemixUiVerticalIconsPanel ({
}
})
useEffect(() => {
addEventListener('activate', () => console.log('activate called now'))
})
function onThemeChanged (themeType: any) {
const invert = themeType === 'dark' ? 1 : 0
// @ts-ignore
@ -132,7 +128,7 @@ export function RemixUiVerticalIconsPanel ({
<div className="remixui_icons d-flex flex-column vh-100" ref={iconPanelRef}>
<Home verticalIconPlugin={verticalIconsPlugin} />
<div className={scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight
? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}>
? 'remixui_default-icons-container remixui_requiredSection' : activateScroll && activateScroll.scrollState ? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}>
<RequiredSection
verticalIconsPlugin={verticalIconsPlugin}
addActive={addActive}
@ -145,7 +141,7 @@ export function RemixUiVerticalIconsPanel ({
id="remixuiScrollable"
className={scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight
? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'
: 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'}
: activateScroll && activateScroll.scrollState ? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll' : 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'}
ref={scrollableRef}
>
<OtherIcons

Loading…
Cancel
Save