explorer: remove line breaks from wrapped data (#15379)

This commit is contained in:
Josh 2021-02-17 12:12:49 -08:00 committed by GitHub
parent 480b4e08a9
commit b9fb595db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -1,10 +1,9 @@
import React from "react";
import { TransactionInstruction } from "@solana/web3.js";
import { Address } from "components/common/Address";
import { wrap } from "utils";
export function RawDetails({ ix }: { ix: TransactionInstruction }) {
const data = wrap(ix.data.toString("hex"), 50);
const data = ix.data.toString("hex");
return (
<>
{ix.keys.map(({ pubkey, isSigner, isWritable }, keyIndex) => (
@ -27,7 +26,7 @@ export function RawDetails({ ix }: { ix: TransactionInstruction }) {
<tr>
<td>Instruction Data (Hex)</td>
<td className="text-lg-right">
<pre className="d-inline-block text-left mb-0">{data}</pre>
<pre className="d-inline-block text-left mb-0 data-wrap">{data}</pre>
</td>
</tr>
</>

View File

@ -331,3 +331,12 @@ div.inner-cards {
background: red;
border: 1px solid red;
}
pre.data-wrap {
max-width: 23rem;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}