diff --git a/frontend/app/components/Session_/components/NotePopup.tsx b/frontend/app/components/Session_/components/NotePopup.tsx index 7b3ad24c6..7c5ea49f4 100644 --- a/frontend/app/components/Session_/components/NotePopup.tsx +++ b/frontend/app/components/Session_/components/NotePopup.tsx @@ -3,6 +3,7 @@ import { Button } from 'UI'; import { connectPlayer, pause } from 'Player'; import { connect } from 'react-redux'; import { setCreateNoteTooltip } from 'Duck/sessions'; +import GuidePopup, { FEATURE_KEYS } from 'Shared/GuidePopup'; function NotePopup({ setCreateNoteTooltip, @@ -24,9 +25,18 @@ function NotePopup({ }, []); return ( - + + Introducing Notes + + } + description={'Annotate session replays and share your feedback with the rest of your team.'} + > + + ); } @@ -36,7 +46,7 @@ const NotePopupPl = connectPlayer( )(React.memo(NotePopup)); const NotePopupComp = connect( - (state) => ({ tooltipActive: state.getIn(['sessions', 'createNoteTooltip', 'isVisible']) }), + (state: any) => ({ tooltipActive: state.getIn(['sessions', 'createNoteTooltip', 'isVisible']) }), { setCreateNoteTooltip } )(NotePopupPl); diff --git a/frontend/app/components/shared/GuidePopup/GuidePopup.tsx b/frontend/app/components/shared/GuidePopup/GuidePopup.tsx index 014c4321d..5eec8fc19 100644 --- a/frontend/app/components/shared/GuidePopup/GuidePopup.tsx +++ b/frontend/app/components/shared/GuidePopup/GuidePopup.tsx @@ -1,37 +1,71 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; +import { Controls as Player } from 'Player'; import { Tooltip } from 'UI'; +import { INDEXES } from 'App/constants/zindex'; export const FEATURE_KEYS = { - XRAY: 'featureViewed' -} + XRAY: 'featureViewed', + NOTES: 'notesFeatureViewed', +}; interface IProps { - children: React.ReactNode - title: React.ReactNode - description: React.ReactNode - key?: keyof typeof FEATURE_KEYS + children?: React.ReactNode; + title: React.ReactNode; + description: React.ReactNode; + key?: keyof typeof FEATURE_KEYS; } export default function GuidePopup({ children, title, description }: IProps) { - return ( - // @ts-ignore - -
- {title} + const [showGuide, setShowGuide] = useState(!localStorage.getItem(FEATURE_KEYS.NOTES)); + useEffect(() => { + if (!showGuide) { + return; + } + Player.pause(); + }, []); + + const onClick = () => { + setShowGuide(false); + localStorage.setItem(FEATURE_KEYS.NOTES, 'true'); + }; + + return showGuide ? ( +
+
+ +
{title}
+
{description}
+
-
- {description} + } + open={true} + > +
+
+ {children}
+
- } - // distance={30} - // theme={'light'} - open={true} - // arrow={true} - > - {children} - + +
+ ) : ( + children ); } diff --git a/frontend/app/components/shared/XRayButton/XRayButton.tsx b/frontend/app/components/shared/XRayButton/XRayButton.tsx index 6a2a73dd7..98368da21 100644 --- a/frontend/app/components/shared/XRayButton/XRayButton.tsx +++ b/frontend/app/components/shared/XRayButton/XRayButton.tsx @@ -39,10 +39,10 @@ function XRayButton(props: Props) { )}
{showGuide ? ( - Introducing X-Ray} - description={"Get a quick overview on the issues in this session."} - > + // Introducing X-Ray
} + // description={"Get a quick overview on the issues in this session."} + // > -
- + //
+ // ) : (