From 2b00041e4d291794bf2fd61aa4cd76d69672bad3 Mon Sep 17 00:00:00 2001 From: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:07:49 -0700 Subject: [PATCH] refactor: Minor style fixes (#4578) * refactor: Update AccountMenu and Select components - Refactor AccountMenu component to improve readability and simplify logic - Update Select component to add support for direction prop and display ChevronUp icon when direction is set to "up" Related work items: #4569, #4565 * refactor: Update header component UI This commit refactors the header component in the MainPage to update its UI. It adds a sliding indicator for the view type (list or grid) and adjusts the styling of the buttons accordingly. It also removes commented out code related to the store button. Additionally, the commit updates the emptyFolder component by simplifying the text for the "New Flow" button. Refactor the header component UI and update emptyFolder component * refactor: Update HeaderMenu component UI * Updated colors to use shadcn variables --------- Co-authored-by: Lucas Oliveira --- .../components/AccountMenu/index.tsx | 16 ++++++---- .../components/HeaderMenu/index.tsx | 4 +-- .../components/paginatorComponent/index.tsx | 5 ++- src/frontend/src/components/ui/select.tsx | 14 +++++--- .../MainPage/components/header/index.tsx | 32 +++++++++---------- .../MainPage/pages/emptyFolder/index.tsx | 4 +-- .../pages/MainPage/pages/homePage/index.tsx | 20 ------------ 7 files changed, 41 insertions(+), 54 deletions(-) diff --git a/src/frontend/src/components/appHeaderComponent/components/AccountMenu/index.tsx b/src/frontend/src/components/appHeaderComponent/components/AccountMenu/index.tsx index 4892ae496912..1e00a06078ba 100644 --- a/src/frontend/src/components/appHeaderComponent/components/AccountMenu/index.tsx +++ b/src/frontend/src/components/appHeaderComponent/components/AccountMenu/index.tsx @@ -120,19 +120,21 @@ export const AccountMenu = () => { Join the Langflow Discord - - {ENABLE_DATASTAX_LANGFLOW ? ( + {ENABLE_DATASTAX_LANGFLOW ? ( + Logout - ) : ( - !autoLogin && ( + + ) : ( + !autoLogin && ( + Logout - ) - )} - + + ) + )} )} @@ -59,7 +59,7 @@ export const HeaderMenuItemButton = ({ icon = "", onClick, children }) => ( {icon && ( )} diff --git a/src/frontend/src/components/paginatorComponent/index.tsx b/src/frontend/src/components/paginatorComponent/index.tsx index b33038b7b7dd..46825997ada4 100644 --- a/src/frontend/src/components/paginatorComponent/index.tsx +++ b/src/frontend/src/components/paginatorComponent/index.tsx @@ -62,7 +62,10 @@ export default function PaginatorComponent({ onValueChange={(value) => paginate(Number(value), size)} value={pageIndex.toString()} > - + diff --git a/src/frontend/src/components/ui/select.tsx b/src/frontend/src/components/ui/select.tsx index 75bc584df986..cd893cb7fcd2 100644 --- a/src/frontend/src/components/ui/select.tsx +++ b/src/frontend/src/components/ui/select.tsx @@ -1,7 +1,7 @@ "use client"; import * as SelectPrimitive from "@radix-ui/react-select"; -import { Check, ChevronDown } from "lucide-react"; +import { Check, ChevronDown, ChevronUp } from "lucide-react"; import * as React from "react"; import { cn } from "../../utils/utils"; @@ -13,8 +13,10 @@ const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( + React.ComponentPropsWithoutRef & { + direction?: "up" | "down"; + } +>(({ className, children, direction = "down", ...props }, ref) => ( {children} - + {direction === "up" ? ( + + ) : ( + + )} )); diff --git a/src/frontend/src/pages/MainPage/components/header/index.tsx b/src/frontend/src/pages/MainPage/components/header/index.tsx index 9e284d50e657..9976f524afb3 100644 --- a/src/frontend/src/pages/MainPage/components/header/index.tsx +++ b/src/frontend/src/pages/MainPage/components/header/index.tsx @@ -112,41 +112,39 @@ const HeaderComponent = ({ value={debouncedSearch} onChange={handleSearch} /> -
+
+ {/* Sliding Indicator */} +
+ + {/* Buttons */} {["list", "grid"].map((viewType) => ( ))}
- {/* - - */}
diff --git a/src/frontend/src/pages/MainPage/pages/homePage/index.tsx b/src/frontend/src/pages/MainPage/pages/homePage/index.tsx index e0404705ef78..d233f8fc92fd 100644 --- a/src/frontend/src/pages/MainPage/pages/homePage/index.tsx +++ b/src/frontend/src/pages/MainPage/pages/homePage/index.tsx @@ -87,26 +87,6 @@ const HomePage = ({ type }) => { data-testid="cards-wrapper" >
- {/* TODO: Move to Datastax LF and update Icon */} - {/*
- -
- DataStax Langflow is in public preview and is not suitable for - production. By continuing to use DataStax Langflow, you agree to the{" "} - - DataStax preview terms - - . -
-
*/} {ENABLE_DATASTAX_LANGFLOW && } {/* mt-10 to mt-8 for Datastax LF */}