1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-06-26 09:52:36 +00:00

Fix prop validation error

This commit is contained in:
Vasek Mlejnsky 2018-09-20 10:14:38 +02:00
parent fab3d601c6
commit 8208245e1b

View File

@ -48,9 +48,13 @@ const TransactionIcon = styled.div`
text-transform: uppercase; text-transform: uppercase;
user-select: none; user-select: none;
text-align: center; text-align: center;
color: ${props => props.color}; color: ${props => props.textColor};
background: ${props => props.background}; background: ${props => props.background};
border-color: ${props => props.borderColor}; border-color: ${props => props.borderColor};
&:before {
content: ${props => props.color};
}
`; `;
const P = styled.p``; const P = styled.p``;
@ -70,9 +74,9 @@ class PendingTransactions extends Component<Props> {
getTransactionIconColors(tx: any) { getTransactionIconColors(tx: any) {
let iconColors = { let iconColors = {
color: '', textColor: '#fff',
background: '', background: '#000',
borderColor: '', borderColor: '#000',
}; };
const bgColorFactory = new ColorHash({ lightness: 0.7 }); const bgColorFactory = new ColorHash({ lightness: 0.7 });
const textColorFactory = new ColorHash(); const textColorFactory = new ColorHash();
@ -84,21 +88,21 @@ class PendingTransactions extends Component<Props> {
if (!token) { if (!token) {
iconColors = { iconColors = {
color: '#ffffff', textColor: '#ffffff',
background: '#000000', background: '#000000',
borderColor: '#000000', borderColor: '#000000',
}; };
} else { } else {
const bgColor: string = bgColorFactory.hex(token.name); const bgColor: string = bgColorFactory.hex(token.name);
iconColors = { iconColors = {
color: textColorFactory.hex(token.name), textColor: textColorFactory.hex(token.name),
background: bgColor, background: bgColor,
borderColor: bgColor, borderColor: bgColor,
}; };
} }
} else { } else {
iconColors = { iconColors = {
color: textColorFactory.hex(tx.network), textColor: textColorFactory.hex(tx.network),
background: bgColorFactory.hex(tx.network), background: bgColorFactory.hex(tx.network),
borderColor: bgColorFactory.hex(tx.network), borderColor: bgColorFactory.hex(tx.network),
}; };
@ -139,7 +143,7 @@ class PendingTransactions extends Component<Props> {
key={tx.id} key={tx.id}
> >
<TransactionIcon <TransactionIcon
color={() => this.getTransactionIconColors(tx).color} textColor={() => this.getTransactionIconColors(tx).textColor}
background={() => this.getTransactionIconColors(tx).background} background={() => this.getTransactionIconColors(tx).background}
borderColor={() => this.getTransactionIconColors(tx).borderColor} borderColor={() => this.getTransactionIconColors(tx).borderColor}
> >