Fix explorer static copy (#5185)

This commit is contained in:
Jaco 2021-05-01 15:03:43 +03:00 committed by GitHub
parent e69c178405
commit b5b9157f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions

View File

@ -108,35 +108,31 @@ function Call ({ children, className = '', labelHash, labelSignature, mortality,
<Static
className='hash'
label={labelSignature || t<string>('signature {{type}}', { replace: { type: signatureType ? `(${signatureType})` : '' } })}
value={signature}
withCopy
>
{signature}
</Static>
/>
)}
{hash && (
<Static
className='hash'
label={labelHash || t<string>('extrinsic hash')}
value={hash}
withCopy
>
{hash}
</Static>
/>
)}
{mortality && (
<Static
className='mortality'
label={t<string>('lifetime')}
>
{mortality}
</Static>
value={mortality}
/>
)}
{tip?.gtn(0) && (
<Static
className='tip'
label={t<string>('tip')}
>
<FormatBalance value={tip} />
</Static>
value={<FormatBalance value={tip} />}
/>
)}
</div>
</div>

View File

@ -9,7 +9,7 @@ import Labelled from './Labelled';
interface Props {
children?: React.ReactNode;
className?: string;
defaultValue?: any;
defaultValue?: unknown;
help?: React.ReactNode;
isDisabled?: boolean;
isError?: boolean;
@ -38,7 +38,7 @@ function Static ({ children, className = '', defaultValue, help, isFull, isHidde
{children}
</div>
{withCopy && (
<CopyButton value={value} />
<CopyButton value={value || defaultValue} />
)}
</Labelled>
);