From 4f6b9223ec51dbfac9bb89ef7afa570308351b6e Mon Sep 17 00:00:00 2001 From: frontend perkafean <165241731+frontendperkafean@users.noreply.github.com> Date: Sat, 28 Sep 2024 08:42:17 +0000 Subject: [PATCH] ok mantab --- src/App.js | 7 +++++++ src/components/ButtonWithReplica.css | 1 + src/components/ButtonWithReplica.js | 4 ++-- src/pages/Transactions.module.css | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 134907a..53de8e7 100644 --- a/src/App.js +++ b/src/App.js @@ -235,6 +235,13 @@ function App() { socket.on("transaction_created", async (data) => { console.log("transaction notification"); setModal("new_transaction", data); + + navigator.serviceWorker.ready.then((registration) => { + registration.showNotification("New Transaction", { + body: `A new transaction was created: ${data.transactionDetails}`, // Customize as needed + icon: "icon.png", // Optional icon + }); + }); }); socket.on("checkUserTokenRes", async (data) => { diff --git a/src/components/ButtonWithReplica.css b/src/components/ButtonWithReplica.css index ce6980f..9ce255d 100644 --- a/src/components/ButtonWithReplica.css +++ b/src/components/ButtonWithReplica.css @@ -46,4 +46,5 @@ top: 30%; z-index: 200; border-radius: 0px; + background-color: white; } diff --git a/src/components/ButtonWithReplica.js b/src/components/ButtonWithReplica.js index dbaa995..65465a4 100644 --- a/src/components/ButtonWithReplica.js +++ b/src/components/ButtonWithReplica.js @@ -7,8 +7,8 @@ const ButtonWithReplica = ({ children }) => { const handleClick = () => { setIsActive(true); setTimeout(() => { - setIsActive(false); - }, 1000); // Duration of the animation + // setIsActive(false); + }, 10000); // Duration of the animation }; return ( diff --git a/src/pages/Transactions.module.css b/src/pages/Transactions.module.css index 5f31e34..0da794b 100644 --- a/src/pages/Transactions.module.css +++ b/src/pages/Transactions.module.css @@ -1,5 +1,5 @@ .Transactions { - overflow-x: auto; + overflow-x: hidden; height: 100%; background-color: white; display: flex;