|
|
@ -4,7 +4,8 @@ import React, { |
|
|
|
Fragment, |
|
|
|
Fragment, |
|
|
|
useEffect, |
|
|
|
useEffect, |
|
|
|
useReducer, |
|
|
|
useReducer, |
|
|
|
useRef |
|
|
|
useRef, |
|
|
|
|
|
|
|
useState |
|
|
|
} from 'react' |
|
|
|
} from 'react' |
|
|
|
|
|
|
|
|
|
|
|
import './remix-ui-vertical-icons-panel.css' |
|
|
|
import './remix-ui-vertical-icons-panel.css' |
|
|
@ -24,7 +25,7 @@ export function RemixUiVerticalIconsPanel ({ |
|
|
|
}: RemixUiVerticalIconsPanelProps) { |
|
|
|
}: RemixUiVerticalIconsPanelProps) { |
|
|
|
const scrollableRef = useRef<any>() |
|
|
|
const scrollableRef = useRef<any>() |
|
|
|
const iconPanelRef = useRef<any>() |
|
|
|
const iconPanelRef = useRef<any>() |
|
|
|
const udappPanelRef = useRef<any>() |
|
|
|
// const [first] = useState(localStorage.getItem('firstTime'))
|
|
|
|
|
|
|
|
|
|
|
|
function onThemeChanged (themeType: any) { |
|
|
|
function onThemeChanged (themeType: any) { |
|
|
|
const invert = themeType === 'dark' ? 1 : 0 |
|
|
|
const invert = themeType === 'dark' ? 1 : 0 |
|
|
@ -90,12 +91,11 @@ export function RemixUiVerticalIconsPanel ({ |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp') |
|
|
|
const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp') |
|
|
|
if (found) { |
|
|
|
if (verticalIconsPlugin.targetProfileForChange && verticalIconsPlugin.targetProfileForChange.udapp) { |
|
|
|
console.log('emit event now as vertical panel is in the viewport', found) |
|
|
|
|
|
|
|
const doWalkThroughEvent = new Event('doWalkThrough') |
|
|
|
const doWalkThroughEvent = new Event('doWalkThrough') |
|
|
|
document.dispatchEvent(doWalkThroughEvent) |
|
|
|
document.dispatchEvent(doWalkThroughEvent) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, [Object.keys(verticalIconsPlugin.targetProfileForChange).length]) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div id="iconsP" className="h-100"> |
|
|
|
<div id="iconsP" className="h-100"> |
|
|
@ -178,7 +178,7 @@ export function RemixUiVerticalIconsPanel ({ |
|
|
|
.map(p => ( |
|
|
|
.map(p => ( |
|
|
|
<div id="runIcons" data-id="verticalIconsKindUdapp" key={ |
|
|
|
<div id="runIcons" data-id="verticalIconsKindUdapp" key={ |
|
|
|
verticalIconsPlugin.targetProfileForChange[p].displayName |
|
|
|
verticalIconsPlugin.targetProfileForChange[p].displayName |
|
|
|
} ref={udappPanelRef} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
<Icon |
|
|
|
<Icon |
|
|
|
kind={verticalIconsPlugin.targetProfileForChange[p].kind} |
|
|
|
kind={verticalIconsPlugin.targetProfileForChange[p].kind} |
|
|
|