Adjust preimage hash styling (#8308)
* Adjust preimage hash styling * Fix preimage retrieval * Adjust * Remove debug log
This commit is contained in:
parent
61cb03663a
commit
be919f5353
@ -138,7 +138,7 @@ export default React.memo(styled(PreImage)`
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.disabledLook input {
|
||||
.disabledLook .ui.input > input {
|
||||
background: transparent;
|
||||
border-style: dashed;
|
||||
&:focus{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/types';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Button, Extrinsic, Input, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components';
|
||||
import { useApi, useToggle } from '@polkadot/react-hooks';
|
||||
@ -128,4 +129,13 @@ function Add ({ className, imageHash }: Props): React.ReactElement<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Add);
|
||||
export default React.memo(styled(Add)`
|
||||
.disabledLook .ui.input > input {
|
||||
background: transparent;
|
||||
border-style: dashed;
|
||||
&:focus{
|
||||
background: transparent;
|
||||
border-color: #d9d8d7;
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
@ -64,13 +64,13 @@ export function getPreimageHash (hashOrBounded: Hash | HexString | FrameSupportP
|
||||
|
||||
const bounded = hashOrBounded as FrameSupportPreimagesBounded;
|
||||
|
||||
return bounded.isBasic
|
||||
? bounded.isInline
|
||||
? bounded.asInline.hash.toHex()
|
||||
: bounded.isLegacy
|
||||
? bounded.asLegacy.hash_.toHex()
|
||||
: bounded.asLookup.hash_.toHex()
|
||||
: (hashOrBounded as Hash).toHex();
|
||||
return bounded.isInline
|
||||
? bounded.asInline.hash.toHex()
|
||||
: bounded.isLegacy
|
||||
? bounded.asLegacy.hash_.toHex()
|
||||
: bounded.isLookup
|
||||
? bounded.asLookup.hash_.toHex()
|
||||
: hashOrBounded.toHex();
|
||||
}
|
||||
|
||||
function usePreimageImpl (hashOrBounded: Hash | HexString | FrameSupportPreimagesBounded): Preimage | undefined {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user