mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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 {
|
.snap-insight {
|
||||||
word-wrap: break-word;
|
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}
|
{key}
|
||||||
</Typography>
|
</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>
|
</div>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user