|
|
|
@ -1,5 +1,7 @@ |
|
|
|
<script lang="ts"> |
|
|
|
<script lang="ts"> |
|
|
|
import { login } from '$lib/stores/users' |
|
|
|
import { logged_in_user, login } from '$lib/stores/users' |
|
|
|
|
|
|
|
import UserHeader from '../users/UserHeader.svelte' |
|
|
|
|
|
|
|
import { defaults as user_defaults } from '../users/type' |
|
|
|
|
|
|
|
|
|
|
|
export let sendReply: (content: string) => void = () => {} |
|
|
|
export let sendReply: (content: string) => void = () => {} |
|
|
|
export let placeholder = 'reply...' |
|
|
|
export let placeholder = 'reply...' |
|
|
|
@ -12,27 +14,35 @@ |
|
|
|
let content = '' |
|
|
|
let content = '' |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<div class=""> |
|
|
|
<div class="flex pt-5"> |
|
|
|
<textarea |
|
|
|
<div class="mt-0 flex-none px-3"> |
|
|
|
disabled={submitting} |
|
|
|
<UserHeader |
|
|
|
bind:value={content} |
|
|
|
avatar_only={true} |
|
|
|
class="textarea textarea-primary w-full" |
|
|
|
user={$logged_in_user || { ...user_defaults, loading: false }} |
|
|
|
{placeholder} |
|
|
|
/> |
|
|
|
></textarea> |
|
|
|
</div> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex-grow pt-2"> |
|
|
|
<div class="flex-auto"></div> |
|
|
|
<textarea |
|
|
|
<button |
|
|
|
|
|
|
|
on:click={submit} |
|
|
|
|
|
|
|
disabled={submitting} |
|
|
|
disabled={submitting} |
|
|
|
class="align-right btn btn-primary btn-sm mt-2 align-bottom" |
|
|
|
bind:value={content} |
|
|
|
> |
|
|
|
class="textarea textarea-primary w-full" |
|
|
|
{#if submitting} |
|
|
|
{placeholder} |
|
|
|
Sending |
|
|
|
></textarea> |
|
|
|
{:else if !logged_in} |
|
|
|
<div class="flex"> |
|
|
|
Login before Sending |
|
|
|
<div class="flex-auto"></div> |
|
|
|
{:else} |
|
|
|
<button |
|
|
|
Send |
|
|
|
on:click={submit} |
|
|
|
{/if} |
|
|
|
disabled={submitting} |
|
|
|
</button> |
|
|
|
class="align-right btn btn-primary btn-sm mt-2 align-bottom" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{#if submitting} |
|
|
|
|
|
|
|
Sending |
|
|
|
|
|
|
|
{:else if !logged_in} |
|
|
|
|
|
|
|
Login before Sending |
|
|
|
|
|
|
|
{:else} |
|
|
|
|
|
|
|
Send |
|
|
|
|
|
|
|
{/if} |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|