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.
48 lines
914 B
48 lines
914 B
import type { ReactNode } from 'react'
|
|
import { Fragment } from 'react'
|
|
|
|
import styled from 'styled-components/macro'
|
|
|
|
import { devices } from 'config'
|
|
|
|
import { TooltipBlockWrapper } from 'features/UserFavorites/TooltipBlock/styled'
|
|
import { T9n } from 'features/T9n'
|
|
|
|
export const TooltipWrapper = styled(TooltipBlockWrapper)`
|
|
position: absolute;
|
|
top: calc(100% + 8px);
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
padding: 8px 12px;
|
|
font-weight: normal;
|
|
font-size: 14px;
|
|
line-height: 18px;
|
|
text-align: center;
|
|
display: none;
|
|
|
|
@media ${devices.tablet} {
|
|
top: calc(100% + 16px);
|
|
}
|
|
|
|
&::before {
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
}
|
|
`
|
|
|
|
type Props = {
|
|
children: ReactNode,
|
|
lexic: string,
|
|
}
|
|
|
|
export const Tooltip = ({
|
|
children,
|
|
lexic,
|
|
}: Props) => (
|
|
<Fragment>
|
|
<TooltipWrapper top={0}>
|
|
<T9n t={lexic} />
|
|
</TooltipWrapper>
|
|
{children}
|
|
</Fragment>
|
|
)
|
|
|