|
16 | 16 | import ImageDiff from "$lib/components/diff/ImageDiff.svelte"; |
17 | 17 | import AddedOrRemovedImage from "$lib/components/diff/AddedOrRemovedImage.svelte"; |
18 | 18 | import DiffStats from "$lib/components/diff/DiffStats.svelte"; |
19 | | - import SettingsPopover from "$lib/components/settings-popover/SettingsPopover.svelte"; |
| 19 | + import SettingsPopover, { globalThemeSetting } from "$lib/components/settings-popover/SettingsPopover.svelte"; |
20 | 20 | import SettingsPopoverGroup from "$lib/components/settings-popover/SettingsPopoverGroup.svelte"; |
21 | 21 | import LabeledCheckbox from "$lib/components/LabeledCheckbox.svelte"; |
22 | 22 | import ShikiThemeSelector from "$lib/components/settings-popover/ShikiThemeSelector.svelte"; |
23 | 23 | import SimpleRadioGroup from "$lib/components/settings-popover/SimpleRadioGroup.svelte"; |
24 | 24 | import DiffSearch from "./DiffSearch.svelte"; |
25 | 25 | import FileHeader from "./FileHeader.svelte"; |
26 | 26 | import DiffTitle from "./DiffTitle.svelte"; |
27 | | - import { type Action } from "svelte"; |
| 27 | + import { type Action } from "svelte/action"; |
28 | 28 | import { on } from "svelte/events"; |
29 | 29 | import ActionsPopover from "./ActionsPopover.svelte"; |
30 | 30 | import OpenDiffDialog from "./OpenDiffDialog.svelte"; |
|
114 | 114 |
|
115 | 115 | {#snippet settingsPopover()} |
116 | 116 | <SettingsPopover class="self-center"> |
117 | | - {#snippet children({ globalThemeSetting })} |
118 | | - {@render globalThemeSetting()} |
119 | | - <SettingsPopoverGroup title="Syntax Highlighting"> |
120 | | - <LabeledCheckbox labelText="Enable" bind:checked={globalOptions.syntaxHighlighting} /> |
121 | | - <ShikiThemeSelector mode="light" bind:value={globalOptions.syntaxHighlightingThemeLight} /> |
122 | | - <ShikiThemeSelector mode="dark" bind:value={globalOptions.syntaxHighlightingThemeDark} /> |
123 | | - </SettingsPopoverGroup> |
124 | | - <SettingsPopoverGroup title="Misc."> |
125 | | - <LabeledCheckbox labelText="Concise nested diffs" bind:checked={globalOptions.omitPatchHeaderOnlyHunks} /> |
126 | | - <LabeledCheckbox labelText="Word diffs" bind:checked={globalOptions.wordDiffs} /> |
127 | | - <LabeledCheckbox labelText="Line wrapping" bind:checked={globalOptions.lineWrap} /> |
128 | | - {#if viewer.isPRDiff()} |
129 | | - <LabeledCheckbox labelText="Show PR comments" bind:checked={viewer.showComments} /> |
130 | | - {/if} |
131 | | - <div class="flex justify-between px-2 py-1"> |
132 | | - <Label.Root id="sidebarLocationLabel" for="sidebarLocation">Sidebar location</Label.Root> |
133 | | - <SimpleRadioGroup |
134 | | - id="sidebarLocation" |
135 | | - aria-labelledby="sidebarLocationLabel" |
136 | | - values={["left", "right"]} |
137 | | - bind:value={globalOptions.sidebarLocation} |
138 | | - /> |
139 | | - </div> |
140 | | - </SettingsPopoverGroup> |
141 | | - {/snippet} |
| 117 | + {@render globalThemeSetting()} |
| 118 | + <SettingsPopoverGroup title="Syntax Highlighting"> |
| 119 | + <LabeledCheckbox labelText="Enable" bind:checked={globalOptions.syntaxHighlighting} /> |
| 120 | + <ShikiThemeSelector mode="light" bind:value={globalOptions.syntaxHighlightingThemeLight} /> |
| 121 | + <ShikiThemeSelector mode="dark" bind:value={globalOptions.syntaxHighlightingThemeDark} /> |
| 122 | + </SettingsPopoverGroup> |
| 123 | + <SettingsPopoverGroup title="Misc."> |
| 124 | + <LabeledCheckbox labelText="Concise nested diffs" bind:checked={globalOptions.omitPatchHeaderOnlyHunks} /> |
| 125 | + <LabeledCheckbox labelText="Word diffs" bind:checked={globalOptions.wordDiffs} /> |
| 126 | + <LabeledCheckbox labelText="Line wrapping" bind:checked={globalOptions.lineWrap} /> |
| 127 | + {#if viewer.isPRDiff()} |
| 128 | + <LabeledCheckbox labelText="Show PR comments" bind:checked={viewer.showComments} /> |
| 129 | + {/if} |
| 130 | + <div class="flex justify-between px-2 py-1"> |
| 131 | + <Label.Root id="sidebarLocationLabel" for="sidebarLocation">Sidebar location</Label.Root> |
| 132 | + <SimpleRadioGroup |
| 133 | + id="sidebarLocation" |
| 134 | + aria-labelledby="sidebarLocationLabel" |
| 135 | + values={["left", "right"]} |
| 136 | + bind:value={globalOptions.sidebarLocation} |
| 137 | + /> |
| 138 | + </div> |
| 139 | + </SettingsPopoverGroup> |
142 | 140 | </SettingsPopover> |
143 | 141 | {/snippet} |
144 | 142 |
|
|
0 commit comments