All icon theme per chain (#155)

This commit is contained in:
Jaco Greeff
2019-09-19 11:04:44 +02:00
committed by GitHub
parent caa9245ce3
commit d51182e884
7 changed files with 16 additions and 5 deletions
@@ -22,7 +22,6 @@ interface Props {
className?: string;
name?: React.ReactNode | null;
genesisHash?: string | null;
theme?: 'polkadot' | 'substrate';
}
// find an account in our list
@@ -51,7 +50,7 @@ function recodeAddress (address: string, accounts: AccountJson[], genesisHash?:
];
}
function Address ({ address, children, className, genesisHash, name, theme = 'polkadot' }: Props): React.ReactElement<Props> {
function Address ({ address, children, className, genesisHash, name }: Props): React.ReactElement<Props> {
const accounts = useContext(AccountContext);
const [account, setAccount] = useState<AccountJson | null>(null);
const [chain, setChain] = useState<Chain | null>(null);
@@ -69,6 +68,8 @@ function Address ({ address, children, className, genesisHash, name, theme = 'po
setAccount(account);
}, [address]);
const theme = ((chain && chain.icon) || 'polkadot') as 'polkadot';
return (
<IconBox
banner={chain && chain.genesisHash && chain.name}