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:
parent
2d92233fc5
commit
643271df40
3 changed files with 3 additions and 18 deletions
|
|
@ -43,7 +43,6 @@ export default function CollectionCardComponent({
|
||||||
onDelete,
|
onDelete,
|
||||||
playground,
|
playground,
|
||||||
control,
|
control,
|
||||||
is_component,
|
|
||||||
}: {
|
}: {
|
||||||
data: storeComponent;
|
data: storeComponent;
|
||||||
authorized?: boolean;
|
authorized?: boolean;
|
||||||
|
|
@ -53,7 +52,6 @@ export default function CollectionCardComponent({
|
||||||
playground?: boolean;
|
playground?: boolean;
|
||||||
onDelete?: () => void;
|
onDelete?: () => void;
|
||||||
control?: Control<any, any>;
|
control?: Control<any, any>;
|
||||||
is_component?: boolean;
|
|
||||||
}) {
|
}) {
|
||||||
const setSuccessData = useAlertStore((state) => state.setSuccessData);
|
const setSuccessData = useAlertStore((state) => state.setSuccessData);
|
||||||
const setErrorData = useAlertStore((state) => state.setErrorData);
|
const setErrorData = useAlertStore((state) => state.setErrorData);
|
||||||
|
|
@ -73,7 +71,6 @@ export default function CollectionCardComponent({
|
||||||
const setNodes = useFlowStore((state) => state.setNodes);
|
const setNodes = useFlowStore((state) => state.setNodes);
|
||||||
const setEdges = useFlowStore((state) => state.setEdges);
|
const setEdges = useFlowStore((state) => state.setEdges);
|
||||||
const [openPlayground, setOpenPlayground] = useState(false);
|
const [openPlayground, setOpenPlayground] = useState(false);
|
||||||
const [openDelete, setOpenDelete] = useState(false);
|
|
||||||
const setCurrentFlowId = useFlowsManagerStore(
|
const setCurrentFlowId = useFlowsManagerStore(
|
||||||
(state) => state.setCurrentFlowId,
|
(state) => state.setCurrentFlowId,
|
||||||
);
|
);
|
||||||
|
|
@ -167,7 +164,9 @@ export default function CollectionCardComponent({
|
||||||
data-testid={`card-${convertTestName(data.name)}`}
|
data-testid={`card-${convertTestName(data.name)}`}
|
||||||
//TODO check color schema
|
//TODO check color schema
|
||||||
className={cn(
|
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" : "",
|
disabled ? "pointer-events-none opacity-50" : "",
|
||||||
onClick ? "cursor-pointer" : "",
|
onClick ? "cursor-pointer" : "",
|
||||||
isSelectedCard ? "border border-selected" : "",
|
isSelectedCard ? "border border-selected" : "",
|
||||||
|
|
@ -518,18 +517,6 @@ export default function CollectionCardComponent({
|
||||||
<></>
|
<></>
|
||||||
</IOModal>
|
</IOModal>
|
||||||
)}
|
)}
|
||||||
{openDelete && (
|
|
||||||
<DeleteConfirmationModal
|
|
||||||
open={openDelete}
|
|
||||||
setOpen={setOpenDelete}
|
|
||||||
onConfirm={() => {
|
|
||||||
if (onDelete) onDelete();
|
|
||||||
}}
|
|
||||||
description={` ${is_component ? "component" : "flow"}`}
|
|
||||||
>
|
|
||||||
<></>
|
|
||||||
</DeleteConfirmationModal>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ const CollectionCard = ({ item, type, isLoading, control }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CollectionCardComponent
|
<CollectionCardComponent
|
||||||
is_component={type === "component"}
|
|
||||||
data={{
|
data={{
|
||||||
is_component: isComponent,
|
is_component: isComponent,
|
||||||
...item,
|
...item,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { FormProvider, useForm, useWatch } from "react-hook-form";
|
import { FormProvider, useForm, useWatch } from "react-hook-form";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import CollectionCardComponent from "../../../../components/cardComponent";
|
|
||||||
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
||||||
import IconComponent from "../../../../components/genericIconComponent";
|
import IconComponent from "../../../../components/genericIconComponent";
|
||||||
import PaginatorComponent from "../../../../components/paginatorComponent";
|
import PaginatorComponent from "../../../../components/paginatorComponent";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue