From 9d5695f9aac81b1b9d43e5b8628d6e46dfacdb65 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Sun, 10 Nov 2024 15:45:43 +0100 Subject: [PATCH] fix(frontend): removed CardGrid and ContentSpinner components --- .../src/components/CardGrid/CardGrid.tsx | 60 ------------------- .../src/components/Spinner/ContentSpinner.tsx | 52 ---------------- 2 files changed, 112 deletions(-) delete mode 100644 agenta-web/src/components/CardGrid/CardGrid.tsx delete mode 100644 agenta-web/src/components/Spinner/ContentSpinner.tsx diff --git a/agenta-web/src/components/CardGrid/CardGrid.tsx b/agenta-web/src/components/CardGrid/CardGrid.tsx deleted file mode 100644 index 06899d729b..0000000000 --- a/agenta-web/src/components/CardGrid/CardGrid.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, {useState} from "react" -import {Card, Button, Row, Col} from "antd" -import {createUseStyles} from "react-jss" - -const useStyles = createUseStyles({ - card: { - width: 300, - height: "250px", - marginBottom: "20px", - display: "flex", - justifyContent: "center", - alignItems: "center", - }, - cardBtn: { - height: "200px", - width: "220px", - }, -}) - -const CardGrid = () => { - const classes = useStyles() - const [cards, setCards] = useState([1]) // initial state with one card - - const addCard = () => { - const newCard = cards.length + 1 - setCards([...cards, newCard]) - } - - return ( -
- {" "} - {/* Add padding here for spacing at sides */} - - {" "} - {/* gutter adds spacing between columns */} - {cards.map((card, index) => ( - - {" "} - {/* each card takes 1/4 of the row */} - - {card === cards.length ? ( // display + in the last card - - ) : ( -
{`App ${card}`}
// display app name - )} -
- - ))} -
-
- ) -} - -export default CardGrid diff --git a/agenta-web/src/components/Spinner/ContentSpinner.tsx b/agenta-web/src/components/Spinner/ContentSpinner.tsx deleted file mode 100644 index 62915e819d..0000000000 --- a/agenta-web/src/components/Spinner/ContentSpinner.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from "react" -import {Spin} from "antd" -import {createUseStyles} from "react-jss" - -type Props = { - text?: string - containerProps?: React.DetailedHTMLProps, HTMLDivElement> - innerContainerProps?: React.DetailedHTMLProps< - React.HTMLAttributes, - HTMLDivElement - > - spinnerProps?: React.ComponentProps -} - -const useStyles = createUseStyles({ - container: { - width: "100%", - height: "100%", - flex: 1, - display: "grid", - placeItems: "center", - }, - inner: { - display: "inline-block", - textAlign: "center", - }, -}) - -const ContentSpinner: React.FC = ({ - text, - containerProps, - innerContainerProps, - spinnerProps, -}) => { - const classes = useStyles() - - return ( -
-
- -
-
- ) -} - -export default ContentSpinner