Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
components: Editable cells
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Guidée <[email protected]>
  • Loading branch information
quentinguidee committed Feb 18, 2024
1 parent dad0d4f commit 9c08b10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
12 changes: 12 additions & 0 deletions packages/components/lib/components/Table/Table.sass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
padding: 10px 20px
line-height: fonts.$line-height-normal

&:has(> .input)
padding: 0

& > .input
width: 100%
border-radius: 0
border: none
background-color: transparent

&:hover
background-color: colors.$bg-secondary-hover

& &-cell:not(:last-child), & &-head-cell:not(:last-child)
border-right: none

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Input } from "@vertex-center/components";
import TimezoneField from "../../../../components/TimezoneField/TimezoneField";
import { EnvVariable } from "../../backend/models";

type Props = {
Expand All @@ -23,17 +22,5 @@ export default function EnvVariableInput(props: Readonly<Props>) {
disabled,
};

let input: any;
if (env.type === "timezone") {
input = (
<TimezoneField
{...inputProps}
onChange={(value: any) => onChange(value)}
/>
);
} else {
input = <Input {...inputProps} />;
}

return input;
return <Input {...inputProps} />;
}
8 changes: 6 additions & 2 deletions src/apps/Containers/pages/ContainerEnv/ContainerEnv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useParams } from "react-router-dom";
import EnvVariableInput from "../../components/EnvVariableInput/EnvVariableInput";
import {
Button,
InlineCode,
Input,
MaterialIcon,
Table,
TableBody,
Expand Down Expand Up @@ -74,7 +74,11 @@ export default function ContainerEnv() {
{env?.map((env, i) => (
<TableRow key={env.name}>
<TableCell>
<InlineCode>{env.name}</InlineCode>
<Input
id={env.name}
value={env.name}
disabled
/>
</TableCell>
<TableCell>
<EnvVariableInput
Expand Down

0 comments on commit 9c08b10

Please sign in to comment.