From 1586733f83420f5e13b2ce3a6dab34b020062b88 Mon Sep 17 00:00:00 2001 From: JaneMoroz Date: Thu, 29 Aug 2024 21:58:47 +0300 Subject: [PATCH] fix: fix ResourceItem and ResourceCard title issue --- .../voyage-dashboard/ResourceItem.tsx | 25 ++++++--------- .../components/ResourceCard.tsx | 32 +++++++++---------- src/components/IconButton.tsx | 2 +- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/src/app/(main)/dashboard/components/voyage-dashboard/ResourceItem.tsx b/src/app/(main)/dashboard/components/voyage-dashboard/ResourceItem.tsx index c18dc60d..84f9e109 100644 --- a/src/app/(main)/dashboard/components/voyage-dashboard/ResourceItem.tsx +++ b/src/app/(main)/dashboard/components/voyage-dashboard/ResourceItem.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useState } from "react"; +import React from "react"; import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/solid"; import Badge from "@/components/badge/Badge"; import { useAppDispatch } from "@/store/hooks"; @@ -21,7 +21,6 @@ function ResourceItem({ userAvatarUrl, }: ResourceItemProps) { const dispatch = useAppDispatch(); - const [widgetHovered, setWidgetHovered] = useState(false); const openViewModal = (event: React.MouseEvent) => { event.stopPropagation(); @@ -40,17 +39,15 @@ function ResourceItem({ }; return ( -
setWidgetHovered(true)} - onMouseLeave={() => setWidgetHovered(false)} > -
-

- {title} -

+
+

{title}

Shared by

- -
+ + ); } diff --git a/src/app/(main)/my-voyage/[teamId]/voyage-resources/components/ResourceCard.tsx b/src/app/(main)/my-voyage/[teamId]/voyage-resources/components/ResourceCard.tsx index 87e57366..a490fac0 100644 --- a/src/app/(main)/my-voyage/[teamId]/voyage-resources/components/ResourceCard.tsx +++ b/src/app/(main)/my-voyage/[teamId]/voyage-resources/components/ResourceCard.tsx @@ -64,34 +64,34 @@ export default function ResourceCard({ }; return ( -
- + +
+

{title}

+
+

Shared by

-
-
Added {date}
+
Added {date}
- {userId === currentUserId ? ( + {userId === currentUserId && ( - + - ) : null} + )}
); } diff --git a/src/components/IconButton.tsx b/src/components/IconButton.tsx index a50da63b..a3f97200 100644 --- a/src/components/IconButton.tsx +++ b/src/components/IconButton.tsx @@ -16,7 +16,7 @@ export default function IconButton({