Skip to content

Commit aa0de8f

Browse files
author
David Wang
authored
ref(crons): Remove inline grid column values for styled component (#69070)
feel like this is more true to what we do with styled components
1 parent 7586900 commit aa0de8f

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

static/app/views/monitors/components/monitorCreateForm.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default function MonitorCreateForm() {
100100
submitLabel={t('Create')}
101101
>
102102
<FieldContainer>
103-
<MultiColumnInput columns="230px 230px 1fr">
103+
<ProjectOwnerNameInputs>
104104
<StyledSentryProjectSelectorField
105105
name="project"
106106
projects={filteredProjects}
@@ -125,7 +125,7 @@ export default function MonitorCreateForm() {
125125
stacked
126126
inline={false}
127127
/>
128-
</MultiColumnInput>
128+
</ProjectOwnerNameInputs>
129129
<LabelText>{t('SCHEDULE')}</LabelText>
130130
<ScheduleOptions>
131131
<Observer>
@@ -146,7 +146,7 @@ export default function MonitorCreateForm() {
146146
>
147147
<PanelBody withPadding>
148148
<ScheduleLabel>{t('Crontab Schedule')}</ScheduleLabel>
149-
<MultiColumnInput columns="1fr 1fr">
149+
<CrontabInputs>
150150
<StyledTextField
151151
name="config.schedule"
152152
placeholder="* * * * *"
@@ -168,7 +168,7 @@ export default function MonitorCreateForm() {
168168
<CronstrueText>
169169
{parsedSchedule ?? t('(invalid schedule)')}
170170
</CronstrueText>
171-
</MultiColumnInput>
171+
</CrontabInputs>
172172
</PanelBody>
173173
</SchedulePanel>
174174
<SchedulePanel
@@ -177,7 +177,7 @@ export default function MonitorCreateForm() {
177177
>
178178
<PanelBody withPadding>
179179
<ScheduleLabel>{t('Interval Schedule')}</ScheduleLabel>
180-
<MultiColumnInput columns="auto 1fr 2fr">
180+
<IntervalInputs>
181181
<Label>{t('Every')}</Label>
182182
<StyledNumberField
183183
name="config.schedule.frequency"
@@ -200,7 +200,7 @@ export default function MonitorCreateForm() {
200200
stacked
201201
inline={false}
202202
/>
203-
</MultiColumnInput>
203+
</IntervalInputs>
204204
</PanelBody>
205205
</SchedulePanel>
206206
</Fragment>
@@ -273,11 +273,22 @@ const ScheduleOptions = styled('div')`
273273
grid-template-columns: 1fr 1fr;
274274
`;
275275

276-
const MultiColumnInput = styled('div')<{columns?: string}>`
276+
const MultiColumnInput = styled('div')`
277277
display: grid;
278278
align-items: center;
279279
gap: ${space(1)};
280-
grid-template-columns: ${p => p.columns};
280+
`;
281+
282+
const ProjectOwnerNameInputs = styled(MultiColumnInput)`
283+
grid-template-columns: 230px 230px 1fr;
284+
`;
285+
286+
const CrontabInputs = styled(MultiColumnInput)`
287+
grid-template-columns: 1fr 1fr;
288+
`;
289+
290+
const IntervalInputs = styled(MultiColumnInput)`
291+
grid-template-columns: auto 1fr 2fr;
281292
`;
282293

283294
const CronstrueText = styled(LabelText)`

0 commit comments

Comments
 (0)