diff --git a/services/frontend/src/components/Modal/Service/Environment.tsx b/services/frontend/src/components/Modal/Service/Environment.tsx index 7123d1d..7ddcbd7 100644 --- a/services/frontend/src/components/Modal/Service/Environment.tsx +++ b/services/frontend/src/components/Modal/Service/Environment.tsx @@ -1,6 +1,6 @@ import { useCallback } from "react"; import { PlusIcon } from "@heroicons/react/outline"; -import { styled } from "@mui/joy"; +import { Button, styled } from "@mui/joy"; import { useFormikContext } from "formik"; import Record from "../../Record"; import { IService } from "../../../types"; @@ -8,6 +8,7 @@ import { IService } from "../../../types"; const Root = styled("div")` display: flex; flex-direction: column; + align-items: center; `; const Records = styled("div")` @@ -16,6 +17,17 @@ const Records = styled("div")` row-gap: ${({ theme }: { theme: any }) => theme.spacing(1)}; `; +const AddButton = styled(Button)` + width: 140px; + margin-top: ${({ theme }) => theme.spacing(2)}; +`; + +const Description = styled("p")` + margin-top: ${({ theme }) => theme.spacing(2)}; + text-align: center; + color: #7a7a7a; +`; + const Environment = () => { const formik = useFormikContext<{ serviceConfig: IService; @@ -46,47 +58,47 @@ const Environment = () => { environment && environment.length === 0 ? true : false; return ( - <> - - {!emptyEnvironmentVariables && ( - - {environment.map((_: unknown, index: number) => ( - - ))} - - )} + + {!emptyEnvironmentVariables && ( + + {environment.map((_: unknown, index: number) => ( + + ))} + + )} - {emptyEnvironmentVariables && ( -

- add environment variables -

- )} -
+ {emptyEnvironmentVariables && ( + + This service does not have any environment variables. +
+ Click "+ New variable" to add a new environment variable. +
+ )} -
- -
- + + + New variable + +
); }; export default Environment;