fix: component seems to be clickable (#2731)

* Changed card to not have shadow on hover if it is a component

* removed unused console.log
This commit is contained in:
Lucas Oliveira 2024-07-16 15:15:07 -03:00 committed by GitHub
commit 643271df40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 18 deletions

View file

@ -43,7 +43,6 @@ export default function CollectionCardComponent({
onDelete,
playground,
control,
is_component,
}: {
data: storeComponent;
authorized?: boolean;
@ -53,7 +52,6 @@ export default function CollectionCardComponent({
playground?: boolean;
onDelete?: () => void;
control?: Control<any, any>;
is_component?: boolean;
}) {
const setSuccessData = useAlertStore((state) => state.setSuccessData);
const setErrorData = useAlertStore((state) => state.setErrorData);
@ -73,7 +71,6 @@ export default function CollectionCardComponent({
const setNodes = useFlowStore((state) => state.setNodes);
const setEdges = useFlowStore((state) => state.setEdges);
const [openPlayground, setOpenPlayground] = useState(false);
const [openDelete, setOpenDelete] = useState(false);
const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId,
);
@ -167,7 +164,9 @@ export default function CollectionCardComponent({
data-testid={`card-${convertTestName(data.name)}`}
//TODO check color schema
className={cn(
"group relative flex h-[11rem] flex-col justify-between overflow-hidden hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#5f5f5f0e]",
"group relative flex h-[11rem] flex-col justify-between overflow-hidden",
!data.is_component &&
"hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#5f5f5f0e]",
disabled ? "pointer-events-none opacity-50" : "",
onClick ? "cursor-pointer" : "",
isSelectedCard ? "border border-selected" : "",
@ -518,18 +517,6 @@ export default function CollectionCardComponent({
<></>
</IOModal>
)}
{openDelete && (
<DeleteConfirmationModal
open={openDelete}
setOpen={setOpenDelete}
onConfirm={() => {
if (onDelete) onDelete();
}}
description={` ${is_component ? "component" : "flow"}`}
>
<></>
</DeleteConfirmationModal>
)}
</>
);
}

View file

@ -47,7 +47,6 @@ const CollectionCard = ({ item, type, isLoading, control }) => {
return (
<CollectionCardComponent
is_component={type === "component"}
data={{
is_component: isComponent,
...item,

View file

@ -1,7 +1,6 @@
import { useEffect, useMemo, useState } from "react";
import { FormProvider, useForm, useWatch } from "react-hook-form";
import { Link, useLocation, useNavigate } from "react-router-dom";
import CollectionCardComponent from "../../../../components/cardComponent";
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
import IconComponent from "../../../../components/genericIconComponent";
import PaginatorComponent from "../../../../components/paginatorComponent";