From 19d5fff56a973939657f0c77852d8b068de3db76 Mon Sep 17 00:00:00 2001 From: VialsShiny Date: Sun, 30 Nov 2025 23:48:51 +0100 Subject: [PATCH 1/2] Adding Verification Like --- frontend/src/components/ui/ActionButtonsPost.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ui/ActionButtonsPost.jsx b/frontend/src/components/ui/ActionButtonsPost.jsx index 6560f42..3e65aa1 100644 --- a/frontend/src/components/ui/ActionButtonsPost.jsx +++ b/frontend/src/components/ui/ActionButtonsPost.jsx @@ -1,3 +1,5 @@ +import {useAuth} from '../../providers/AuthProviders'; + export default function ActionButtonsPost({ classDefault, classFocus, @@ -9,9 +11,14 @@ export default function ActionButtonsPost({ onOpenComments, }) { const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1); + const {currentUser} = useAuth(); const handleClick = (label) => { if (label === 'comment') { - if (onOpenComments) {onOpenComments();} + if (onOpenComments) { + onOpenComments(); + } + } else if (label === 'like') { + if (currentUser) setAction((prev) => !prev); } else { setAction((prev) => !prev); } From 88aba2a6d42f2f4a834b09845df887a721353831 Mon Sep 17 00:00:00 2001 From: VialsShiny Date: Sun, 30 Nov 2025 23:50:34 +0100 Subject: [PATCH 2/2] Esling Fix --- frontend/src/components/ui/ActionButtonsPost.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/ui/ActionButtonsPost.jsx b/frontend/src/components/ui/ActionButtonsPost.jsx index 3e65aa1..09d5d03 100644 --- a/frontend/src/components/ui/ActionButtonsPost.jsx +++ b/frontend/src/components/ui/ActionButtonsPost.jsx @@ -1,4 +1,4 @@ -import {useAuth} from '../../providers/AuthProviders'; +import { useAuth } from '../../providers/AuthProviders'; export default function ActionButtonsPost({ classDefault, @@ -11,14 +11,16 @@ export default function ActionButtonsPost({ onOpenComments, }) { const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1); - const {currentUser} = useAuth(); + const { currentUser } = useAuth(); const handleClick = (label) => { if (label === 'comment') { if (onOpenComments) { onOpenComments(); } } else if (label === 'like') { - if (currentUser) setAction((prev) => !prev); + if (currentUser) { + setAction((prev) => !prev); + } } else { setAction((prev) => !prev); }