diff --git a/bun.lockb b/bun.lockb
index 3c029123..8a6fb3e3 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 43079356..2b39519c 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"eslint": "^9.28.0",
"eslint-plugin-svelte": "^3.9.1",
"jsdom": "^22.1.0",
- "lemmy-js-client": "^0.19.6-beta.1",
+ "lemmy-js-client": "0.19.11-donation-dialog.1",
"linkify-it": "^5.0.0",
"marked": "7.0.5",
"marked-linkify-it": "^3.1.10",
diff --git a/src/lib/auth.svelte.ts b/src/lib/auth.svelte.ts
index 01a65ab0..050739d8 100644
--- a/src/lib/auth.svelte.ts
+++ b/src/lib/auth.svelte.ts
@@ -18,6 +18,7 @@ import { writable } from 'svelte/store'
import { t } from './i18n/translations'
import { site } from './lemmy.svelte'
import { errorMessage } from './lemmy/error'
+import { publishedToDate } from './components/util/date'
const getDefaultProfile = (): Profile => ({
id: -1,
@@ -173,6 +174,7 @@ $effect.root(() => {
})
})
+// cookie migration code
if (
env.PUBLIC_MIGRATE_COOKIE &&
profileData.profiles.length == 0 &&
@@ -365,4 +367,38 @@ async function checkInbox() {
})
}
-setInterval(checkInbox, 4 * 60 * 1000)
+async function init() {
+ setInterval(checkInbox, 4 * 60 * 1000)
+
+ // hacky way to check donation status
+ setTimeout(() => {
+ if (
+ profile.data.user?.local_user_view.local_user.last_donation_notification
+ ) {
+ const donationDate = publishedToDate(
+ profile.data.user?.local_user_view.local_user
+ .last_donation_notification,
+ )
+ if (Date.now() - donationDate.getTime() > 365 * 24 * 60 * 60 * 1000) {
+ toast({
+ content: t.get('toast.lemmyDonate'),
+ duration: 3600 * 1000,
+ long: true,
+ })
+
+ // lemmy js client donation dialog is broken
+ fetch(
+ `${instanceToURL(profile.data.instance)}/api/v3/user/donation_dialog_shown`,
+ {
+ method: 'POST',
+ headers: {
+ authorization: `Bearer ${profile.data.jwt}`,
+ },
+ },
+ )
+ }
+ }
+ }, 3 * 1000)
+}
+
+init()
diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte
index a8732c63..e2e717a4 100644
--- a/src/lib/components/lemmy/comment/Comment.svelte
+++ b/src/lib/components/lemmy/comment/Comment.svelte
@@ -112,7 +112,7 @@
class={[
'py-3 relative',
node.comment_view.comment.distinguished &&
- ' text-primary-900 dark:text-primary-100',
+ ' text-primary-900 dark:text-primary-100 bg-green-400/5 -mx-4 sm:-mx-6 px-4 sm:px-6',
clazz,
]}
id={node.comment_view.comment.id.toString()}
diff --git a/src/lib/components/ui/navbar/Profile.svelte b/src/lib/components/ui/navbar/Profile.svelte
index 57da4e30..0c823116 100644
--- a/src/lib/components/ui/navbar/Profile.svelte
+++ b/src/lib/components/ui/navbar/Profile.svelte
@@ -182,7 +182,7 @@
Debug
{/if}
-
+
diff --git a/src/lib/components/ui/navbar/commands/Commands.svelte b/src/lib/components/ui/navbar/commands/Commands.svelte
index 3ec8f9be..80fc460e 100644
--- a/src/lib/components/ui/navbar/commands/Commands.svelte
+++ b/src/lib/components/ui/navbar/commands/Commands.svelte
@@ -268,7 +268,7 @@
>
- {#each breadcrumbs as crumb (crumb.href)}
+ {#each breadcrumbs as crumb}
/
{crumb.name}
@@ -277,11 +277,11 @@
{/if}
- {#each filteredGroups as group, groupIndex (group.name)}
+ {#each filteredGroups as group, groupIndex}
{group.name}
- {#each group.actions as action, actionIndex (action.href)}
+ {#each group.actions as action, actionIndex}
{@const globalIndex =
filteredGroups
.slice(0, groupIndex)
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index d60dc5ff..34a2d154 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -498,7 +498,8 @@
"comments": "Comments",
"communities": "Communities",
"instances": "Instances",
- "message": "Message"
+ "message": "Message",
+ "url": "URL"
},
"post": {
"actions": {
@@ -692,7 +693,8 @@
"purgeUser": "Purged that user.",
"settingsImport": "Successfully imported settings",
"settingsImportWarning": "The imported settings don't seem valid. Are you sure you want to import this?",
- "userLoading": "Still loading your user data..."
+ "userLoading": "Still loading your user data...",
+ "lemmyDonate": "Your account's instance runs Lemmy, and the developers are requesting donations. They are able to develop Lemmy as an open source platform, free of tracking and ads, thanks to the generosity of its users.\n\nAnnually, they ask you to consider donating to support their work, and allow them to continue maintaining and improving Lemmy.\n\n[Donate](https://join-lemmy.org/donate)\n\n*Note: this is a donation to Lemmy, not Photon.*"
},
"settings": {
"title": "Settings",
diff --git a/src/lib/mono/toast/Toast.svelte b/src/lib/mono/toast/Toast.svelte
index d33fecfa..42e1fcf9 100644
--- a/src/lib/mono/toast/Toast.svelte
+++ b/src/lib/mono/toast/Toast.svelte
@@ -12,6 +12,7 @@
Check,
} from 'svelte-hero-icons'
import { fly } from 'svelte/transition'
+ import Markdown from '$lib/components/markdown/Markdown.svelte'
interface Props {
toast: Toast
@@ -21,9 +22,11 @@
{/if}
-
+
{#if toast.title}
{toast.title}
{/if}
-
{toast.content}
+
{#if toast.action}
@@ -64,18 +72,18 @@
toast.action?.()
toasts.update(toasts => toasts.filter(t => t.id != toast.id))
}}
- class="rounded-lg w-max transition-colors hover:bg-black/20 dark:hover:bg-white/20 p-2"
+ class="rounded-lg w-max transition-colors hover:bg-slate-100 dark:hover:bg-zinc-800 p-1 cursor-pointer"
>
-
+
{/if}
{
toasts.update(toasts => toasts.filter(t => t.id != toast.id))
}}
- class="rounded-lg w-max transition-colors hover:bg-black/20 dark:hover:bg-white/20 p-2"
+ class="rounded-lg w-max transition-colors hover:bg-slate-100 dark:hover:bg-zinc-800 p-1 cursor-pointer"
>
-
+
diff --git a/src/lib/mono/toast/toasts.ts b/src/lib/mono/toast/toasts.ts
index 577e15e4..8f7f684d 100644
--- a/src/lib/mono/toast/toasts.ts
+++ b/src/lib/mono/toast/toasts.ts
@@ -3,13 +3,12 @@ import { writable } from 'svelte/store'
type ToastType = keyof typeof toastColors
export const toastColors = {
- error:
- 'bg-white dark:bg-zinc-950 text-red-600 dark:text-red-400 border border-red-700',
+ error: 'bg-white dark:bg-zinc-925 text-red-500 shadow-red-400/30 shadow-sm',
warning:
- 'bg-white dark:bg-zinc-950 text-yellow-600 dark:text-yellow-400 border border-yellow-600',
+ 'bg-white dark:bg-zinc-925 text-yellow-500 shadow-yellow-400/30 shadow-sm',
success:
- 'bg-white dark:bg-zinc-950 text-green-700 dark:text-green-400 border border-green-500',
- info: 'dark:bg-zinc-950 bg-white border border-slate-200 dark:border-zinc-800 shadow-lg',
+ 'bg-white dark:bg-zinc-925 text-green-700 shadow-green-400/30 shadow-sm',
+ info: 'dark:bg-zinc-925 bg-white border border-slate-200 dark:border-zinc-800',
}
export interface Toast {
@@ -18,6 +17,7 @@ export interface Toast {
content: string
type: ToastType
loading?: boolean
+ long?: boolean
action?: () => void
}
@@ -29,6 +29,7 @@ export function toast({
type = 'info',
duration = 5000,
loading = false,
+ long = false,
action,
}: {
title?: string
@@ -36,6 +37,7 @@ export function toast({
type?: ToastType
duration?: number
loading?: boolean
+ long?: boolean
action?: () => void
}) {
let id = 0
@@ -51,6 +53,7 @@ export function toast({
title: title,
type: type,
loading: loading,
+ long: long,
action: action,
},
]
diff --git a/src/routes/inbox/+page.ts b/src/routes/inbox/+page.ts
index a5d9f5b4..d9da1c8f 100644
--- a/src/routes/inbox/+page.ts
+++ b/src/routes/inbox/+page.ts
@@ -58,7 +58,10 @@ export async function load({ url, fetch }) {
publishedToDate(a.published).getTime(),
)
- const totalNotifs = type == 'all' ? data.filter(i => !i.read).length : 0
+ const totalNotifs =
+ type == 'all'
+ ? data.filter(i => i.type != 'private_message' && !i.read).length
+ : 0
notifications.update(i => ({
applications: i.applications,
diff --git a/src/routes/search/+page.svelte b/src/routes/search/+page.svelte
index a9ebf861..cc6a5184 100644
--- a/src/routes/search/+page.svelte
+++ b/src/routes/search/+page.svelte
@@ -11,7 +11,6 @@
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Skeleton from '$lib/components/ui/generic/Skeleton.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
- import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { t } from '$lib/i18n/translations.js'
import {
isCommentView,
@@ -20,16 +19,17 @@
isUser,
} from '$lib/lemmy/item.js'
import { searchParam } from '$lib/util.svelte.js'
- import { Button, Select, Spinner, TextInput } from 'mono-svelte'
+ import { Button, Select, Spinner } from 'mono-svelte'
import Option from 'mono-svelte/forms/select/Option.svelte'
import {
AdjustmentsHorizontal,
- ChevronDown,
+ ChevronDoubleDown,
Icon,
MagnifyingGlass,
} from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import { fly, slide } from 'svelte/transition'
+ import SearchBar from './SearchBar.svelte'
let { data } = $props()
@@ -55,33 +55,7 @@
{$t('routes.search.title')}
{#if moreOptions}
-
+
+ import { navigating } from '$app/state'
+ import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
+ import { t } from '$lib/i18n/translations'
+ import { Button, TextInput } from 'mono-svelte'
+ import { Icon, MagnifyingGlass } from 'svelte-hero-icons'
+
+ interface Props {
+ query?: string | null
+ }
+
+ let { query = $bindable() }: Props = $props()
+
+ let searchElement = $state()
+
+
+
+
+
+
+
+ {#snippet prefix()}
+
+ {/snippet}
+
+
+
+