From 1a15fc1089f48d559bdd82f7f02a0f1d2ea8d8f2 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 26 Oct 2022 18:28:32 +0200 Subject: [PATCH] change(ui) - notes updates and other changes --- .../Session_/EventsBlock/NoteEvent.tsx | 8 +- .../Player/Controls/components/ReadNote.tsx | 87 ++++++----- .../Session_/components/NotePopup.tsx | 11 +- .../components/Notes/NoteItem.tsx | 22 +-- .../components/Notes/NoteTags.tsx | 4 +- .../components/Notes/TeamBadge.tsx | 4 +- .../SessionHeader/SessionHeader.tsx | 145 +++++++++--------- .../shared/XRayButton/xrayButton.module.css | 2 +- .../app/components/ui/BackLink/BackLink.js | 2 +- .../app/components/ui/ItemMenu/ItemMenu.js | 2 +- frontend/app/mstore/notesStore.ts | 2 +- frontend/app/styles/main.css | 30 ++-- 12 files changed, 165 insertions(+), 154 deletions(-) diff --git a/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx b/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx index 8552d06dc..622d13831 100644 --- a/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx +++ b/frontend/app/components/Session_/EventsBlock/NoteEvent.tsx @@ -73,7 +73,7 @@ function NoteEvent(props: Props) { return (
@@ -83,7 +83,7 @@ function NoteEvent(props: Props) {
-
+
{props.note.message} diff --git a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx index 3123a6377..edc58aa9f 100644 --- a/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/ReadNote.tsx @@ -4,7 +4,7 @@ import { tagProps, Note } from 'App/services/NotesService'; import { formatTimeOrDate } from 'App/date'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; -import { TeamBadge } from 'Shared/SessionListContainer/components/Notes' +import { TeamBadge } from 'Shared/SessionListContainer/components/Notes'; interface Props { userEmail: string; @@ -25,16 +25,18 @@ function ReadNote(props: Props) { style={{ background: '#FFFEF5', width: 400 }} >
-
You do not have access to this note.
Or it’s deleted.
+
+ You do not have access to this note.
Or it’s deleted. +
- + Play Session
@@ -43,51 +45,54 @@ function ReadNote(props: Props) { } return ( -
-
-
-
- -
-
-
{props.userEmail}
-
- {formatTimeOrDate(props.note.createdAt as unknown as number, timezone)} -
-
-
- +
+
+
+
+ +
+
+
{props.userEmail}
+
+ {formatTimeOrDate(props.note.createdAt as unknown as number, timezone)}
-
{props.note.message}
-
-
- {props.note.tag ? ( -
- {props.note.tag} -
- ) : null} - {!props.note.isPublic ? null : ( - - )} - +
+ +
+
+
+ {props.note.message} +
+
+
+ {props.note.tag ? (
- - Play Session + {props.note.tag}
+ ) : null} + {!props.note.isPublic ? null : } + +
+ + Play Session
+
); } diff --git a/frontend/app/components/Session_/components/NotePopup.tsx b/frontend/app/components/Session_/components/NotePopup.tsx index 325eec190..c5c7b7016 100644 --- a/frontend/app/components/Session_/components/NotePopup.tsx +++ b/frontend/app/components/Session_/components/NotePopup.tsx @@ -3,7 +3,7 @@ import { Icon } from 'UI'; import { connectPlayer, pause } from 'Player'; import { connect } from 'react-redux'; import { setCreateNoteTooltip } from 'Duck/sessions'; -import cn from 'classnames' +import cn from 'classnames'; function NotePopup({ setCreateNoteTooltip, @@ -28,13 +28,12 @@ function NotePopup({
- Add note + Add Note
); } diff --git a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx index 548e94f42..60e8c30c2 100644 --- a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx +++ b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteItem.tsx @@ -9,7 +9,7 @@ import { ItemMenu } from 'UI'; import copy from 'copy-to-clipboard'; import { toast } from 'react-toastify'; import { session } from 'App/routes'; -import TeamBadge from './TeamBadge' +import TeamBadge from './TeamBadge'; interface Props { note: Note; @@ -39,11 +39,12 @@ function NoteItem(props: Props) { { icon: 'trash', text: 'Delete', onClick: onDelete }, ]; - const safeStrMessage = props.note.message.length > 150 ? props.note.message.slice(0, 150) + '...' : props.note.message + const safeStrMessage = + props.note.message.length > 150 ? props.note.message.slice(0, 150) + '...' : props.note.message; return (
-
-
{safeStrMessage}
+
+
{safeStrMessage}
{props.note.tag ? (
) : null} -
- By +
+ By {props.userEmail},{' '} {formatTimeOrDate(props.note.createdAt as unknown as number, timezone)} - {!props.note.isPublic ? null : ( - - )} +
+ {!props.note.isPublic ? null : }
diff --git a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx index 4af52d3ae..26e57cc58 100644 --- a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx +++ b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx @@ -34,9 +34,9 @@ function NoteTags() {
))}
- notesStore.toggleShared(value.value === '1')} defaultValue={notesOwner[0].value} /> +
+