migrate: fix some pages

This commit is contained in:
Xylight committed 2024-10-25 19:37:32 -07:00
1 parent 10ef4123da
commit ffcd9faa96
4 files changed
+54 -43

No files matched your search

+7 -7
View File
@@ -25,7 +25,7 @@
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
import { expoOut } from 'svelte/easing'
let { data } = $props();
let { data } = $props()
let markingAsRead = $state(false)
@@ -52,7 +52,7 @@
function addSearchParam(
currentSearchParams: URLSearchParams,
newParamString: string
newParamString: string,
) {
// Create a new URLSearchParams object from the current search params
const updatedParams = new URLSearchParams(currentSearchParams)
@@ -142,8 +142,8 @@ items-center px-2 w-max"
title={$t('common.refresh')}
>
{#snippet prefix()}
<Icon src={ArrowPath} size="16" mini />
{/snippet}
<Icon src={ArrowPath} size="16" mini />
{/snippet}
</Button>
<Button
on:click={markAllAsRead}
@@ -153,8 +153,8 @@ items-center px-2 w-max"
class="h-10"
>
{#snippet prefix()}
<Icon src={Check} width={16} mini />
{/snippet}
<Icon src={Check} width={16} mini />
{/snippet}
{$t('routes.inbox.markAsRead')}
</Button>
</div>
@@ -183,7 +183,7 @@ items-center px-2 w-max"
delay: index * 50,
}}
>
<InboxItem bind:item />
<InboxItem bind:item={data.data[index]} />
</div>
{/each}
{/if}
+11 -13
View File
@@ -70,8 +70,8 @@
class="grid grid-cols-1 @md:grid-cols-2 @xl:grid-cols-3 @3xl:grid-cols-4
gap-2"
>
{#each $themeData.themes as theme}
<ThemePreset bind:theme />
{#each $themeData.themes as theme, index}
<ThemePreset bind:theme={$themeData.themes[index]} />
{/each}
<button
onclick={() => {
@@ -165,11 +165,10 @@
<h1 class="text-2xl font-bold col-span-2">{$t('routes.theme.accent')}</h1>
<ColorSwatch
value={$theme.colors.primary?.[900]}
on:change={(e) => {
$theme.colors.primary[900] = e.detail
onchange={(e) => {
$theme.colors.primary[900] = e
}}
backgroundColor={defaultColors.primary[900]}
on:contextmenu={(e) => {
oncontextmenu={(e) => {
e.preventDefault()
$theme.colors.primary[900] =
// @ts-ignore
@@ -181,11 +180,10 @@
/>
<ColorSwatch
value={$theme.colors.primary?.[100]}
on:change={(e) => {
$theme.colors.primary[100] = e.detail
onchange={(e) => {
$theme.colors.primary[100] = e
}}
backgroundColor={defaultColors.primary[100]}
on:contextmenu={(e) => {
oncontextmenu={(e) => {
e.preventDefault()
$theme.colors.primary[100] =
// @ts-ignore
@@ -212,10 +210,10 @@
<!--@ts-ignore-->
<ColorSwatch
bind:value={$theme.colors[category][shade]}
on:change={(e) => {
$theme.colors[category][shade] = e.detail
onchange={(e) => {
$theme.colors[category][shade] = e
}}
on:contextmenu={(e) => {
oncontextmenu={(e) => {
e.preventDefault()
$theme.colors[category][shade] =
// @ts-ignore
+13 -11
View File
@@ -1,20 +1,22 @@
<script lang="ts">
import { createBubbler } from 'svelte/legacy';
import { createBubbler } from 'svelte/legacy'
const bubble = createBubbler();
import { hexToRgb } from '$lib/ui/colors'
import { createEventDispatcher } from 'svelte'
const dispatch = createEventDispatcher<{ change: string }>()
interface Props {
value: string;
class?: string;
value: string
class?: string
oncontextmenu?: (e: MouseEvent) => any
onchange?: (value: string) => any
}
let { value = $bindable(), class: clazz = '' }: Props = $props();
let {
value = $bindable(),
oncontextmenu,
onchange,
class: clazz = '',
}: Props = $props()
</script>
<div
@@ -26,7 +28,7 @@
class="rounded-md border cursor-pointer absolute top-0 left-0 w-full h-full opacity-0"
type="color"
bind:value
onchange={() => dispatch('change', hexToRgb(value))}
oncontextmenu={bubble('contextmenu')}
onchange={() => onchange?.(hexToRgb(value))}
{oncontextmenu}
/>
</div>