mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): fix parameters field size (#12231)
This commit is contained in:
@@ -3,9 +3,9 @@ import {
|
||||
createContext,
|
||||
type FC,
|
||||
type HTMLProps,
|
||||
type PropsWithChildren,
|
||||
useContext,
|
||||
ReactNode,
|
||||
ComponentProps,
|
||||
} from "react";
|
||||
import { AlphaBadge, DeprecatedBadge } from "components/Badges/Badges";
|
||||
import { Stack } from "components/Stack/Stack";
|
||||
@@ -135,11 +135,14 @@ export const FormSection: FC<FormSectionProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const FormFields: FC<PropsWithChildren> = ({ children }) => {
|
||||
export const FormFields: FC<ComponentProps<typeof Stack>> = (props) => {
|
||||
return (
|
||||
<Stack direction="column" spacing={3} css={styles.formSectionFields}>
|
||||
{children}
|
||||
</Stack>
|
||||
<Stack
|
||||
direction="column"
|
||||
spacing={3}
|
||||
{...props}
|
||||
css={styles.formSectionFields}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -256,11 +256,14 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
|
||||
title="Parameters"
|
||||
description="These are the settings used by your template. Please note that immutable parameters cannot be modified once the workspace is created."
|
||||
>
|
||||
{/*
|
||||
Opted not to use FormFields in order to increase spacing.
|
||||
This decision was made because rich parameter inputs are more visually dense than standard text fields.
|
||||
*/}
|
||||
<div css={{ display: "flex", flexDirection: "column", gap: 36 }}>
|
||||
{/* The parameter fields are densely packed and carry significant information,
|
||||
/* hence they require additional vertical spacing for better
|
||||
/*readability and user experience. */}
|
||||
<FormFields
|
||||
css={{
|
||||
gap: 36,
|
||||
}}
|
||||
>
|
||||
{parameters.map((parameter, index) => {
|
||||
const parameterField = `rich_parameter_values.${index}`;
|
||||
const parameterInputName = `${parameterField}.value`;
|
||||
@@ -285,7 +288,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</FormFields>
|
||||
</FormSection>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user