From 469961063c83ee8e8f70ceb977f4c92254f7cfca Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Tue, 2 Jan 2024 13:04:30 +0100 Subject: [PATCH 1/2] avatar in main screen removed --- .../src/components/AppSelector/AppCard.tsx | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/agenta-web/src/components/AppSelector/AppCard.tsx b/agenta-web/src/components/AppSelector/AppCard.tsx index a05652cc6..c395a727e 100644 --- a/agenta-web/src/components/AppSelector/AppCard.tsx +++ b/agenta-web/src/components/AppSelector/AppCard.tsx @@ -9,20 +9,25 @@ import {getGradientFromStr} from "@/lib/helpers/colors" import {ListAppsItem} from "@/lib/Types" import {useProfileData, Role} from "@/contexts/profile.context" import {useAppsData} from "@/contexts/app.context" +import {useAppTheme} from "../Layout/ThemeContextProvider" + +type StyleProps = { + themeMode: "dark" | "light" +} const useStyles = createUseStyles({ - card: { + card: ({themeMode}: StyleProps) => ({ width: 300, height: 120, display: "flex", flexDirection: "column", justifyContent: "space-between", overflow: "hidden", + background: themeMode === "light" && "white", "& svg": { color: "red", }, "& .ant-card-meta": { - height: "90%", display: "flex", alignItems: "center", justifyContent: "center", @@ -30,25 +35,12 @@ const useStyles = createUseStyles({ "& .ant-card-meta-title div": { textAlign: "center", }, - }, - cardCover: { - "z-index": 1, - position: "absolute", - top: 0, - right: 0, - left: 0, - background: "transparent", - margin: "auto", - width: "300px", - height: "70px", - display: "flex", - overflow: "hidden", - "flex-direction": "column", - "justify-content": "space-between", - }, - cardLink: { - padding: "24px", - }, + "& .ant-card-actions": { + "& li": { + margin: "8px 0", + }, + }, + }), }) const DeleteModal: React.FC<{ @@ -102,7 +94,8 @@ const AppCard: React.FC<{ setVisibleDelete(false) } - const classes = useStyles() + const {appTheme} = useAppTheme() + const classes = useStyles({themeMode: appTheme} as StyleProps) return ( <> @@ -113,17 +106,23 @@ const AppCard: React.FC<{ ? [] : undefined } + style={{background: appTheme === "light" ? "" : getGradientFromStr(app.app_id)}} > {renameVariablesCapitalizeAll(app.app_name)}} avatar={ - - {app.app_name.charAt(0).toUpperCase()} - + appTheme === "light" && ( + + {app.app_name.charAt(0).toUpperCase()} + + ) } /> From af0879995c99fe342a75a312304d2606adf79168 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Tue, 2 Jan 2024 13:04:57 +0100 Subject: [PATCH 2/2] button visibility in dark mode --- agenta-web/src/components/Layout/Layout.tsx | 5 +++-- agenta-web/src/pages/apps/[app_id]/testsets/index.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agenta-web/src/components/Layout/Layout.tsx b/agenta-web/src/components/Layout/Layout.tsx index db0de4bf5..fd0b22a20 100644 --- a/agenta-web/src/components/Layout/Layout.tsx +++ b/agenta-web/src/components/Layout/Layout.tsx @@ -70,7 +70,8 @@ const useStyles = createUseStyles({ padding: "0 15px", }, }), - joinBtn: { + joinBtn: ({themeMode}) => ({ + background: themeMode === "dark" ? "#333" : "#fff", display: "flex", alignItems: "center", gap: 8, @@ -80,7 +81,7 @@ const useStyles = createUseStyles({ "& img": { width: "15px", }, - }, + }), footer: { position: "absolute", bottom: 0, diff --git a/agenta-web/src/pages/apps/[app_id]/testsets/index.tsx b/agenta-web/src/pages/apps/[app_id]/testsets/index.tsx index b9221f572..4404eea86 100644 --- a/agenta-web/src/pages/apps/[app_id]/testsets/index.tsx +++ b/agenta-web/src/pages/apps/[app_id]/testsets/index.tsx @@ -112,7 +112,7 @@ export default function Testsets() { - {testsets.length > 0 && } + {testsets.length > 0 && }