|
|
|
@ -30,8 +30,10 @@ const RemixUiVerticalIconsPanel = ({ |
|
|
|
|
const iconPanelRef = useRef<any>() |
|
|
|
|
const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer, initialState) |
|
|
|
|
const [theme, setTheme] = useState<string>('dark') |
|
|
|
|
useEffect(() => { |
|
|
|
|
const evaluateScrollability = (evt: any) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const evaluateScrollability = () => { |
|
|
|
|
dispatchScrollAction({ |
|
|
|
|
type: 'resize', |
|
|
|
|
payload: { |
|
|
|
@ -41,11 +43,19 @@ const RemixUiVerticalIconsPanel = ({ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
addEventListener('resize', evaluateScrollability) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
window.addEventListener('resize', evaluateScrollability) |
|
|
|
|
evaluateScrollability() |
|
|
|
|
return () => { |
|
|
|
|
removeEventListener('resize', evaluateScrollability) |
|
|
|
|
window.removeEventListener('resize', evaluateScrollability) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
evaluateScrollability() |
|
|
|
|
},[icons, theme]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
verticalIconsPlugin.call('theme', 'currentTheme').then((th: any) => { |
|
|
|
|
setTheme(th.quality) |
|
|
|
|