1- import { FC , ReactElement , Ref , cloneElement , useCallback , useLayoutEffect , useRef , useState } from 'react'
1+ import { FC , ReactElement , Ref , useCallback , useLayoutEffect , useRef , useState } from 'react'
22import { TFunction } from 'i18next'
33import { useTranslation } from 'react-i18next'
44import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
5- import AccountBalanceIcon from '@mui/icons-material/AccountBalance'
6- import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'
7- import { ArrowRight } from 'lucide-react'
8- import DnsIcon from '@mui/icons-material/Dns'
9- import ExitToAppIcon from '@mui/icons-material/ExitToApp'
10- import HowToVoteIcon from '@mui/icons-material/HowToVote'
11- import LibraryAddCheckIcon from '@mui/icons-material/LibraryAddCheck'
12- import MiscellaneousServicesIcon from '@mui/icons-material/MiscellaneousServices'
13- import PersonIcon from '@mui/icons-material/Person'
14- import PriceChangeIcon from '@mui/icons-material/PriceChange'
15- import QuestionMarkIcon from '@mui/icons-material/QuestionMark'
5+ import {
6+ ArrowRight ,
7+ ArrowDown ,
8+ CircleHelp ,
9+ UserRound ,
10+ Banknote ,
11+ CopyCheck ,
12+ LogOut ,
13+ Landmark ,
14+ } from 'lucide-react'
1615import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
1716import { ConsensusTxMethod , GetConsensusTransactionsParams } from '../../../oasis-nexus/api'
1817import { COLORS } from '../../../styles/theme/colors'
1918import { exhaustedTypeWarning } from '../../../types/errors'
2019import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
20+ import { Dns } from '../MuiIcons/Dns'
21+ import { MiscellaneousServices } from '../MuiIcons/MiscellaneousServices'
22+ import { CastVote } from '../MuiIcons/CastVote'
2123
2224type MethodIconProps = {
2325 border ?: boolean
@@ -48,8 +50,6 @@ const colorMap = {
4850 } ,
4951}
5052
51- const iconRatio = 0.75
52-
5353export const MethodIcon : FC < MethodIconProps > = props => {
5454 const { label, reverseLabel, truncate } = props
5555 const enableTruncate = truncate && label && ! reverseLabel
@@ -67,7 +67,6 @@ type MethodIconContentProps = MethodIconProps & {
6767}
6868
6969const MethodIconContent : FC < MethodIconContentProps > = ( {
70- border = true ,
7170 color = 'blue' ,
7271 icon,
7372 label,
@@ -86,15 +85,10 @@ const MethodIconContent: FC<MethodIconContentProps> = ({
8685 < div
8786 className = "flex items-center justify-center"
8887 style = { {
89- width : size ,
90- minWidth : size ,
91- height : size ,
92- borderRadius : size ,
9388 color : theme . primary ,
94- border : border ? `2px solid ${ theme . primary } ` : 'none' ,
9589 } }
9690 >
97- { cloneElement ( icon , { style : { fontSize : Math . ceil ( size * iconRatio ) } } ) }
91+ { icon }
9892 </ div >
9993 { label && (
10094 < Typography
@@ -293,35 +287,35 @@ const getConsensusTransactionMethod = (
293287 case ConsensusTxMethod . stakingTransfer :
294288 return < MethodIcon color = "green" icon = { < ArrowRight /> } label = { label } { ...props } />
295289 case ConsensusTxMethod . stakingAddEscrow :
296- return < MethodIcon color = "green" icon = { < ExitToAppIcon /> } label = { label } { ...props } />
290+ return < MethodIcon color = "green" icon = { < LogOut /> } label = { label } { ...props } />
297291 case ConsensusTxMethod . stakingReclaimEscrow :
298- return < MethodIcon icon = { < ExitToAppIcon /> } label = { label } { ...props } />
292+ return < MethodIcon icon = { < LogOut /> } label = { label } { ...props } />
299293 case ConsensusTxMethod . stakingAmendCommissionSchedule :
300- return < MethodIcon icon = { < PriceChangeIcon /> } label = { label } { ...props } />
294+ return < MethodIcon icon = { < Banknote /> } label = { label } { ...props } />
301295 case ConsensusTxMethod . stakingAllow :
302- return < MethodIcon icon = { < LibraryAddCheckIcon /> } label = { label } { ...props } />
296+ return < MethodIcon icon = { < CopyCheck /> } label = { label } { ...props } />
303297 case ConsensusTxMethod . stakingWithdraw :
304- return < MethodIcon color = "green" icon = { < ArrowDownwardIcon /> } label = { label } { ...props } />
298+ return < MethodIcon color = "green" icon = { < ArrowDown /> } label = { label } { ...props } />
305299 case ConsensusTxMethod . roothashExecutorCommit :
306- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
300+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
307301 case ConsensusTxMethod . roothashExecutorProposerTimeout :
308- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
302+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
309303 case ConsensusTxMethod . registryRegisterEntity :
310- return < MethodIcon icon = { < PersonIcon /> } label = { label } { ...props } />
304+ return < MethodIcon icon = { < UserRound /> } label = { label } { ...props } />
311305 case ConsensusTxMethod . registryRegisterNode :
312- return < MethodIcon icon = { < DnsIcon /> } label = { label } { ...props } />
306+ return < MethodIcon icon = { < Dns /> } label = { label } { ...props } />
313307 case ConsensusTxMethod . registryRegisterRuntime :
314- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
308+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
315309 case ConsensusTxMethod . governanceCastVote :
316- return < MethodIcon icon = { < HowToVoteIcon /> } label = { label } { ...props } />
310+ return < MethodIcon icon = { < CastVote /> } label = { label } { ...props } />
317311 case ConsensusTxMethod . governanceSubmitProposal :
318- return < MethodIcon icon = { < AccountBalanceIcon /> } label = { label } { ...props } />
312+ return < MethodIcon icon = { < Landmark /> } label = { label } { ...props } />
319313 case ConsensusTxMethod . beaconPVSSCommit :
320- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
314+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
321315 case ConsensusTxMethod . beaconPVSSReveal :
322- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
316+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
323317 case ConsensusTxMethod . beaconVRFProve :
324- return < MethodIcon icon = { < MiscellaneousServicesIcon /> } label = { label } { ...props } />
318+ return < MethodIcon icon = { < MiscellaneousServices /> } label = { label } { ...props } />
325319 case ConsensusTxMethod [ 'keymanager/churpApply' ] : // TODO: provide dedicated icon
326320 case ConsensusTxMethod [ 'keymanager/churpConfirm' ] : // TODO: provide dedicated icon
327321 case ConsensusTxMethod [ 'keymanager/churpCreate' ] : // TODO: provide dedicated icon
@@ -340,10 +334,10 @@ const getConsensusTransactionMethod = (
340334 case ConsensusTxMethod . consensusMeta : // TODO: provide dedicated icon
341335 case ConsensusTxMethod . stakingBurn : // TODO: provide dedicated icon
342336 case undefined :
343- return < MethodIcon color = "gray" icon = { < QuestionMarkIcon /> } label = { label } { ...props } />
337+ return < MethodIcon color = "gray" icon = { < CircleHelp /> } label = { label } { ...props } />
344338 default :
345339 exhaustedTypeWarning ( 'Unexpected consensus transaction method' , method )
346- return < MethodIcon color = "gray" icon = { < QuestionMarkIcon /> } label = { label } { ...props } />
340+ return < MethodIcon color = "gray" icon = { < CircleHelp /> } label = { label } { ...props } />
347341 }
348342}
349343
0 commit comments