Skip to content

Commit 95a42cd

Browse files
committed
refactor: improve layout of BaseHostForm inputs
- Wrapped host and path TextInput components in a Group for better alignment and responsiveness. - Adjusted width properties for ALPN and fingerprint Select components to enhance UI consistency. - Ensured inputs are displayed side-by-side for a more compact form layout.
1 parent 7904954 commit 95a42cd

File tree

1 file changed

+55
-36
lines changed

1 file changed

+55
-36
lines changed

src/shared/ui/forms/hosts/base-host-form/base-host-form.tsx

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,28 @@ export const BaseHostForm = <T extends CreateHostCommand.Request | UpdateHostCom
136136
{...form.getInputProps('sni')}
137137
/>
138138

139-
<TextInput
140-
key={form.key('host')}
141-
label={t('base-host-form.host')}
142-
placeholder={t('base-host-form.host-e-g-example-com')}
143-
{...form.getInputProps('host')}
144-
/>
145-
146-
<TextInput
147-
key={form.key('path')}
148-
label={t('base-host-form.path')}
149-
placeholder={t('base-host-form.path-e-g-ws')}
150-
{...form.getInputProps('path')}
151-
/>
139+
<Group
140+
gap="xs"
141+
grow
142+
justify="space-between"
143+
preventGrowOverflow={false}
144+
w="100%"
145+
>
146+
<TextInput
147+
key={form.key('host')}
148+
label={t('base-host-form.host')}
149+
placeholder={t('base-host-form.host-e-g-example-com')}
150+
{...form.getInputProps('host')}
151+
w="55%"
152+
/>
153+
<TextInput
154+
key={form.key('path')}
155+
label={t('base-host-form.path')}
156+
placeholder={t('base-host-form.path-e-g-ws')}
157+
{...form.getInputProps('path')}
158+
w="40%"
159+
/>
160+
</Group>
152161

153162
<Select
154163
allowDeselect={false}
@@ -185,29 +194,39 @@ export const BaseHostForm = <T extends CreateHostCommand.Request | UpdateHostCom
185194
{...form.getInputProps('securityLayer')}
186195
/>
187196

188-
<Select
189-
clearable
190-
data={Object.values(ALPN).map((alpn) => ({
191-
label: alpn,
192-
value: alpn
193-
}))}
194-
key={form.key('alpn')}
195-
label="ALPN"
196-
placeholder={t('base-host-form.alpn-e-g-h2')}
197-
{...form.getInputProps('alpn')}
198-
/>
199-
200-
<Select
201-
clearable
202-
data={Object.values(FINGERPRINTS).map((fingerprint) => ({
203-
label: fingerprint,
204-
value: fingerprint
205-
}))}
206-
key={form.key('fingerprint')}
207-
label={t('base-host-form.fingerprint')}
208-
placeholder={t('base-host-form.fingerprint-e-g-chrome')}
209-
{...form.getInputProps('fingerprint')}
210-
/>
197+
<Group
198+
gap="xs"
199+
grow
200+
justify="space-between"
201+
preventGrowOverflow={false}
202+
w="100%"
203+
>
204+
<Select
205+
clearable
206+
data={Object.values(ALPN).map((alpn) => ({
207+
label: alpn,
208+
value: alpn
209+
}))}
210+
key={form.key('alpn')}
211+
label="ALPN"
212+
placeholder={t('base-host-form.alpn-e-g-h2')}
213+
{...form.getInputProps('alpn')}
214+
w="40%"
215+
/>
216+
217+
<Select
218+
clearable
219+
data={Object.values(FINGERPRINTS).map((fingerprint) => ({
220+
label: fingerprint,
221+
value: fingerprint
222+
}))}
223+
key={form.key('fingerprint')}
224+
label={t('base-host-form.fingerprint')}
225+
placeholder={t('base-host-form.fingerprint-e-g-chrome')}
226+
{...form.getInputProps('fingerprint')}
227+
w="55%"
228+
/>
229+
</Group>
211230
</Stack>
212231
</Collapse>
213232
</Stack>

0 commit comments

Comments
 (0)