From 86e13b8ce6a1ab8e605b47cdd735a8f189c38c4b Mon Sep 17 00:00:00 2001 From: Hitish Rao P Date: Thu, 12 Sep 2024 21:23:42 +0530 Subject: [PATCH 1/2] fixes Facility cover image edit button malfunctioning --- src/Components/Facility/FacilityHome.tsx | 30 +++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index a0dcf06026f..80bcd5d655f 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -179,23 +179,32 @@ export const FacilityHome = ({ facilityId }: Props) => { } > - {editCoverImageTooltip} +
+ hasPermissionToEditCoverImage && setEditCoverImage(true) + } + > + {editCoverImageTooltip} +
) : (
- hasPermissionToEditCoverImage && setEditCoverImage(true) - } >
)}
{ className={`group relative hidden h-80 w-[88px] text-clip rounded transition-all duration-200 ease-in-out md:mr-2 md:flex lg:mr-6 lg:h-80 lg:w-80 ${ hasPermissionToEditCoverImage && "cursor-pointer" }`} - onClick={() => - hasPermissionToEditCoverImage && setEditCoverImage(true) - } > {hasCoverImage ? ( @@ -228,7 +234,13 @@ export const FacilityHome = ({ facilityId }: Props) => {
)} - {editCoverImageTooltip} +
+ hasPermissionToEditCoverImage && setEditCoverImage(true) + } + > + {editCoverImageTooltip} +
From cf8f5b3dcd50715c721e8090c97ba1b3caff85b8 Mon Sep 17 00:00:00 2001 From: Hitish Rao P Date: Fri, 13 Sep 2024 01:36:06 +0530 Subject: [PATCH 2/2] Removed unnecessary divs --- src/Components/Facility/FacilityHome.tsx | 32 ++++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index 80bcd5d655f..9a594a76751 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -116,7 +116,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
setEditCoverImage(true)} > @@ -179,32 +179,23 @@ export const FacilityHome = ({ facilityId }: Props) => { } > -
- hasPermissionToEditCoverImage && setEditCoverImage(true) - } - > - {editCoverImageTooltip} -
+ {editCoverImageTooltip}
) : (
+ hasPermissionToEditCoverImage && setEditCoverImage(true) + } >
)}
{ className={`group relative hidden h-80 w-[88px] text-clip rounded transition-all duration-200 ease-in-out md:mr-2 md:flex lg:mr-6 lg:h-80 lg:w-80 ${ hasPermissionToEditCoverImage && "cursor-pointer" }`} + onClick={() => + hasPermissionToEditCoverImage && setEditCoverImage(true) + } > {hasCoverImage ? ( @@ -234,13 +228,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
)} -
- hasPermissionToEditCoverImage && setEditCoverImage(true) - } - > - {editCoverImageTooltip} -
+ {editCoverImageTooltip}