Skip to content

Commit

Permalink
Do it
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Feb 5, 2024
1 parent 248801a commit 7eb6e11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/utils/anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getProgramName } from '@utils/tx';
import React, { Fragment, ReactNode, useState } from 'react';
import { ChevronDown, ChevronUp, CornerDownRight } from 'react-feather';
import ReactJson from 'react-json-view';
import { HexData } from '../components/common/HexData';

export function getAnchorProgramName(program: Program | null): string | undefined {
return program ? snakeToTitleCase(program.idl.name) : undefined;
Expand Down Expand Up @@ -174,7 +175,7 @@ function mapField(key: string, value: any, type: IdlType, idl: Idl, keySuffix?:
<div>{numberWithSeparator(value.toString())}</div>
</SimpleRow>
);
} else if (type === 'bool' || type === 'bytes' || type === 'string') {
} else if (type === 'bool' || type === 'string') {
return (
<SimpleRow
key={keySuffix ? `${key}-${keySuffix}` : key}
Expand All @@ -186,6 +187,8 @@ function mapField(key: string, value: any, type: IdlType, idl: Idl, keySuffix?:
<div>{value.toString()}</div>
</SimpleRow>
);
} else if (type === 'bytes') {
return <HexData raw={Buffer.from(value)} />
} else if (type === 'publicKey') {
return (
<SimpleRow
Expand Down

0 comments on commit 7eb6e11

Please sign in to comment.