mirror of https://github.com/trezor/trezor-wallet
commit
53f7a8ecef
@ -0,0 +1,70 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import RcTooltip from 'rc-tooltip';
|
||||||
|
import colors from 'config/colors';
|
||||||
|
import Link from 'components/Link';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
const Wrapper = styled.div``;
|
||||||
|
|
||||||
|
const Content = styled.div`
|
||||||
|
max-width: ${props => `${props.maxWidth}px` || 'auto'};
|
||||||
|
`;
|
||||||
|
|
||||||
|
const ContentWrapper = styled.div`
|
||||||
|
display: block;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const ReadMore = styled.div`
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 10px 0 5px 0;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
color: ${colors.WHITE};
|
||||||
|
border-top: 1px solid ${colors.TEXT_SECONDARY};
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Tooltip = ({
|
||||||
|
maxWidth,
|
||||||
|
className,
|
||||||
|
placement,
|
||||||
|
content,
|
||||||
|
readMoreLink,
|
||||||
|
children,
|
||||||
|
}) => (
|
||||||
|
<Wrapper className={className}>
|
||||||
|
<RcTooltip
|
||||||
|
arrowContent={<div className="rc-tooltip-arrow-inner" />}
|
||||||
|
placement={placement}
|
||||||
|
overlay={() => (
|
||||||
|
<ContentWrapper>
|
||||||
|
<Content maxWidth={maxWidth}>{content}</Content>
|
||||||
|
{readMoreLink && (
|
||||||
|
<Link href={readMoreLink}>
|
||||||
|
<ReadMore>Read more</ReadMore>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</ContentWrapper>)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</RcTooltip>
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
|
||||||
|
Tooltip.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
placement: PropTypes.string,
|
||||||
|
children: PropTypes.oneOfType([
|
||||||
|
PropTypes.element,
|
||||||
|
PropTypes.string,
|
||||||
|
]),
|
||||||
|
maxWidth: PropTypes.number,
|
||||||
|
content: PropTypes.oneOfType([
|
||||||
|
PropTypes.element,
|
||||||
|
PropTypes.string,
|
||||||
|
]),
|
||||||
|
readMoreLink: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Tooltip;
|
@ -0,0 +1,37 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
import { H2 } from 'components/Heading';
|
||||||
|
import Button from 'components/Button';
|
||||||
|
import Paragraph from 'components/Paragraph';
|
||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
const Wrapper = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Row = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledParagraph = styled(Paragraph)`
|
||||||
|
margin: 10px 50px;
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Seedless = () => (
|
||||||
|
<Wrapper>
|
||||||
|
<Row>
|
||||||
|
<H2>Device is in seedless mode</H2>
|
||||||
|
<StyledParagraph>It's not suitable to use this service.</StyledParagraph>
|
||||||
|
</Row>
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default connect(null, null)(Seedless);
|
Loading…
Reference in new issue