fix linting errors

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

@ -4,14 +4,14 @@ export type actionType = {
payload: any
}
export function verticalScrollReducer(prevState: any, actionPayload: actionType) {
export function verticalScrollReducer (prevState: any, actionPayload: actionType) {
if (actionPayload.type === 'resize') {
actionPayload.payload.scrollHeight > actionPayload.payload.clientHeight
// 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
// actionPayload.payload.scrollHeight > actionPayload.payload.clientHeight
}
return prevState
}
}

@ -32,19 +32,19 @@ export function RemixUiVerticalIconsPanel ({
}: RemixUiVerticalIconsPanelProps) {
const scrollableRef = useRef<any>()
const iconPanelRef = useRef<any>()
const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer,initialState)
const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer, initialState)
useEffect(() => {
const evaluateScrollability = (evt: any) => {
console.log('resize event answered by dispatch!')
dispatchScrollAction({
type: 'resize',
payload: {
scrollHeight: document.querySelector('#remixuiScrollable')?.scrollHeight,
clientHeight: document.querySelector('#remixuiScrollable')?.clientHeight,
scrollState: false
}
})
type: 'resize',
payload: {
scrollHeight: document.querySelector('#remixuiScrollable')?.scrollHeight,
clientHeight: document.querySelector('#remixuiScrollable')?.clientHeight,
scrollState: false
}
})
}
addEventListener('resize', evaluateScrollability)
@ -54,7 +54,7 @@ export function RemixUiVerticalIconsPanel ({
})
useEffect(() => {
addEventListener('activate', () => console.log('activate called now'))
addEventListener('activate', () => console.log('activate called now'))
})
function onThemeChanged (themeType: any) {

Loading…
Cancel
Save