@@ -13,7 +13,7 @@ import {
13
13
environmentSetShowPrereleasePackages ,
14
14
TauriEnvironmentSettings
15
15
} from "@/lib/bindings" ;
16
- import { HNavBar , VStack } from "@/components/layout" ;
16
+ import { HNavBar , VStack , HContent , HSection , HSectionTitle , HSectionRow , HSectionSubTitle , HSectionText } from "@/components/layout" ;
17
17
import React from "react" ;
18
18
import { toastError , toastSuccess , toastThrownError } from "@/lib/toast" ;
19
19
import i18next , { languages , tc , tt } from "@/lib/i18n" ;
@@ -36,7 +36,7 @@ export default function Page() {
36
36
body = < Card className = { "p-4" } > { tc ( "loading..." ) } </ Card > ;
37
37
break ;
38
38
case "success" :
39
- body = < Settings settings = { result . data } refetch = { result . refetch } /> ;
39
+ body = < Settings settings = { result . data } refetch = { result . refetch } />
40
40
break ;
41
41
default :
42
42
const _exhaustiveCheck : never = result ;
@@ -45,11 +45,13 @@ export default function Page() {
45
45
return (
46
46
< VStack className = { "p-4" } >
47
47
< HNavBar className = { "flex-shrink-0" } >
48
- < Typography className = "cursor-pointer py-1.5 font-bold flex-grow-0" >
48
+ < Typography variant = "h4" className = "cursor-pointer py-1.5 font-bold flex-grow-0" >
49
49
{ tc ( "settings" ) }
50
50
</ Typography >
51
51
</ HNavBar >
52
- { body }
52
+ < HContent >
53
+ { body }
54
+ </ HContent >
53
55
</ VStack >
54
56
) ;
55
57
}
@@ -191,103 +193,116 @@ function Settings(
191
193
} ;
192
194
193
195
return (
194
- < main className = "flex flex-col gap-2 flex-shrink overflow-y-auto flex-grow" >
195
- < Card className = { "flex-shrink-0 p-4" } >
196
- < h2 className = { "pb-2" } > { tc ( "unity hub" ) } </ h2 >
197
- < div className = { "flex gap-1" } >
198
- {
199
- settings . unity_hub
200
- ? < Input className = "flex-auto" value = { settings . unity_hub } disabled />
201
- : < Input value = { "Unity Hub Not Found" } disabled className = { "flex-auto text-red-900" } />
202
- }
196
+ < >
197
+ < HSection >
198
+ < HSectionTitle > { tc ( "unity hub" ) } </ HSectionTitle >
199
+ < HSectionRow >
200
+ {
201
+ settings . unity_hub
202
+ ? < Input className = "flex-auto" value = { settings . unity_hub } disabled />
203
+ : < Input value = { "Unity Hub Not Found" } disabled className = { "flex-auto text-red-900" } />
204
+ }
203
205
< Button className = { "flex-none px-4" } onClick = { selectUnityHub } > { tc ( "select" ) } </ Button >
204
- </ div >
205
- </ Card >
206
- < Card className = { "flex-shrink-0 p-4" } >
207
- < div className = { "pb-2 flex align-middle" } >
208
- < div className = { "flex-grow flex items-center" } >
209
- < h2 > { tc ( "unity installations" ) } </ h2 >
210
- </ div >
206
+ </ HSectionRow >
207
+ </ HSection >
208
+ < HSection >
209
+ < HSectionRow >
210
+ < HSectionTitle className = "flex-grow" > { tc ( "unity installations" ) } </ HSectionTitle >
211
211
< Button onClick = { addUnity } size = { "sm" } className = { "m-1" } > { tc ( "add unity" ) } </ Button >
212
- </ div >
213
- < Card className = "w-full overflow-x-auto overflow-y-scroll min-h-[20vh]" >
214
- < UnityTable unityPaths = { settings . unity_paths } />
215
- </ Card >
216
- </ Card >
217
- < Card className = { "flex-shrink-0 p-4" } >
218
- < h2 > { tc ( "default project path" ) } </ h2 >
219
- < Typography className = { "whitespace-normal" } >
212
+ </ HSectionRow >
213
+ < HSectionRow >
214
+ < Card className = "w-full overflow-x-auto overflow-y-scroll min-h-[20vh]" >
215
+ < UnityTable unityPaths = { settings . unity_paths } />
216
+ </ Card >
217
+ </ HSectionRow >
218
+ </ HSection >
219
+ < HSection >
220
+ < HSectionTitle >
221
+ { tc ( "default project path" ) }
222
+ </ HSectionTitle >
223
+ < HSectionSubTitle >
220
224
{ tc ( "the default project path is the directory where new projects are created in." ) }
221
- </ Typography >
222
- < div className = { "flex gap-1" } >
225
+ </ HSectionSubTitle >
226
+ < HSectionRow >
223
227
< Input className = "flex-auto" value = { settings . default_project_path } disabled />
224
228
< Button className = { "flex-none px-4" } onClick = { selectProjectDefaultFolder } > { tc ( "select" ) } </ Button >
225
- </ div >
226
- </ Card >
227
- < Card className = { "flex-shrink-0 p-4" } >
228
- < h2 > { tc ( "backup" ) } </ h2 >
229
- < div className = "mt-2" >
230
- < h3 > { tc ( "backup path" ) } </ h3 >
231
- < Typography className = { "whitespace-normal" } >
232
- { tc ( "the backup path is the directory where alcom will create backup zips of the projects." ) }
233
- </ Typography >
234
- < div className = { "flex gap-1" } >
235
- < Input className = "flex-auto" value = { settings . project_backup_path } disabled />
236
- < Button className = { "flex-none px-4" } onClick = { selectProjectBackupFolder } > { tc ( "select" ) } </ Button >
237
- </ div >
238
- </ div >
239
- < div className = "mt-2" >
240
- < label className = { "flex items-center" } >
241
- < h3 > { tc ( "backup archive format:" ) } </ h3 >
242
- < VGSelect value = { tc ( "backup_format:" + settings . backup_format ) } onChange = { setBackupFormat } >
243
- < VGOption value = { "default" } > { tc ( "backup_format:default" ) } </ VGOption >
244
- < VGOption value = { "zip-store" } > { tc ( "backup_format:zip-store" ) } </ VGOption >
245
- < VGOption value = { "zip-fast" } > { tc ( "backup_format:zip-fast" ) } </ VGOption >
246
- < VGOption value = { "zip-best" } > { tc ( "backup_format:zip-best" ) } </ VGOption >
247
- </ VGSelect >
248
- </ label >
249
- </ div >
250
- </ Card >
251
- < Card className = { "flex-shrink-0 p-4" } >
252
- < Typography className = { "whitespace-normal" } >
229
+ </ HSectionRow >
230
+ </ HSection >
231
+ < HSection >
232
+ < HSectionTitle >
233
+ { tc ( "backup" ) }
234
+ </ HSectionTitle >
235
+ < HSectionSubTitle >
236
+ { tc ( "backup path" ) }
237
+ </ HSectionSubTitle >
238
+ < HSectionText >
239
+ { tc ( "the backup path is the directory where alcom will create backup zips of the projects." ) }
240
+ </ HSectionText >
241
+ < HSectionRow >
242
+ < Input className = "flex-auto" value = { settings . project_backup_path } disabled />
243
+ < Button className = { "flex-none px-4" } onClick = { selectProjectBackupFolder } > { tc ( "select" ) } </ Button >
244
+ </ HSectionRow >
245
+ < HSectionRow >
246
+ < HSectionSubTitle >
247
+ { tc ( "Backup archive format" ) } :
248
+ </ HSectionSubTitle >
249
+ < VGSelect value = { tc ( "backup_format:" + settings . backup_format ) } onChange = { setBackupFormat } >
250
+ < VGOption value = { "default" } > { tc ( "backup_format:default" ) } </ VGOption >
251
+ < VGOption value = { "zip-store" } > { tc ( "backup_format:zip-store" ) } </ VGOption >
252
+ < VGOption value = { "zip-fast" } > { tc ( "backup_format:zip-fast" ) } </ VGOption >
253
+ < VGOption value = { "zip-best" } > { tc ( "backup_format:zip-best" ) } </ VGOption >
254
+ </ VGSelect >
255
+ </ HSectionRow >
256
+ </ HSection >
257
+ < HSection >
258
+ < HSectionTitle >
259
+ { tc ( "Prerelease packages" ) }
260
+ </ HSectionTitle >
261
+ < HSectionText >
253
262
{ tc ( "description for show prerelease packages" ) }
254
- </ Typography >
255
- < label className = { "flex items-center" } >
263
+ </ HSectionText >
264
+ < HSectionRow >
256
265
< Checkbox checked = { settings . show_prerelease_packages } onChange = { toggleShowPrereleasePackages } />
257
266
{ tc ( "show prerelease packages" ) }
258
- </ label >
259
- </ Card >
260
- < Card className = { "flex-shrink-0 p-4" } >
261
- < label className = { "flex items-center" } >
262
- < h2 > { tc ( "language" ) } : </ h2 >
267
+ </ HSectionRow >
268
+ </ HSection >
269
+ < HSection >
270
+ < HSectionTitle >
271
+ { tc ( "language" ) }
272
+ </ HSectionTitle >
273
+ < HSectionRow >
263
274
< VGSelect value = { tc ( "langName" ) } onChange = { changeLanguage } menuClassName = { "w-96" } >
264
275
{
265
276
languages . map ( ( lang ) => (
266
277
< VGOption key = { lang } value = { lang } > { tc ( "langName" , { lng : lang } ) } </ VGOption >
267
278
) )
268
279
}
269
280
</ VGSelect >
270
- </ label >
271
- </ Card >
272
- { unityDialog }
273
- { unityHubDialog }
274
- { projectDefaultDialog }
275
- { projectBackupDialog }
276
- < Card className = { "flex-shrink-0 p-4" } >
277
- < h2 > { tc ( "check for updates" ) } </ h2 >
278
- < div >
281
+ </ HSectionRow >
282
+ </ HSection >
283
+ < HSection >
284
+ < HSectionTitle >
285
+ { tc ( "check for updates" ) }
286
+ </ HSectionTitle >
287
+ < HSectionRow >
279
288
< Button onClick = { ( ) => emit ( "tauri://update" ) } > { tc ( "check for updates" ) } </ Button >
280
- </ div >
281
- </ Card >
282
- < Card className = { "flex-shrink-0 p-4" } >
283
- < h2 > { tc ( "licenses" ) } </ h2 >
284
- < Typography className = { "whitespace-normal" } >
289
+ </ HSectionRow >
290
+ </ HSection >
291
+ < HSection >
292
+ < HSectionTitle >
293
+ { tc ( "licenses" ) }
294
+ </ HSectionTitle >
295
+ < HSectionText >
285
296
{ tc ( "click <l>here</l> to view licenses of the projects used in alcom" , { } , {
286
297
components : { l : < Link href = { "/settings/licenses" } className = { "underline" } /> }
287
298
} ) }
288
- </ Typography >
289
- </ Card >
290
- </ main >
299
+ </ HSectionText >
300
+ </ HSection >
301
+ { unityDialog }
302
+ { unityHubDialog }
303
+ { projectDefaultDialog }
304
+ { projectBackupDialog }
305
+ </ >
291
306
)
292
307
}
293
308
0 commit comments