diff --git a/src/app.css b/src/app.css index 807b04bb..68376f54 100644 --- a/src/app.css +++ b/src/app.css @@ -436,12 +436,12 @@ progress[value]::-webkit-progress-value { @apply top-[calc(var(--sait)+5rem)] md:top-[calc(var(--sait)+3rem)]; } -/* Keyboard open state adjustments */ - -body.keyboard-open .cb { - @apply bottom-sai; +.left-content { + @apply md:left-[calc(18.5rem+var(--sail))]; } +/* Keyboard open state adjustments */ + body.keyboard-open .hide-on-keyboard { display: none; } @@ -449,14 +449,10 @@ body.keyboard-open .hide-on-keyboard { /* chat view */ .chat__compose { - @apply cb cw fixed z-compose; + @apply relative z-compose mb-14 flex-grow md:mb-0; } -.chat__compose-zone { - @apply cb cw fixed z-compose; -} - -.chat__compose-zone .chat__compose-inner { +.chat__compose .chat__compose-inner { @apply min-w-0; } diff --git a/src/app/components/Chat.svelte b/src/app/components/Chat.svelte index 26e84db8..6cc312b2 100644 --- a/src/app/components/Chat.svelte +++ b/src/app/components/Chat.svelte @@ -196,8 +196,6 @@ let compose: ChatCompose | undefined = $state() let parent: TrustedEvent | undefined = $state() let eventToEdit: TrustedEvent | undefined = $state() - let chatCompose: HTMLElement | undefined = $state() - let dynamicPadding: HTMLElement | undefined = $state() const elements = $derived.by(() => { const elements = [] @@ -233,20 +231,6 @@ for (const pubkey of others) { loadMessagingRelayList(pubkey) } - - const observer = new ResizeObserver(() => { - if (dynamicPadding && chatCompose) { - dynamicPadding.style.minHeight = `${chatCompose.offsetHeight}px` - } - }) - - observer.observe(chatCompose!) - observer.observe(dynamicPadding!) - - return () => { - observer.unobserve(chatCompose!) - observer.unobserve(dynamicPadding!) - } }) setTimeout(() => { @@ -294,7 +278,6 @@ -
{#if missingRelayLists.length > 0}
@@ -335,9 +318,10 @@ {@render info?.()}

+
-
+
{#if parent} diff --git a/src/app/components/ComposeMenu.svelte b/src/app/components/ComposeMenu.svelte index 990728de..b7828d55 100644 --- a/src/app/components/ComposeMenu.svelte +++ b/src/app/components/ComposeMenu.svelte @@ -4,6 +4,7 @@ import StarFallMinimalistic from "@assets/icons/star-fall-minimalistic.svg?dataurl" import NotesMinimalistic from "@assets/icons/notes-minimalistic.svg?dataurl" import CaseMinimalistic from "@assets/icons/case-minimalistic.svg?dataurl" + import Revote from "@assets/icons/revote.svg?dataurl" import Button from "@lib/components/Button.svelte" import Icon from "@lib/components/Icon.svelte" import {pushModal} from "@app/util/modal" @@ -11,6 +12,7 @@ import ThreadCreate from "@app/components/ThreadCreate.svelte" import ClassifiedCreate from "@app/components/ClassifiedCreate.svelte" import GoalCreate from "@app/components/GoalCreate.svelte" + import PollCreate from "@app/components/PollCreate.svelte" type Props = { url: string @@ -28,6 +30,8 @@ const createClassified = () => pushModal(ClassifiedCreate, {url, h}) + const createPoll = () => pushModal(PollCreate, {url, h}) + let ul: Element onMount(() => { @@ -60,4 +64,10 @@ Create Thread +
  • + +
  • diff --git a/src/app/components/EventReply.svelte b/src/app/components/EventReply.svelte index 20a9826a..31b412a3 100644 --- a/src/app/components/EventReply.svelte +++ b/src/app/components/EventReply.svelte @@ -64,7 +64,11 @@
    -
    +
    diff --git a/src/app/components/NoteContent.svelte b/src/app/components/NoteContent.svelte index d14c6c47..8eca0dd9 100644 --- a/src/app/components/NoteContent.svelte +++ b/src/app/components/NoteContent.svelte @@ -1,10 +1,12 @@ + +
    + + {$results.voters} voter{$results.voters === 1 ? "" : "s"} +
    diff --git a/src/app/components/NoteContentPoll.svelte b/src/app/components/NoteContentPoll.svelte new file mode 100644 index 00000000..a60ecda4 --- /dev/null +++ b/src/app/components/NoteContentPoll.svelte @@ -0,0 +1,29 @@ + + +
    + + + {#if props.url} + + {/if} +
    diff --git a/src/app/components/PollCreate.svelte b/src/app/components/PollCreate.svelte new file mode 100644 index 00000000..33d3cc3e --- /dev/null +++ b/src/app/components/PollCreate.svelte @@ -0,0 +1,238 @@ + + + + + + Create a Poll + Ask a question and collect votes right in the feed. + +
    + + {#snippet label()} +

    Question*

    + {/snippet} + {#snippet input()} + + {/snippet} +
    + + + {#snippet label()} +

    Options*

    + {/snippet} + {#snippet input()} +
    + {#each options as option, index (option.id)} +
    onDragStart(e, option.id)} + ondragover={e => onDragOver(e, option.id)} + ondrop={e => onDrop(e, option.id)} + ondragend={onDragEnd}> +
    + +
    + + +
    + {/each} + +
    + {/snippet} +
    + +
    + + {#snippet label()} + Poll type + {/snippet} + {#snippet input()} + + {/snippet} + + + {#snippet label()} + Ends at + {/snippet} + {#snippet input()} + + {/snippet} + +
    +
    +
    + + + + +
    diff --git a/src/app/components/PollItem.svelte b/src/app/components/PollItem.svelte new file mode 100644 index 00000000..1f96e96a --- /dev/null +++ b/src/app/components/PollItem.svelte @@ -0,0 +1,34 @@ + + + + +
    + + Posted by + {#if h} + in + {/if} + + +
    + diff --git a/src/app/components/PollOption.svelte b/src/app/components/PollOption.svelte new file mode 100644 index 00000000..784c1fde --- /dev/null +++ b/src/app/components/PollOption.svelte @@ -0,0 +1,70 @@ + + +
    +
    + + {votes} vote{votes === 1 ? "" : "s"} +
    + +
    diff --git a/src/app/components/PollVotes.svelte b/src/app/components/PollVotes.svelte new file mode 100644 index 00000000..83448174 --- /dev/null +++ b/src/app/components/PollVotes.svelte @@ -0,0 +1,127 @@ + + +
    + {#each options as option (option.id)} + + {/each} +
    +
    + {pollType === "multiplechoice" ? "Multiple choice" : "Single choice"} + {#if endsAt} + {#if closed} + • Ended {formatTimestampRelative(endsAt)} + {:else} + • Ends {formatTimestampRelative(endsAt)} + {/if} + {/if} +
    +
    {results.voters} vote{results.voters === 1 ? "" : "s"}
    +
    +
    diff --git a/src/app/components/PrimaryNav.svelte b/src/app/components/PrimaryNav.svelte index c17ad236..32638e94 100644 --- a/src/app/components/PrimaryNav.svelte +++ b/src/app/components/PrimaryNav.svelte @@ -32,7 +32,7 @@