From c4bc71dd178be3e2ffd66efa4dfd4ef7fc3fe080 Mon Sep 17 00:00:00 2001 From: sylenien Date: Mon, 3 Oct 2022 11:05:20 +0200 Subject: [PATCH] change(ui): add not found modal --- frontend/app/components/Session/WebPlayer.js | 17 ++++----- .../Player/Controls/components/ReadNote.tsx | 36 ++++++++++++++++++- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/frontend/app/components/Session/WebPlayer.js b/frontend/app/components/Session/WebPlayer.js index 9ddf3c403..026aa93ab 100644 --- a/frontend/app/components/Session/WebPlayer.js +++ b/frontend/app/components/Session/WebPlayer.js @@ -110,15 +110,16 @@ function WebPlayer(props) { {showNoteModal ? ( m.id === noteItem.userId)?.email || noteItem.userId} - timestamp={noteItem.timestamp} - tags={noteItem.tags} - isPublic={noteItem.isPublic} - message={noteItem.message} - sessionId={noteItem.sessionId} - date={noteItem.createdAt} - noteId={noteItem.noteId} + userEmail={props.members.find(m => m.id === noteItem?.userId)?.email || ''} + timestamp={noteItem?.timestamp} + tags={noteItem?.tags} + isPublic={noteItem?.isPublic} + message={noteItem?.message} + sessionId={noteItem?.sessionId} + date={noteItem?.createdAt} + noteId={noteItem?.noteId} onClose={onNoteClose} + notFound={!noteItem} /> ) : null} diff --git a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx index be47c561e..3a7e5ce6a 100644 --- a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx @@ -15,12 +15,38 @@ interface Props { date: string; noteId: number; onClose: () => void; + notFound?: boolean; } function ReadNote(props: Props) { const { settingsStore } = useStore(); const { timezone } = settingsStore.sessionSettings; + if (props.notFound) { + return ( +
+
+
+
You do not have access to this note.
Or it’s deleted.
+
+ +
+
+
+ + Play Session +
+
+
+ ); + } + return (
{props.message}
-
+
{props.tags.length ? (
@@ -61,6 +87,14 @@ function ReadNote(props: Props) { Team )} + +
+ + Play Session +