From 595dc1b1d429b753719667f432911786f6623ed8 Mon Sep 17 00:00:00 2001 From: kevin-lin12 Date: Tue, 31 Oct 2023 15:23:43 -0400 Subject: [PATCH 1/3] Added announce modal for Notifications --- frontend/src/components/Notification/Notification.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Notification/Notification.tsx b/frontend/src/components/Notification/Notification.tsx index 0387e6006..61846a94a 100644 --- a/frontend/src/components/Notification/Notification.tsx +++ b/frontend/src/components/Notification/Notification.tsx @@ -33,6 +33,7 @@ const Notification = () => { const [messages, setMessages] = useState([]); const [notify, setNotify] = useState(false); const popupId = useId(); + const [isNotifOpen, setIsNotifOpen] = useState(false); useEffect(() => { navigator.serviceWorker.addEventListener('message', (event) => { @@ -72,7 +73,7 @@ const Notification = () => { return ( + } + onOpen={() => { + setIsNotifOpen(true); + }} onClose={() => { setMessages([...newMessages, ...messages]); setNewMessages([]); setNotify(false); + setIsNotifOpen(false); }} position={['bottom right']} contentStyle={{ From f67e885eded96883ff8d39dd9b174804fbde14fe Mon Sep 17 00:00:00 2001 From: kevin-lin12 Date: Tue, 31 Oct 2023 15:27:28 -0400 Subject: [PATCH 2/3] Fixed Prettier issue --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci-backend-test.yml | 2 +- frontend/public/index.html | 46 ++++++++++--------- .../components/Notification/Notification.tsx | 6 ++- package.json | 2 +- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 99146e644..d5cf42ac9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,7 +18,7 @@ This pull request is the first step towards implementing feature Foo -### Breaking Changes +### Breaking Changes diff --git a/.github/workflows/ci-backend-test.yml b/.github/workflows/ci-backend-test.yml index e967d3091..c402691cb 100644 --- a/.github/workflows/ci-backend-test.yml +++ b/.github/workflows/ci-backend-test.yml @@ -1,5 +1,5 @@ name: CI Test -on: +on: pull_request: paths: ['server/**'] diff --git a/frontend/public/index.html b/frontend/public/index.html index ec292e23a..d57c9f240 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,18 +1,23 @@ - - - - - - - - - - - - - - Carriage - - - - -
- + Carriage + - \ No newline at end of file + + +
+ + diff --git a/frontend/src/components/Notification/Notification.tsx b/frontend/src/components/Notification/Notification.tsx index 61846a94a..00264df2b 100644 --- a/frontend/src/components/Notification/Notification.tsx +++ b/frontend/src/components/Notification/Notification.tsx @@ -73,7 +73,11 @@ const Notification = () => { return ( +