import React, { useEffect, useState } from 'react'; import stl from './xrayButton.module.css'; import cn from 'classnames'; import { Popup } from 'UI'; import { Tooltip } from 'react-tippy'; import { Controls as Player } from 'Player'; interface Props { onClick?: () => void; isActive?: boolean; } function XRayButton(props: Props) { const { isActive } = props; const [showGuide, setShowGuide] = useState(!localStorage.getItem('featureViewed')); useEffect(() => { Player.pause(); }, []); const onClick = () => { setShowGuide(false); localStorage.setItem('featureViewed', 'true'); props.onClick(); }; return ( <> {showGuide && (
)}
{showGuide ? (
) : ( )}
); } export default XRayButton; function GuidePopup({ children }: any) { return (
Introducing{' '} X-Ray
Get a quick overview on the issues in this session.
} distance={30} theme={'light'} open={true} arrow={true} > {children}
); }