cleanup commented out code and redundancies

pull/5370/head
Joseph Izang 3 years ago
parent 2678701dd8
commit 7ee74ad821
  1. 26
      libs/remix-ui/vertical-icons-panel/src/lib/components/Debugger.tsx
  2. 27
      libs/remix-ui/vertical-icons-panel/src/lib/components/OtherIcons.tsx
  3. 12
      libs/remix-ui/vertical-icons-panel/src/lib/components/Solidity.tsx
  4. 9
      libs/remix-ui/vertical-icons-panel/src/lib/components/SolidityStaticAnalysis.tsx
  5. 10
      libs/remix-ui/vertical-icons-panel/src/lib/components/Udapp.tsx

@ -1,9 +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 Badge from './Badge'
import Icon, { IconStatus } from './Icon'
import React, { Fragment } from 'react'
import Icon from './Icon'
interface DebuggerProps {
verticalIconsPlugin: VerticalIcons
@ -12,24 +10,7 @@ interface DebuggerProps {
removeActive: () => void
}
const initialState = {
text: '',
key: '',
title: '',
type: ''
}
function Debugger ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: DebuggerProps) {
const [badgeStatus, dispatchStatusUpdate] = useReducer(iconBadgeReducer, initialState)
useEffect(() => {
verticalIconsPlugin.on('debugger', 'statusChanged', (iconStatus: IconStatus) => {
iconStatus.pluginName = 'debugger'
const action: IconBadgeReducerAction = { type: 'debugger', payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin } }
dispatchStatusUpdate(action)
})
}, [])
return (
<Fragment>
{verticalIconsPlugin.targetProfileForChange &&
@ -50,9 +31,6 @@ function Debugger ({ verticalIconsPlugin, itemContextAction, addActive, removeAc
verticalIconsPlugin.targetProfileForChange[p].displayName
}
/>
<Badge
badgeStatus={badgeStatus}
/>
</div>
))
: null}

@ -1,9 +1,8 @@
/* eslint-disable no-use-before-define */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel'
import React, { useEffect, useReducer } from 'react'
import { iconBadgeReducer, IconBadgeReducerAction } from '../reducers/iconBadgeReducer'
import Icon, { IconStatus } from './Icon'
import React from 'react'
import Icon from './Icon'
function customFilter (p: string) {
if (p !== 'settings' && p !== 'pluginManager' &&
@ -19,29 +18,7 @@ interface OtherIconsProps {
removeActive: () => void
}
// const initialState = {
// text: '',
// key: '',
// title: '',
// type: '',
// pluginName: ''
// }
function OtherIcons ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: OtherIconsProps) {
// useEffect(() => {
// Object.keys(verticalIconsPlugin.targetProfileForChange)
// .filter(customFilter)
// .forEach(p =>
// verticalIconsPlugin.on(verticalIconsPlugin.targetProfileForChange[p].name, 'statusChanged', (iconStatus: IconStatus) => {
// iconStatus.pluginName = verticalIconsPlugin.targetProfileForChange[p].name
// const action: IconBadgeReducerAction = {
// type: verticalIconsPlugin.targetProfileForChange[p].name,
// payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin }
// }
// console.log('check the event payload', { iconStatus })
// dispatchStatusUpdate(action)
// }))
// }, [verticalIconsPlugin.targetProfileForChange, Object.keys(verticalIconsPlugin.targetProfileForChange).length])
return (
<div id="otherIcons">
{

@ -1,7 +1,6 @@
import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel'
// eslint-disable-next-line no-use-before-define
import React, { Fragment } from 'react'
// import Badge from './Badge'
import Icon from './Icon'
interface SolidityProps {
@ -11,18 +10,7 @@ interface SolidityProps {
removeActive: () => void
}
// const init = [initialState]
function Solidity ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: SolidityProps) {
// const [badgeStatus, dispatchStatusUpdate] = useReducer(iconBadgeReducer, init)
// useEffect(() => {
// verticalIconsPlugin.on('solidity', 'statusChanged', (iconStatus: IconStatus) => {
// iconStatus.pluginName = 'solidity'
// const action: IconBadgeReducerAction = { type: 'solidity', payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin } }
// dispatchStatusUpdate(action)
// })
// }, [])
return (
<Fragment>
{verticalIconsPlugin.targetProfileForChange &&

@ -1,7 +1,6 @@
import { VerticalIcons } from 'libs/remix-ui/vertical-icons-panel/types/vertical-icons-panel'
// eslint-disable-next-line no-use-before-define
import React, { Fragment } from 'react'
// import Badge from './Badge'
import Icon from './Icon'
interface SolidityStaticAnalysisProps {
@ -12,14 +11,6 @@ interface SolidityStaticAnalysisProps {
}
function SolidityStaticAnalysis ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: SolidityStaticAnalysisProps) {
// const [badgeStatus, dispatchStatusUpdate] = useReducer(iconBadgeReducer, initialState)
// useEffect(() => {
// verticalIconsPlugin.on('solidityStaticAnalysis', 'statusChanged', (iconStatus: IconStatus) => {
// iconStatus.pluginName = 'solidityStaticAnalysis'
// const action: IconBadgeReducerAction = { type: 'solidityStaticAnalysis', payload: { status: iconStatus, verticalIconPlugin: verticalIconsPlugin } }
// dispatchStatusUpdate(action)
// })
// }, [])
return (
<Fragment>
{verticalIconsPlugin.targetProfileForChange &&

@ -11,16 +11,6 @@ interface UdappProps {
}
function Udapp ({ verticalIconsPlugin, itemContextAction, addActive, removeActive }: UdappProps) {
// 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)
// })
// }, [])
return (
<Fragment>
{verticalIconsPlugin.targetProfileForChange &&

Loading…
Cancel
Save