From 0f45a09494afa9ef4151bc884e08d42d3b24a99f Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Wed, 6 Mar 2024 18:06:52 -0300 Subject: [PATCH] Refactor: flow toolbar buttons disable intead of dissapear --- src/frontend/src/App.css | 3 +- src/frontend/src/components/IOview/index.tsx | 8 +++- .../src/components/chatComponent/index.tsx | 42 ++++++++++--------- src/frontend/src/style/index.css | 3 +- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/frontend/src/App.css b/src/frontend/src/App.css index c2427fb0f..6aa681415 100644 --- a/src/frontend/src/App.css +++ b/src/frontend/src/App.css @@ -97,4 +97,5 @@ body { .custom-hover:hover { background-color: rgba(99, 102, 241, 0.1); /* Medium indigo color with 20% opacity */ -} \ No newline at end of file +} + diff --git a/src/frontend/src/components/IOview/index.tsx b/src/frontend/src/components/IOview/index.tsx index 73f0a068e..ced31a177 100644 --- a/src/frontend/src/components/IOview/index.tsx +++ b/src/frontend/src/components/IOview/index.tsx @@ -20,7 +20,12 @@ import { Badge } from "../ui/badge"; import { Button } from "../ui/button"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; -export default function IOView({ children, open, setOpen }): JSX.Element { +export default function IOView({ children, open, setOpen, disable }: { + children: JSX.Element; + open: boolean; + setOpen: (open: boolean) => void; + disable?: boolean; +}): JSX.Element { const inputs = useFlowStore((state) => state.inputs).filter( (input) => input.type !== "ChatInput" ); @@ -98,6 +103,7 @@ export default function IOView({ children, open, setOpen }): JSX.Element { size={haveChat ? (selectedTab === 0 ? "large-thin" : "large") : "small"} open={open} setOpen={setOpen} + disable={disable} > {children} {/* TODO ADAPT TO ALL TYPES OF INPUTS AND OUTPUTS */} diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index a53184856..3d3a01562 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -51,9 +51,9 @@ export default function FlowToolbar({ flow }: ChatType): JSX.Element {