mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
894 B
37 lines
894 B
6 years ago
|
import React from 'react';
|
||
|
import RcTooltip from 'rc-tooltip';
|
||
|
import styled from 'styled-components';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import { FONT_SIZE } from 'config/variables';
|
||
|
|
||
|
const TooltipContent = styled.div`
|
||
|
width: ${props => (props.isAside ? '260px' : '320px')};
|
||
|
font-size: ${FONT_SIZE.SMALLEST};
|
||
|
`;
|
||
|
|
||
|
const Tooltip = ({
|
||
|
content, placement = 'bottomRight', children,
|
||
|
}) => (
|
||
|
<RcTooltip
|
||
|
arrowContent={<div className="rc-tooltip-arrow-inner" />}
|
||
|
placement={placement}
|
||
|
overlay={<TooltipContent>{content}</TooltipContent>}
|
||
|
>
|
||
|
{children}
|
||
|
</RcTooltip>
|
||
|
);
|
||
|
|
||
|
Tooltip.propTypes = {
|
||
|
placement: PropTypes.string,
|
||
|
children: PropTypes.oneOfType([
|
||
|
PropTypes.element,
|
||
|
PropTypes.string,
|
||
|
]),
|
||
|
content: PropTypes.oneOfType([
|
||
|
PropTypes.element,
|
||
|
PropTypes.string,
|
||
|
]),
|
||
|
};
|
||
|
|
||
|
export default Tooltip;
|