Files
jitsi-meet/react/features/base/tooltip/components/TooltipWrapper.js
Mihai-Andrei Uscat b69e93a900 fix(Safari): Fix mobile double tapping for toolbar and overflow.
* Create generic tooltip wrapper for mobile usability.
* Change overflow menu icon/font/padding sizes.
* Change overflow drawer expand icon.
2021-02-04 15:24:25 +02:00

51 lines
891 B
JavaScript

// @flow
import Tooltip from '@atlaskit/tooltip';
import React from 'react';
import { isMobileBrowser } from '../../environment/utils';
type Props = {
/**
* Children of the component.
*/
children: React$Node,
/**
* The text to be displayed in the tooltip.
*/
content?: string | null,
/**
* The position of the tooltip relative to the element it contains.
*/
position?: string
}
/**
* Wrapper of AtlasKit Tooltip that doesn't render the actual tooltip in mobile browsers.
*
* @returns {ReactElement}
*/
function TooltipWrapper({
children,
content,
position
}: Props) {
if (isMobileBrowser()) {
return children;
}
return (
<Tooltip
content = { content }
position = { position }>
{children}
</Tooltip>
);
}
export default TooltipWrapper;