mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 20:02:58 +01:00
[FLASK] Fix transaction insight data display (#16023)
* stringify content to display * check if data is a string to avoid stringifying it * prettify JSON data
This commit is contained in:
parent
3271b812e3
commit
ca6701c27e
@ -1,3 +1,8 @@
|
||||
.snap-insight {
|
||||
word-wrap: break-word;
|
||||
|
||||
&__container__data__json {
|
||||
word-wrap: break-word;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,22 @@ export const SnapInsight = ({ transaction, chainId, selectedSnap }) => {
|
||||
>
|
||||
{key}
|
||||
</Typography>
|
||||
<Typography variant={TYPOGRAPHY.H6}>{data[key]}</Typography>
|
||||
|
||||
{typeof data[key] === 'string' ? (
|
||||
<Typography variant={TYPOGRAPHY.H6}>
|
||||
{data[key]}
|
||||
</Typography>
|
||||
) : (
|
||||
<Box
|
||||
className="snap-insight__container__data__json"
|
||||
backgroundColor={COLORS.BACKGROUND_ALTERNATIVE}
|
||||
padding={3}
|
||||
>
|
||||
<Typography variant={TYPOGRAPHY.H7}>
|
||||
<pre>{JSON.stringify(data[key], null, 2)}</pre>
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user