fix React import error

pull/5370/head
Joseph Izang 3 years ago
parent d450bad006
commit 2678701dd8
  1. 2
      libs/remix-ui/vertical-icons-panel/src/lib/components/Solidity.tsx
  2. 2
      libs/remix-ui/vertical-icons-panel/src/lib/components/SolidityStaticAnalysis.tsx
  3. 29
      libs/remix-ui/vertical-icons-panel/src/lib/components/Udapp.tsx

@ -1,6 +1,6 @@
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'
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import { Fragment } from 'react' import React, { Fragment } from 'react'
// import Badge from './Badge' // import Badge from './Badge'
import Icon from './Icon' import Icon from './Icon'

@ -1,6 +1,6 @@
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'
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import { Fragment } from 'react' import React, { Fragment } from 'react'
// import Badge from './Badge' // import Badge from './Badge'
import Icon from './Icon' import Icon from './Icon'

@ -1,8 +1,7 @@
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'
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import React, { Fragment, useEffect, useReducer } from 'react' import React, { Fragment } from 'react'
import { iconBadgeReducer, IconBadgeReducerAction } from '../reducers/iconBadgeReducer' import Icon from './Icon'
import Icon, { IconStatus } from './Icon'
interface UdappProps { interface UdappProps {
verticalIconsPlugin: VerticalIcons verticalIconsPlugin: VerticalIcons
@ -11,23 +10,16 @@ interface UdappProps {
removeActive: () => void removeActive: () => void
} }
const initialState = {
text: '',
key: '',
title: '',
type: ''
}
function Udapp ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: UdappProps) { function Udapp ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: UdappProps) {
const [badgeStatus, dispatchStatusUpdate] = useReducer(iconBadgeReducer, initialState) // const [badgeStatus, dispatchStatusUpdate] = useReducer(iconBadgeReducer, initialState)
useEffect(() => { // useEffect(() => {
verticalIconsPlugin.on('udapp', 'statusChanged', (iconStatus: IconStatus) => { // verticalIconsPlugin.on('udapp', 'statusChanged', (iconStatus: IconStatus) => {
iconStatus.pluginName = 'udapp' // iconStatus.pluginName = 'udapp'
const action: IconBadgeReducerAction = { type: 'udapp', payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin } } // const action: IconBadgeReducerAction = { type: 'udapp', payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin } }
dispatchStatusUpdate(action) // dispatchStatusUpdate(action)
}) // })
}, []) // }, [])
return ( return (
<Fragment> <Fragment>
@ -49,7 +41,6 @@ function Udapp ({ verticalIconsPlugin, itemContextAction, addActive, removeActiv
key={ key={
verticalIconsPlugin.targetProfileForChange[p].displayName verticalIconsPlugin.targetProfileForChange[p].displayName
} }
badgeStatus={badgeStatus}
/> />
</div> </div>
)) ))

Loading…
Cancel
Save