design: make disabled buttons not look like buns

This commit is contained in:
Xylight committed 2025-09-27 10:16:42 -07:00
1 parent f54e6242b3
commit e55d8abfa7
6 files changed
+21 -19

No files matched your search

+1 -1
View File
@@ -224,7 +224,7 @@ function isObject(item: object) {
* @param ...sources * @param ...sources
*/ */
function mergeDeep(target: any, ...sources: any[]) { export function mergeDeep(target: any, ...sources: any[]) {
if (!sources.length) return target if (!sources.length) return target
const source = sources.shift() const source = sources.shift()
+2 -2
View File
@@ -315,11 +315,11 @@
.btn-disabled { .btn-disabled {
pointer-events: none; pointer-events: none;
filter: brightness(90%); opacity: 0.6;
cursor: normal; cursor: normal;
@variant dark { @variant dark {
filter: brightness(70%); opacity: 0.5;
} }
} }
} }
@@ -19,9 +19,9 @@
old_password: oldPassword, old_password: oldPassword,
}) })
if (res?.jwt) { if (res?.jwt) {
const { instance } = profile.current const { instance, client } = profile.current
profile.remove(profile.current.id) profile.remove(profile.current.id)
await profile.add(res.jwt, instance) await profile.add(res.jwt, instance, client)
toast({ content: $t('toast.loginRefresh'), type: 'success' }) toast({ content: $t('toast.loginRefresh'), type: 'success' })
} else { } else {
-2
View File
@@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
import { navigating, page } from '$app/state' import { navigating, page } from '$app/state'
import { client } from '$lib/api/client.svelte' import { client } from '$lib/api/client.svelte'
import { profile } from '$lib/app/auth.svelte'
import { t } from '$lib/app/i18n' import { t } from '$lib/app/i18n'
import { searchParam } from '$lib/app/util.svelte' import { searchParam } from '$lib/app/util.svelte'
import CommentItem from '$lib/feature/comment/CommentItem.svelte' import CommentItem from '$lib/feature/comment/CommentItem.svelte'
@@ -103,7 +102,6 @@
> >
<ObjectAutocomplete <ObjectAutocomplete
label={$t('nav.create.community')} label={$t('nav.create.community')}
jwt={profile.current?.jwt}
listing_type="All" listing_type="All"
showWhenEmpty={true} showWhenEmpty={true}
onselect={(c) => onselect={(c) =>
+12 -9
View File
@@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/state' import { page } from '$app/state'
import type { ClientType } from '$lib/api/base.js'
import { getClient } from '$lib/api/client.svelte' import { getClient } from '$lib/api/client.svelte'
import type { GetCaptchaResponse } from '$lib/api/types' import type { GetCaptchaResponse } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte' import { profile } from '$lib/app/auth.svelte'
@@ -51,13 +52,15 @@
let username = $state(''), let username = $state(''),
password = $state(''), password = $state(''),
passwordVerify = $state(''), passwordVerify = $state(''),
captcha: GetCaptchaResponse | null = $state(null), captcha = $state<GetCaptchaResponse>(),
verifyCaptcha: string | undefined = $state(undefined), verifyCaptcha = $state<string>(),
application: string = $state(''), application = $state(''),
submitting: boolean = $state(false), submitting = $state(false),
honeypot: string | undefined = $state(undefined), honeypot = $state<string>(),
nsfw: boolean = $state(false), nsfw = $state(false),
verifying: boolean = $state(false) verifying = $state(false)
const instanceType: ClientType = $state({ name: 'lemmy', baseUrl: '/api/v3' })
const getCaptcha = async () => const getCaptcha = async () =>
(captcha = await getClient(instance, fetch).getCaptcha()) (captcha = await getClient(instance, fetch).getCaptcha())
@@ -86,7 +89,7 @@
const registrationMode = data.site_view.local_site.registration_mode const registrationMode = data.site_view.local_site.registration_mode
if (res?.jwt) { if (res?.jwt) {
await profile.add(res.jwt, page.params.instance) await profile.add(res.jwt, page.params.instance!, instanceType)
toast({ content: $t('toast.logIn'), type: 'success' }) toast({ content: $t('toast.logIn'), type: 'success' })
goto('/') goto('/')
@@ -125,7 +128,7 @@
}) })
if (res.jwt) { if (res.jwt) {
await profile.add(res.jwt, page.params.instance) await profile.add(res.jwt, data.instance, instanceType)
goto('/') goto('/')
} else if (res.verify_email_sent) { } else if (res.verify_email_sent) {
pushError({ pushError({
+4 -3
View File
@@ -1,7 +1,8 @@
import { getClient } from '$lib/api/client.svelte' import { client } from '$lib/api/client.svelte'
import { SvelteURL } from 'svelte/reactivity'
export async function load({ params, fetch }) { export async function load({ params, fetch }) {
const site = await getClient(params.instance, fetch).getSite() const site = await client({ instanceURL: params.instance, func: fetch}).getSite()
return site return {...site, instance: new SvelteURL(site.site_view.site.actor_id).hostname}
} }