Skip to content

Commit

Permalink
fix(frontend): fix toggle on settings page (#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Jul 11, 2023
1 parent 0c190bc commit 3a1ffc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/components/Settings/Analytics/AnalyticsForm.tsx
Expand Up @@ -33,10 +33,10 @@ const AnalyticsForm = () => {
<Form.Item hidden name="name" />

<S.SwitchContainer>
<label htmlFor={`${FORM_ID}_analyticsEnabled`}>Enable analytics</label>
<Form.Item name="analyticsEnabled" valuePropName="checked">
<Switch />
</Form.Item>
<S.SwitchLabel htmlFor={`${FORM_ID}_analyticsEnabled`}>Enable analytics</S.SwitchLabel>
</S.SwitchContainer>

<S.FooterContainer>
Expand Down
7 changes: 5 additions & 2 deletions web/src/components/Settings/Demo/DemoForm.tsx
Expand Up @@ -39,22 +39,25 @@ const DemoForm = () => {
<Form.Item name={[SupportedDemosFormField.Pokeshop, 'name']} hidden />

<S.SwitchContainer>
<label htmlFor={`${FORM_ID}_pokeshopEnabled`}>Enable Pokeshop</label>
<Form.Item name={[SupportedDemosFormField.Pokeshop, 'enabled']} valuePropName="checked">
<Switch />
</Form.Item>
<S.SwitchLabel htmlFor={`${FORM_ID}_pokeshop_enabled`}>Enable Pokeshop</S.SwitchLabel>
</S.SwitchContainer>

{pokeshopEnabled && <PokeshopFields />}

<Form.Item name={[SupportedDemosFormField.OpentelemetryStore, 'type']} hidden />
<Form.Item name={[SupportedDemosFormField.OpentelemetryStore, 'id']} hidden />
<Form.Item name={[SupportedDemosFormField.OpentelemetryStore, 'name']} hidden />

<S.SwitchContainer>
<label htmlFor={`${FORM_ID}_otelEnabled`}>Enable OpenTelemetry Astronomy Shop Demo</label>
<Form.Item name={[SupportedDemosFormField.OpentelemetryStore, 'enabled']} valuePropName="checked">
<Switch />
</Form.Item>
<S.SwitchLabel htmlFor={`${FORM_ID}_opentelemetryStore_enabled`}>
Enable OpenTelemetry Astronomy Shop Demo
</S.SwitchLabel>
</S.SwitchContainer>

{otelEnabled && <OtelFields />}
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/Settings/common/Settings.styled.ts
Expand Up @@ -33,6 +33,10 @@ export const SwitchContainer = styled.div`
gap: 8px;
`;

export const SwitchLabel = styled.label`
margin-bottom: 24px;
`;

export const LinterPluginsContainer = styled.div`
margin-top: 10px;
padding: 24px 24px 0;
Expand Down

0 comments on commit 3a1ffc8

Please sign in to comment.