Skip to content

Commit a15ec26

Browse files
authored
Change reset form styles to compact (#908)
1 parent 0e22cbc commit a15ec26

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { type Theme } from 'baseui';
2+
import { type CheckboxOverrides } from 'baseui/checkbox';
3+
import { type RadioOverrides } from 'baseui/radio';
4+
import { type StyleObject } from 'styletron-react';
5+
6+
export const overrides = {
7+
radio: {
8+
Label: {
9+
style: ({ $theme }: { $theme: Theme }): StyleObject => ({
10+
...$theme.typography.LabelSmall,
11+
}),
12+
},
13+
} satisfies RadioOverrides,
14+
checkbox: {
15+
Label: {
16+
style: ({ $theme }: { $theme: Theme }): StyleObject => ({
17+
...$theme.typography.LabelSmall,
18+
alignSelf: 'center',
19+
}),
20+
},
21+
} satisfies CheckboxOverrides,
22+
};

src/views/workflow-actions/workflow-action-reset-form/workflow-action-reset-form.tsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Controller, useWatch } from 'react-hook-form';
1414

1515
import { useDescribeWorkflow } from '@/views/workflow-page/hooks/use-describe-workflow';
1616

17+
import { overrides } from './workflow-action-reset-form.styles';
1718
import { type Props } from './workflow-action-reset-form.types';
1819

1920
export default function WorkflowActionResetForm({
@@ -82,8 +83,12 @@ export default function WorkflowActionResetForm({
8283
error={Boolean(fieldErrors.resetType?.message)}
8384
align={ALIGN.horizontal}
8485
>
85-
<Radio value="EventId">Event ID</Radio>
86-
<Radio value="BinaryChecksum">Binary Checksum</Radio>
86+
<Radio overrides={overrides.radio} value="EventId">
87+
Event ID
88+
</Radio>
89+
<Radio overrides={overrides.radio} value="BinaryChecksum">
90+
Binary Checksum
91+
</Radio>
8792
</RadioGroup>
8893
)}
8994
/>
@@ -106,6 +111,7 @@ export default function WorkflowActionResetForm({
106111
onBlur={field.onBlur}
107112
error={Boolean(getErrorMessage('decisionFinishEventId'))}
108113
type="number"
114+
size="compact"
109115
placeholder="Find Event ID"
110116
/>
111117
)}
@@ -136,6 +142,7 @@ export default function WorkflowActionResetForm({
136142
error={Boolean(
137143
getErrorMessage('binaryChecksumFirstDecisionCompletedId')
138144
)}
145+
size="compact"
139146
placeholder="Select binary checksum"
140147
noResultsMsg={
141148
isError
@@ -156,6 +163,7 @@ export default function WorkflowActionResetForm({
156163
render={({ field: { value, onChange, ref, ...field } }) => (
157164
<Checkbox
158165
{...field}
166+
overrides={overrides.checkbox}
159167
// @ts-expect-error - inputRef expects ref object while ref is a callback. It should support both.
160168
inputRef={ref}
161169
checkmarkType={CHECKBOX_STYLE_TYPE.toggle_round}
@@ -180,6 +188,7 @@ export default function WorkflowActionResetForm({
180188
{...field}
181189
// @ts-expect-error - inputRef expects ref object while ref is a callback. It should support both.
182190
inputRef={ref}
191+
size="compact"
183192
onChange={(e) => {
184193
field.onChange(e.target.value);
185194
}}

0 commit comments

Comments
 (0)