add more fixes to review comments

pull/1671/head
Joseph Izang 3 years ago
parent 39fce3960b
commit 9ec01eb2ae
  1. 11
      libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx
  2. 5
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -1,7 +1,7 @@
/* eslint-disable no-use-before-define */ /* eslint-disable no-use-before-define */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel' import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel'
import React from 'react' import React, { useEffect } from 'react'
import { Chevron } from './Chevron' import { Chevron } from './Chevron'
import Icon from './Icon' import Icon from './Icon'
@ -11,9 +11,16 @@ interface SettingsProps {
addActive: (name: string) => void addActive: (name: string) => void
removeActive: () => void removeActive: () => void
scrollableRef: React.MutableRefObject<any> scrollableRef: React.MutableRefObject<any>
onThemeChanged: (themeType: any) => void
} }
function Settings ({ scrollableRef, verticalIconsPlugin, itemContextAction, addActive, removeActive }: SettingsProps) { function Settings ({ scrollableRef, verticalIconsPlugin, itemContextAction, addActive, removeActive, onThemeChanged }: SettingsProps) {
useEffect(() => {
const themeModule = verticalIconsPlugin.registry.get('themeModule').api
themeModule.events.on('themeChanged', (theme: any) => {
onThemeChanged(theme.quality)
})
}, [onThemeChanged])
return ( return (
<div id="settingsIcons" data-id="vertialIconsSettingsIcons"> <div id="settingsIcons" data-id="vertialIconsSettingsIcons">
<Chevron <Chevron

@ -96,7 +96,7 @@ export function RemixUiVerticalIconsPanel ({
return ( return (
<div id="iconsP" className="h-100"> <div id="iconsP" className="h-100">
<div className="remixui_icons" ref={iconPanelRef}> <div className="remixui_icons" ref={iconPanelRef}>
<div className={scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight <div className={scrollableRef.current && scrollableRef.current.scrollHeight > 500
? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}> ? 'remixui_default-icons-container remixui_requiredSection' : 'remixui_requiredSection'}>
<Home verticalIconPlugin={verticalIconsPlugin} /> <Home verticalIconPlugin={verticalIconsPlugin} />
<RequiredSection <RequiredSection
@ -109,7 +109,7 @@ export function RemixUiVerticalIconsPanel ({
</div> </div>
<div <div
id="remixuiScrollable" id="remixuiScrollable"
className={scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight className={scrollableRef.current && scrollableRef.current.scrollHeight > 500
? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll' ? 'remixui_default-icons-container remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'
: 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'} : 'remixui_scrollable-container remixui_scrollbar remixui_hide-scroll'}
ref={scrollableRef} ref={scrollableRef}
@ -130,6 +130,7 @@ export function RemixUiVerticalIconsPanel ({
removeActive={removeActive} removeActive={removeActive}
itemContextAction={itemContextAction} itemContextAction={itemContextAction}
scrollableRef={scrollableRef} scrollableRef={scrollableRef}
onThemeChanged={onThemeChanged}
/> />
</Fragment> </Fragment>
) : null} ) : null}

Loading…
Cancel
Save