feat: add old sort

This commit is contained in:
Xyphyn committed 2023-08-02 13:00:51 -07:00
1 parent f7c0862642
commit 448c9e66e3
4 files changed
+11 -12

No files matched your search

+4 -6
View File
@@ -5,8 +5,6 @@
export let disabled: boolean[] = []
export let optionNames: string[] = []
export let selected: T
let clazz = ''
export { clazz as class }
const dispatcher = createEventDispatcher<{ select: T }>()
$: {
dispatcher('select', selected)
@@ -14,8 +12,9 @@
</script>
<div
class="flex overflow-hidden flex-row items-center max-w-full w-max bg-slate-100
rounded-lg dark:bg-zinc-900 gap-1 p-1 border border-slate-200 dark:border-zinc-800 flex-wrap"
class="flex overflow-auto flex-row items-center max-w-full w-max bg-slate-100
rounded-lg dark:bg-zinc-900 gap-1 p-1 border border-slate-200 dark:border-zinc-800
{$$props.class}"
>
{#each options as option, index}
<button
@@ -25,8 +24,7 @@
? 'bg-slate-900 text-slate-50 dark:bg-zinc-100 dark:text-black\
hover:bg-slate-800 hover:dark:bg-zinc-300'
: ' hover:bg-slate-200 hover:dark:bg-zinc-800'}
{clazz}
disabled:opacity-60 disabled:pointer-events-none"
disabled:opacity-60 disabled:pointer-events-none whitespace-nowrap"
on:click={() => (selected = option)}
disabled={disabled[index] ?? false}
>
+3 -2
View File
@@ -55,8 +55,8 @@
}}
/>
<MultiSelect
options={['Active', 'Hot', 'TopAll', 'New']}
optionNames={['Active', 'Hot', 'Top', 'New']}
options={['Active', 'Hot', 'TopAll', 'New', 'Old']}
optionNames={['Active', 'Hot', 'Top', 'New', 'Old']}
selected={data.sort}
on:select={(e) => {
const url = $page.url
@@ -66,6 +66,7 @@
invalidateAll: true,
})
}}
class="w-full md:max-w-[20rem]"
/>
</div>
<section class="flex flex-col gap-4">
+2 -2
View File
@@ -62,8 +62,8 @@
</div>
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
<MultiSelect
options={['Active', 'Hot', 'TopAll', 'New']}
optionNames={['Active', 'Hot', 'Top', 'New']}
options={['Active', 'Hot', 'TopAll', 'New', 'Old']}
optionNames={['Active', 'Hot', 'Top', 'New', 'Old']}
selected={$page.url.searchParams.get('sort') ??
$userSettings.defaultSort.sort}
on:select={(e) => {
+2 -2
View File
@@ -136,8 +136,8 @@
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<div class="flex flex-row gap-4 flex-wrap">
<MultiSelect
options={['New', 'TopAll']}
optionNames={['New', 'Top']}
options={['New', 'TopAll', 'Old']}
optionNames={['New', 'Top', 'Old']}
selected={data.sort}
on:select={(e) => {
$page.url.searchParams.set('sort', e.detail)