1- import { Grid , GridItem , Flex } from '@chakra-ui/react' ;
1+ import { Box , Grid , GridItem , Flex } from '@chakra-ui/react' ;
22import React from 'react' ;
33
44import type { Log } from 'types/api/log' ;
@@ -7,7 +7,6 @@ import { route } from 'nextjs-routes';
77
88import { space } from 'lib/html-entities' ;
99import { Alert } from 'toolkit/chakra/alert' ;
10- import { useColorModeValue } from 'toolkit/chakra/color-mode' ;
1110import { Link } from 'toolkit/chakra/link' ;
1211import { Skeleton } from 'toolkit/chakra/skeleton' ;
1312import { Tooltip } from 'toolkit/chakra/tooltip' ;
@@ -56,46 +55,80 @@ const RowHeader = ({ children, isLoading, tooltip }: { children: React.ReactNode
5655 < GridItem
5756 _notFirst = { { mt : { base : 4 , lg : 0 } } }
5857 display = "flex"
59- alignItems = { { base : 'flex-start' , lg : 'flex-start ' } }
60- pt = { { base : 0 , lg : 1 } }
58+ alignItems = { { base : 'flex-start' , lg : 'center ' } }
59+ py = { { base : 0 , lg : 2 } }
6160 >
62- < Flex alignItems = "center" gap = { 1 } >
63- < Skeleton fontWeight = { 500 } loading = { isLoading } > { children } </ Skeleton >
61+ < Flex
62+ alignItems = "center"
63+ gap = { 2 }
64+ px = { 3 }
65+ py = { 1.5 }
66+ borderRadius = "md"
67+ bgColor = { { _light : 'blackAlpha.50' , _dark : 'whiteAlpha.50' } }
68+ >
69+ < Skeleton
70+ fontWeight = { 600 }
71+ fontSize = "sm"
72+ color = { { _light : 'gray.700' , _dark : 'gray.200' } }
73+ loading = { isLoading }
74+ textTransform = "uppercase"
75+ letterSpacing = "0.02em"
76+ >
77+ { children }
78+ </ Skeleton >
6479 { tooltip && ! isLoading && (
6580 < Tooltip content = { tooltip } >
66- < IconSvg
67- name = "info"
68- boxSize = { 4 }
69- color = "icon.info"
81+ < Box
82+ as = "span"
83+ display = "inline-flex"
84+ alignItems = "center"
85+ justifyContent = "center"
7086 cursor = "pointer"
71- flexShrink = { 0 }
72- />
87+ transition = "all 0.2s ease"
88+ _hover = { { transform : 'scale(1.1)' } }
89+ >
90+ < IconSvg
91+ name = "info"
92+ boxSize = { 3.5 }
93+ color = { { _light : 'gray.500' , _dark : 'gray.400' } }
94+ _hover = { { color : { _light : 'blue.500' , _dark : 'blue.300' } } }
95+ flexShrink = { 0 }
96+ />
97+ </ Box >
7398 </ Tooltip >
7499 ) }
75100 </ Flex >
76101 </ GridItem >
77102) ;
78103
79104const SettlementInferenceItem = ( { type, address, decoded, isLoading } : Props ) => {
80- const borderColor = useColorModeValue ( 'blackAlpha.200' , 'whiteAlpha.200' ) ;
81-
82105 const renderGridItems = ( ) => {
83106 return (
84107 < >
85108 { decoded ?. parameters && decoded . parameters . length > 0 && (
86109 < >
87110 { decoded . parameters . map ( ( param , index ) => {
88- const fieldName = param . name || `Parameter ${ index + 1 } ` ;
89- const displayName = param . name ? formatFieldName ( param . name ) : fieldName ;
111+ const displayName = param . name ? formatFieldName ( param . name ) : `Parameter ${ index + 1 } ` ;
90112 const tooltip = param . name ? fieldDescriptions [ param . name ] : undefined ;
91113
92114 return (
93115 < React . Fragment key = { param . name || index } >
94116 < RowHeader isLoading = { isLoading } tooltip = { tooltip } >
95117 { displayName }
96118 </ RowHeader >
97- < GridItem >
98- < InferenceOutput value = { param . value } isLoading = { isLoading } />
119+ < GridItem
120+ display = "flex"
121+ alignItems = "center"
122+ py = { 2 }
123+ >
124+ < Box
125+ w = "100%"
126+ fontSize = "sm"
127+ fontFamily = "mono"
128+ color = { { _light : 'gray.800' , _dark : 'gray.100' } }
129+ >
130+ < InferenceOutput value = { param . value } isLoading = { isLoading } />
131+ </ Box >
99132 </ GridItem >
100133 </ React . Fragment >
101134 ) ;
@@ -108,7 +141,7 @@ const SettlementInferenceItem = ({ type, address, decoded, isLoading }: Props) =
108141 < RowHeader isLoading = { isLoading } >
109142 Output
110143 </ RowHeader >
111- < GridItem >
144+ < GridItem py = { 2 } >
112145 < Alert status = "warning" display = "inline-table" whiteSpace = "normal" >
113146 To see accurate decoded input data, the contract must be verified.{ space }
114147 < Link href = { route ( { pathname : '/address/[hash]/contract-verification' , query : { hash : address . hash } } ) } > Verify the contract here</ Link >
@@ -122,7 +155,7 @@ const SettlementInferenceItem = ({ type, address, decoded, isLoading }: Props) =
122155 < RowHeader isLoading = { isLoading } >
123156 Data
124157 </ RowHeader >
125- < GridItem >
158+ < GridItem py = { 2 } >
126159 < VStackContainer >
127160 < Item isLoading = { isLoading } isCode >
128161 { JSON . stringify ( decoded , null , 2 ) }
@@ -136,21 +169,29 @@ const SettlementInferenceItem = ({ type, address, decoded, isLoading }: Props) =
136169 } ;
137170
138171 return (
139- < Grid
140- gridTemplateColumns = { { base : 'minmax(0, 1fr)' , lg : '200px minmax(0, 1fr)' } }
141- gap = { { base : 2 , lg : 8 } }
142- py = { 8 }
143- alignItems = { { base : 'flex-start' , lg : 'flex-start' } }
144- _notFirst = { {
145- borderTopWidth : '1px' ,
146- borderTopColor : borderColor ,
172+ < Box
173+ p = { { base : 4 , lg : 6 } }
174+ borderRadius = "xl"
175+ bgColor = { { _light : 'rgba(255, 255, 255, 0.6)' , _dark : 'rgba(255, 255, 255, 0.03)' } }
176+ border = "1px solid"
177+ borderColor = { { _light : 'gray.100' , _dark : 'whiteAlpha.100' } }
178+ transition = "all 0.2s ease"
179+ _hover = { {
180+ borderColor : { _light : 'gray.200' , _dark : 'whiteAlpha.200' } ,
181+ boxShadow : { _light : '0 4px 12px rgba(0, 0, 0, 0.05)' , _dark : '0 4px 12px rgba(0, 0, 0, 0.2)' } ,
147182 } }
148- _first = { {
149- pt : 0 ,
183+ _notFirst = { {
184+ mt : 4 ,
150185 } }
151186 >
152- { renderGridItems ( ) }
153- </ Grid >
187+ < Grid
188+ gridTemplateColumns = { { base : 'minmax(0, 1fr)' , lg : '180px minmax(0, 1fr)' } }
189+ gap = { { base : 3 , lg : 6 } }
190+ alignItems = { { base : 'flex-start' , lg : 'center' } }
191+ >
192+ { renderGridItems ( ) }
193+ </ Grid >
194+ </ Box >
154195 ) ;
155196} ;
156197
0 commit comments