Skip to content

Commit 59ba6a0

Browse files
committed
chore(react/settings): use FormGroup for labels
1 parent 53eda46 commit 59ba6a0

File tree

3 files changed

+29
-35
lines changed

3 files changed

+29
-35
lines changed

apps/client/src/widgets/type_widgets/options/appearance.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ function ApplicationTheme() {
145145

146146
return (
147147
<OptionsSection title={t("theme.title")}>
148-
<Column>
149-
<label>{t("theme.theme_label")}</label>
150-
<FormSelect
151-
values={themes} currentValue={theme} onChange={setTheme}
152-
keyProperty="val" titleProperty="title"
153-
/>
154-
</Column>
148+
<div className="row">
149+
<FormGroup name="theme" label={t("theme.theme_label")} className="col-md-6" style={{ marginBottom: 0 }}>
150+
<FormSelect
151+
values={themes} currentValue={theme} onChange={setTheme}
152+
keyProperty="val" titleProperty="title"
153+
/>
154+
</FormGroup>
155155

156-
<Column className="side-checkbox">
157-
<FormCheckbox
158-
name="override-theme-fonts"
159-
label={t("theme.override_theme_fonts_label")}
160-
currentValue={overrideThemeFonts} onChange={setOverrideThemeFonts} />
161-
</Column>
156+
<FormGroup className="side-checkbox col-md-6" name="override-theme-fonts">
157+
<FormCheckbox
158+
label={t("theme.override_theme_fonts_label")}
159+
currentValue={overrideThemeFonts} onChange={setOverrideThemeFonts} />
160+
</FormGroup>
161+
</div>
162162
</OptionsSection>
163163
)
164164
}
@@ -189,24 +189,22 @@ function Font({ title, fontFamilyOption, fontSizeOption }: { title: string, font
189189
<>
190190
<h5>{title}</h5>
191191
<div className="row">
192-
<Column md={4}>
193-
<label>{t("fonts.font_family")}</label>
192+
<FormGroup className="col-md-4" label={t("fonts.font_family")}>
194193
<FormSelectWithGroups
195194
values={FONT_FAMILIES}
196195
currentValue={fontFamily} onChange={setFontFamily}
197196
keyProperty="value" titleProperty="label"
198197
/>
199-
</Column>
198+
</FormGroup>
200199

201-
<Column md={6}>
202-
<label>{t("fonts.size")}</label>
200+
<FormGroup className="col-md-6" label={t("fonts.size")}>
203201
<FormTextBoxWithUnit
204202
name="tree-font-size"
205203
type="number" min={50} max={200} step={10}
206204
currentValue={fontSize} onChange={setFontSize}
207205
unit={t("units.percentage")}
208206
/>
209-
</Column>
207+
</FormGroup>
210208
</div>
211209
</>
212210
);

apps/client/src/widgets/type_widgets/options/code_notes.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ function Appearance() {
5656

5757
return (
5858
<OptionsSection title={t("code_theme.title")}>
59-
<FormGroup className="row">
60-
<Column>
61-
<label>{t("code_theme.color-scheme")}</label>
59+
<div className="row" style={{ marginBottom: "15px" }}>
60+
<FormGroup label={t("code_theme.color-scheme")} className="col-md-6" style={{ marginBottom: 0 }}>
6261
<FormSelect
6362
values={themes}
6463
keyProperty="id" titleProperty="name"
6564
currentValue={codeNoteTheme} onChange={setCodeNoteTheme}
6665
/>
67-
</Column>
66+
</FormGroup>
6867

6968
<Column className="side-checkbox">
7069
<FormCheckbox
@@ -73,7 +72,7 @@ function Appearance() {
7372
currentValue={codeLineWrapEnabled} onChange={setCodeLineWrapEnabled}
7473
/>
7574
</Column>
76-
</FormGroup>
75+
</div>
7776

7877
<CodeNotePreview wordWrapping={codeLineWrapEnabled} themeName={codeNoteTheme} />
7978
</OptionsSection>

apps/client/src/widgets/type_widgets/options/text_notes.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ function CodeBlockStyle() {
153153

154154
return (
155155
<OptionsSection title={t("highlighting.title")}>
156-
<FormGroup className="row">
157-
<Column md={6}>
158-
<label>{t("highlighting.color-scheme")}</label>
156+
<div className="row" style={{ marginBottom: "15px" }}>
157+
<FormGroup className="col-md-6" label={t("highlighting.color-scheme")} style={{ marginBottom: 0 }}>
159158
<FormSelectWithGroups
160159
values={themes}
161160
keyProperty="val" titleProperty="title"
@@ -164,7 +163,7 @@ function CodeBlockStyle() {
164163
setCodeBlockTheme(newTheme);
165164
}}
166165
/>
167-
</Column>
166+
</FormGroup>
168167

169168
<Column md={6} className="side-checkbox">
170169
<FormCheckbox
@@ -173,7 +172,7 @@ function CodeBlockStyle() {
173172
currentValue={codeBlockWordWrap} onChange={setCodeBlockWordWrap}
174173
/>
175174
</Column>
176-
</FormGroup>
175+
</div>
177176

178177
<CodeBlockPreview theme={codeBlockTheme} wordWrap={codeBlockWordWrap} />
179178
</OptionsSection>
@@ -302,21 +301,19 @@ function DateTimeFormatOptions() {
302301
</FormText>
303302

304303
<FormGroup className="row align-items-center">
305-
<Column>
306-
<label>{t("custom_date_time_format.format_string")}</label>
304+
<FormGroup className="col-md-6" label={t("custom_date_time_format.format_string")}>
307305
<FormTextBox
308306
name="custom-date-time-format"
309307
placeholder="YYYY-MM-DD HH:mm"
310308
currentValue={customDateTimeFormat || "YYYY-MM-DD HH:mm"} onChange={setCustomDateTimeFormat}
311309
/>
312-
</Column>
310+
</FormGroup>
313311

314-
<Column>
315-
<label>{t("custom_date_time_format.formatted_time")}</label>
312+
<FormGroup className="col-md-6" label={t("custom_date_time_format.formatted_time")}>
316313
<div className="formatted-date">
317314
{formatDateTime(new Date(), customDateTimeFormat)}
318315
</div>
319-
</Column>
316+
</FormGroup>
320317
</FormGroup>
321318
</OptionsSection>
322319
)

0 commit comments

Comments
 (0)