2020-10-05 00:30:28 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
2020-11-30 08:24:22 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-10-05 00:30:28 +03:00
|
|
|
|
|
|
|
const STYLES_TOOLTIP = `
|
|
|
|
font-family: ${Constants.font.text};
|
|
|
|
font-size: ${Constants.typescale.lvl0};
|
|
|
|
border-radius: 4px;
|
|
|
|
padding: 8px 12px;
|
|
|
|
-webkit-backdrop-filter: blur(25px);
|
|
|
|
backdrop-filter: blur(25px);
|
|
|
|
line-height: 1.2;
|
|
|
|
transition: 100ms ease all;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_TOOLTIP_LIGHT = css`
|
|
|
|
${STYLES_TOOLTIP}
|
|
|
|
background-color: rgba(248, 248, 248, 0.6);
|
|
|
|
color: #4b4a4d;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_TOOLTIP_DARK = css`
|
|
|
|
${STYLES_TOOLTIP}
|
|
|
|
background-color: rgba(0, 0, 0, 0.75);
|
|
|
|
color: ${Constants.system.white};
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const Tooltip = (props) => {
|
|
|
|
return (
|
|
|
|
<div style={{ maxWidth: 400 }}>
|
2020-11-04 20:55:48 +03:00
|
|
|
<span css={props.light ? STYLES_TOOLTIP_LIGHT : STYLES_TOOLTIP_DARK} style={props.style}>
|
2020-10-05 00:30:28 +03:00
|
|
|
{props.children}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|