✨ Login promote
This commit is contained in:
parent
f8f8c3c3b5
commit
9bc270c12f
@ -105,6 +105,14 @@ export default function PostItem(props: {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={!props.noControl}>
|
<Show when={!props.noControl}>
|
||||||
|
<div class="relative">
|
||||||
|
<Show when={!userinfo?.isLoggedIn}>
|
||||||
|
<div
|
||||||
|
class="px-7 py-2.5 h-12 w-full opacity-0 transition-opacity hover:opacity-100 bg-base-100 border-t border-base-200 z-[1] absolute top-0 left-0">
|
||||||
|
<b>Login!</b> To access entire platform.
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
|
|
||||||
<div class="grid grid-cols-3 border-y border-base-200">
|
<div class="grid grid-cols-3 border-y border-base-200">
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
<div class="tooltip" data-tip="Daisuki">
|
<div class="tooltip" data-tip="Daisuki">
|
||||||
@ -155,6 +163,7 @@ export default function PostItem(props: {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,6 +15,17 @@ export default function PostPublish(props: {
|
|||||||
}) {
|
}) {
|
||||||
const userinfo = useUserinfo();
|
const userinfo = useUserinfo();
|
||||||
|
|
||||||
|
if (!userinfo?.isLoggedIn) {
|
||||||
|
return (
|
||||||
|
<div class="py-9 flex justify-center items-center">
|
||||||
|
<div class="text-center">
|
||||||
|
<h2 class="text-lg font-bold">Login!</h2>
|
||||||
|
<p>Or keep silent.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const [submitting, setSubmitting] = createSignal(false);
|
const [submitting, setSubmitting] = createSignal(false);
|
||||||
const [uploading, setUploading] = createSignal(false);
|
const [uploading, setUploading] = createSignal(false);
|
||||||
|
|
||||||
@ -61,8 +72,8 @@ export default function PostPublish(props: {
|
|||||||
props.onError(await res.text());
|
props.onError(await res.text());
|
||||||
} else {
|
} else {
|
||||||
form.reset();
|
form.reset();
|
||||||
props.onPost();
|
|
||||||
props.onError(null);
|
props.onError(null);
|
||||||
|
setTimeout(() => props.onPost(), 250);
|
||||||
}
|
}
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
}
|
}
|
||||||
@ -97,8 +108,8 @@ export default function PostPublish(props: {
|
|||||||
props.onError(await res.text());
|
props.onError(await res.text());
|
||||||
} else {
|
} else {
|
||||||
form.reset();
|
form.reset();
|
||||||
props.onPost();
|
|
||||||
props.onError(null);
|
props.onError(null);
|
||||||
|
setTimeout(() => props.onPost(), 250);
|
||||||
}
|
}
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
}
|
}
|
||||||
@ -135,7 +146,7 @@ export default function PostPublish(props: {
|
|||||||
|
|
||||||
setAttachments(attachments().concat([{
|
setAttachments(attachments().concat([{
|
||||||
...data,
|
...data,
|
||||||
author_id: userinfo?.profiles?.id,
|
author_id: userinfo?.profiles?.id
|
||||||
}]));
|
}]));
|
||||||
form.reset();
|
form.reset();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user