From fc91140488e14fae919349675f456194954f53bf Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 17 Nov 2023 22:20:06 -0300 Subject: [PATCH] Card design changed --- .../src/components/cardComponent/index.tsx | 88 ++++--------------- src/frontend/src/utils/styleUtils.ts | 4 + 2 files changed, 22 insertions(+), 70 deletions(-) diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index 6eb4c3943..dfe09f9ee 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -5,8 +5,7 @@ import { StoreContext } from "../../contexts/storeContext"; import { getComponent, postLikeComponent } from "../../controllers/API"; import { storeComponent } from "../../types/store"; import cloneFLowWithParent from "../../utils/storeUtils"; -import { gradients } from "../../utils/styleUtils"; -import { classNames } from "../../utils/utils"; +import { cn } from "../../utils/utils"; import ShadTooltip from "../ShadTooltipComponent"; import IconComponent from "../genericIconComponent"; import { Badge } from "../ui/badge"; @@ -121,7 +120,7 @@ export default function CollectionCardComponent({ return (
-
-
- {data.is_component ? ( - - - - - - - - - - ) : ( - - )} -
-
+ name={data.is_component ? "ToyBrick" : "Group"} + />
{data.name}
@@ -205,10 +153,7 @@ export default function CollectionCardComponent({ )} - + {likes_count ?? 0} @@ -232,7 +177,7 @@ export default function CollectionCardComponent({
{data.user_created && data.user_created.username && ( - + by {data.user_created.username} )} @@ -274,13 +219,16 @@ export default function CollectionCardComponent({ (!authorized ? " cursor-not-allowed" : "") } onClick={() => { + if (!authorized) { + return; + } handleLike(); }} >