mirror of https://github.com/trezor/trezor-wallet
parent
220e519ecf
commit
a4fdc669bf
@ -1,42 +0,0 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
padding-right: 20px;
|
||||
width: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
`;
|
||||
|
||||
const Logo = styled.img`
|
||||
height: 23px;
|
||||
display: block;
|
||||
`;
|
||||
|
||||
class CoinLogo extends PureComponent {
|
||||
render() {
|
||||
const { network, className, standalone } = this.props;
|
||||
|
||||
const logo = (
|
||||
<Logo
|
||||
className={className}
|
||||
src={require(`images/coins/${network}.png`)} // eslint-disable-line
|
||||
/>
|
||||
);
|
||||
|
||||
if (standalone) {
|
||||
return logo;
|
||||
}
|
||||
|
||||
return <Wrapper className={className}>{logo}</Wrapper>;
|
||||
}
|
||||
}
|
||||
|
||||
CoinLogo.propTypes = {
|
||||
network: PropTypes.string,
|
||||
className: PropTypes.string,
|
||||
standalone: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default CoinLogo;
|
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.6 KiB |
@ -1,32 +0,0 @@
|
||||
/* @flow */
|
||||
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
type Props = {
|
||||
model: string,
|
||||
};
|
||||
|
||||
const Wrapper = styled.div``;
|
||||
|
||||
const Img = styled.img`
|
||||
width: ${props => (props.model === 'T' ? '17px' : '13px')};
|
||||
`;
|
||||
|
||||
const TrezorImage = ({ model }: Props) => {
|
||||
const imageName = model === 'One' ? 1 : model;
|
||||
// $FlowIssue: `require` must be a string literal.
|
||||
const src = require(`./images/trezor-${imageName}.png`); // eslint-disable-line
|
||||
return (
|
||||
<Wrapper>
|
||||
<Img model={model} src={src} />
|
||||
</Wrapper>
|
||||
);
|
||||
};
|
||||
|
||||
TrezorImage.propTypes = {
|
||||
model: PropTypes.string,
|
||||
};
|
||||
|
||||
export default TrezorImage;
|
Loading…
Reference in new issue