fix: design shown problems in post polls/form

This commit is contained in:
Xylight committed 2025-11-16 15:56:44 -08:00
1 parent 26540cec82
commit 4605cddc60
5 files changed
+11 -12

No files matched your search

+2 -1
View File
@@ -594,7 +594,8 @@
"results": { "results": {
"show": "Show results", "show": "Show results",
"hide": "Hide results", "hide": "Hide results",
"ends": "Ends {{time}}" "ends": "Ends {{time}}",
"ended": "Ended {{time}}"
}, },
"choices": "Choices", "choices": "Choices",
"single": "Single choice", "single": "Single choice",
+2 -6
View File
@@ -429,12 +429,8 @@
} }
:global(.badge-tag-color) { :global(.badge-tag-color) {
background-color: color-mix( background-color: var(--tag-color, #fff) !important;
in oklab, color: var(--tag-text-color, #000) !important;
#eee,
var(--tag-color, #fff)
) !important;
color: color-mix(in oklab, #000, var(--tag-text-color, #000)) !important;
@variant dark { @variant dark {
background-color: color-mix( background-color: color-mix(
+1 -1
View File
@@ -73,7 +73,7 @@
let uploadImage = $state(false) let uploadImage = $state(false)
</script> </script>
{#if client() instanceof PiefedClient} {#if client() instanceof PiefedClient && !editPost}
<div class="mb-3"> <div class="mb-3">
<MultiSelect <MultiSelect
options={['normal', 'poll']} options={['normal', 'poll']}
+5 -3
View File
@@ -2,6 +2,7 @@
import { client } from '$lib/api/client.svelte' import { client } from '$lib/api/client.svelte'
import { PiefedClient } from '$lib/api/piefed/adapter' import { PiefedClient } from '$lib/api/piefed/adapter'
import type { Post, PostPoll } from '$lib/api/types' import type { Post, PostPoll } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { errorMessage } from '$lib/app/error' import { errorMessage } from '$lib/app/error'
import { t } from '$lib/app/i18n' import { t } from '$lib/app/i18n'
import { CommonList } from '$lib/ui/layout' import { CommonList } from '$lib/ui/layout'
@@ -20,13 +21,14 @@
let selected = $state<number | number[]>() let selected = $state<number | number[]>()
let chosen = $state<number>()
let canVote = $state<boolean>( let canVote = $state<boolean>(
!( !(
post.poll.end_poll && (post.poll.end_poll &&
publishedToDate(post.poll.end_poll).getTime() < Date.now() publishedToDate(post.poll.end_poll).getTime() < Date.now()) ||
!profile.current.jwt
), ),
) )
let chosen = $state<number | undefined>(canVote ? undefined : -1)
let options = $derived( let options = $derived(
post.poll.choices.map((i) => ({ post.poll.choices.map((i) => ({
+1 -1
View File
@@ -24,7 +24,7 @@
<div <div
class={[ class={[
toastColors[toast.type], toastColors[toast.type],
'relative rounded-2xl overflow-hidden flex flex-row items-center gap-1 px-2 py-2 backdrop-blur-xl', 'relative rounded-2xl overflow-hidden flex flex-row items-center gap-1 px-2 py-2 backdrop-blur-3xl',
'bg-white dark:bg-zinc-925 shadow-lg', 'bg-white dark:bg-zinc-925 shadow-lg',
toast.long ? 'w-full max-w-lg' : 'w-80', toast.long ? 'w-full max-w-lg' : 'w-80',
]} ]}