|
2 | 2 | import * as RadioGroup from '$lib/components/ui/radio-group'; |
3 | 3 | import { t } from 'svelte-i18n-lingui'; |
4 | 4 | import { views } from '$lib/views/view-data'; |
5 | | - import { useCurrentView, useViewSettings } from '$lib/views/view-service'; |
6 | | - import Label from '$lib/components/ui/label/label.svelte'; |
| 5 | + import { useCurrentView } from '$lib/views/view-service'; |
7 | 6 | import Switch from '$lib/components/ui/switch/switch.svelte'; |
8 | 7 | import ResponsivePopup from '$lib/components/responsive-popup/responsive-popup.svelte'; |
9 | 8 | import {Button} from '$lib/components/ui/button'; |
|
17 | 16 | readonly?: boolean |
18 | 17 | } = $props(); |
19 | 18 | const currentView = useCurrentView(); |
20 | | - const viewSettings = useViewSettings(); |
21 | 19 | function getCurrentView() { |
22 | 20 | return $currentView.id; |
23 | 21 | } |
|
29 | 27 | {#snippet trigger({props})} |
30 | 28 | <Button {...props} size="icon" variant="ghost" icon="i-mdi-layers" /> |
31 | 29 | {/snippet} |
32 | | - <div class="space-y-4"> |
| 30 | + <div class="space-y-2 md:space-y-4"> |
33 | 31 | <RadioGroup.Root bind:value={getCurrentView, setCurrentView}> |
34 | | - <h3 class="font-normal">{$t`Field Labels`}</h3> |
| 32 | + <h3 class="font-normal max-md:mb-1">{$t`Field Labels`}</h3> |
35 | 33 | {#each views as view} |
36 | | - <div class="flex items-center space-x-2"> |
37 | | - <RadioGroup.Item value={view.id} id={view.id} /> |
38 | | - <Label for={view.id}> |
39 | | - {view.label} |
40 | | - </Label> |
41 | | - </div> |
| 34 | + <RadioGroup.Item value={view.id} label={view.label} /> |
42 | 35 | {/each} |
43 | 36 | </RadioGroup.Root> |
44 | | - <div class="space-y-2"> |
45 | | - <h3 class="font-normal">{$t`View Settings`}</h3> |
46 | | - <div class="flex items-center space-x-2"> |
47 | | - <Switch |
48 | | - id="showEmptyFields" |
49 | | - bind:checked={() => $viewSettings.showEmptyFields, |
50 | | - (value) => ($viewSettings = { ...$viewSettings, showEmptyFields: value })} |
51 | | - /> |
52 | | - <Label for="showEmptyFields">{$t`Show Empty Fields`}</Label> |
53 | | - </div> |
54 | | - </div> |
55 | 37 | <RadioGroup.Root bind:value={dictionaryPreview}> |
56 | | - <h3 class="font-normal">{$t`Dictionary Preview`}</h3> |
57 | | - <div class="flex items-center space-x-2"> |
58 | | - <RadioGroup.Item value="show" id="show"/> |
59 | | - <Label for="show"> |
60 | | - {$t`Show`} |
61 | | - </Label> |
62 | | - </div> |
63 | | - <div class="flex items-center space-x-2"> |
64 | | - <RadioGroup.Item value="hide" id="hide"/> |
65 | | - <Label for="hide"> |
66 | | - {$t`Hide`} |
67 | | - </Label> |
68 | | - </div> |
69 | | - <div class="flex items-center space-x-2"> |
70 | | - <RadioGroup.Item value="sticky" id="sticky"/> |
71 | | - <Label for="sticky"> |
72 | | - {$t`Pinned`} |
73 | | - </Label> |
74 | | - </div> |
| 38 | + <h3 class="font-normal max-md:mb-1">{$t`Dictionary Preview`}</h3> |
| 39 | + <RadioGroup.Item value="show" label={$t`Show`} /> |
| 40 | + <RadioGroup.Item value="hide" label={$t`Hide`}/> |
| 41 | + <RadioGroup.Item value="sticky" label={$t`Pinned`}/> |
75 | 42 | </RadioGroup.Root> |
76 | 43 | <DevContent> |
77 | 44 | <div class="space-y-2"> |
|
0 commit comments