1- import { Tooltip , chakra } from '@chakra-ui/react' ;
1+ import { Tooltip , Image , chakra } from '@chakra-ui/react' ;
22import BigNumber from 'bignumber.js' ;
33import React from 'react' ;
44
@@ -9,6 +9,8 @@ import type {
99 TxInterpretationVariableString ,
1010} from 'types/api/txInterpretation' ;
1111
12+ import { route } from 'nextjs-routes' ;
13+
1214import config from 'configs/app' ;
1315import dayjs from 'lib/date/dayjs' ;
1416import * as mixpanel from 'lib/mixpanel/index' ;
@@ -19,6 +21,8 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
1921import EnsEntity from 'ui/shared/entities/ens/EnsEntity' ;
2022import TokenEntity from 'ui/shared/entities/token/TokenEntity' ;
2123import IconSvg from 'ui/shared/IconSvg' ;
24+ import LinkExternal from 'ui/shared/links/LinkExternal' ;
25+ import LinkInternal from 'ui/shared/links/LinkInternal' ;
2226
2327import {
2428 extractVariables ,
@@ -121,6 +125,9 @@ const TxInterpretationElementByType = (
121125 case 'timestamp' : {
122126 return < chakra . span color = "text_secondary" whiteSpace = "pre" > { dayjs ( Number ( value ) * 1000 ) . format ( 'MMM DD YYYY' ) } </ chakra . span > ;
123127 }
128+ case 'external_link' : {
129+ return < LinkExternal href = { value . link } > { value . name } </ LinkExternal > ;
130+ }
124131 case 'method' : {
125132 return (
126133 < Tag
@@ -134,6 +141,35 @@ const TxInterpretationElementByType = (
134141 </ Tag >
135142 ) ;
136143 }
144+ case 'dexTag' : {
145+ const icon = value . app_icon || value . icon ;
146+ const name = ( ( ) => {
147+ if ( value . app_id && config . features . marketplace . isEnabled ) {
148+ return (
149+ < LinkInternal
150+ href = { route ( { pathname : '/apps/[id]' , query : { id : value . app_id } } ) }
151+ >
152+ { value . name }
153+ </ LinkInternal >
154+ ) ;
155+ }
156+ if ( value . url ) {
157+ return (
158+ < LinkExternal href = { value . url } >
159+ { value . name }
160+ </ LinkExternal >
161+ ) ;
162+ }
163+ return value . name ;
164+ } ) ( ) ;
165+
166+ return (
167+ < chakra . span display = "inline-flex" alignItems = "center" verticalAlign = "top" _notFirst = { { marginLeft : 1 } } gap = { 1 } >
168+ { icon && < Image src = { icon } alt = { value . name } width = { 5 } height = { 5 } /> }
169+ { name }
170+ </ chakra . span >
171+ ) ;
172+ }
137173 }
138174} ;
139175
0 commit comments