Adjust preimage hash styling (#8308)

* Adjust preimage hash styling

* Fix preimage retrieval

* Adjust

* Remove debug log
This commit is contained in:
Jaco 2022-11-11 10:41:36 +02:00 committed by GitHub
parent 61cb03663a
commit be919f5353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View File

@ -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{

View File

@ -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;
}
}
`);

View File

@ -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 {