Skip to content

Commit 3ebb3d3

Browse files
committed
feat(data-forwarding): add padding prop to FieldLayout components
1 parent 3acbb95 commit 3ebb3d3

File tree

1 file changed

+10
-3
lines changed
  • static/app/components/core/form/layout

1 file changed

+10
-3
lines changed

static/app/components/core/form/layout/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import {FieldMeta} from '@sentry/scraps/form/field/meta';
22
import {useFieldContext} from '@sentry/scraps/form/formContext';
3-
import {Container, Flex, Stack} from '@sentry/scraps/layout';
3+
import {Container, Flex, Stack, type FlexProps} from '@sentry/scraps/layout';
44

55
interface LayoutProps {
66
children: React.ReactNode;
77
label: React.ReactNode;
88
hintText?: React.ReactNode;
9+
padding?: FlexProps<'div'>['padding'];
910
required?: boolean;
1011
variant?: 'compact';
1112
}
@@ -15,7 +16,13 @@ function RowLayout(props: LayoutProps) {
1516
const field = useFieldContext();
1617

1718
return (
18-
<Flex id={field.name} gap="sm" align="center" justify="between">
19+
<Flex
20+
id={field.name}
21+
gap="sm"
22+
align="center"
23+
justify="between"
24+
padding={props.padding}
25+
>
1926
<Stack width="50%" gap="xs">
2027
<Flex gap="xs" align="center">
2128
<FieldMeta.Label
@@ -40,7 +47,7 @@ function StackLayout(props: LayoutProps) {
4047
const field = useFieldContext();
4148

4249
return (
43-
<Stack id={field.name} gap="md">
50+
<Stack id={field.name} gap="md" padding={props.padding}>
4451
<Flex gap="xs" align="center">
4552
<FieldMeta.Label
4653
required={props.required}

0 commit comments

Comments
 (0)