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

@ -1,6 +1,6 @@
import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel'
// eslint-disable-next-line no-use-before-define
import { Fragment } from 'react'
import React, { Fragment } from 'react'
// import Badge from './Badge'
import Icon from './Icon'

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

Loading…
Cancel
Save