fix: op incorrectly detected
This commit is contained in:
4 files changed
+20
-15
No files matched your search
@@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: CommentNodeI
|
node: CommentNodeI
|
||||||
postId: number
|
|
||||||
op?: boolean
|
|
||||||
actions?: boolean
|
actions?: boolean
|
||||||
meta?: boolean
|
meta?: boolean
|
||||||
open?: boolean
|
open?: boolean
|
||||||
@@ -45,8 +43,6 @@
|
|||||||
|
|
||||||
let {
|
let {
|
||||||
node = $bindable(),
|
node = $bindable(),
|
||||||
postId,
|
|
||||||
op = false,
|
|
||||||
actions = true,
|
actions = true,
|
||||||
meta = true,
|
meta = true,
|
||||||
replying = $bindable(false),
|
replying = $bindable(false),
|
||||||
@@ -125,6 +121,8 @@
|
|||||||
id={node.comment_view.comment.id.toString()}
|
id={node.comment_view.comment.id.toString()}
|
||||||
>
|
>
|
||||||
{#if meta}
|
{#if meta}
|
||||||
|
{@const creatorIsOp =
|
||||||
|
node.comment_view.creator.id == node.comment_view.post.creator_id}
|
||||||
<label
|
<label
|
||||||
for="comment-expand-{node.comment_view.comment.id}"
|
for="comment-expand-{node.comment_view.comment.id}"
|
||||||
class="flex flex-row cursor-pointer gap-2 items-center group text-sm flex-wrap w-full z-0 group relative"
|
class="flex flex-row cursor-pointer gap-2 items-center group text-sm flex-wrap w-full z-0 group relative"
|
||||||
@@ -154,7 +152,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{@render metaSuffix?.()}
|
{@render metaSuffix?.()}
|
||||||
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
|
<span
|
||||||
|
class={[
|
||||||
|
'flex flex-row gap-1 items-center',
|
||||||
|
creatorIsOp && 'text-blue-600 dark:text-blue-400 font-bold',
|
||||||
|
]}
|
||||||
|
>
|
||||||
<UserLink
|
<UserLink
|
||||||
inComment
|
inComment
|
||||||
avatarSize={20}
|
avatarSize={20}
|
||||||
@@ -182,8 +185,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</UserLink>
|
</UserLink>
|
||||||
{#if op}
|
{#if creatorIsOp}
|
||||||
<Icon mini size="16" src={Microphone} class="text-sky-600" />
|
<Icon
|
||||||
|
mini
|
||||||
|
size="16"
|
||||||
|
src={Microphone}
|
||||||
|
class="text-blue-500 dark:text-blue-400"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<RelativeDate
|
<RelativeDate
|
||||||
@@ -281,7 +289,7 @@
|
|||||||
<div transition:slide={{ duration: 600, easing: expoOut }}>
|
<div transition:slide={{ duration: 600, easing: expoOut }}>
|
||||||
<CommentForm
|
<CommentForm
|
||||||
label={$t('comment.reply')}
|
label={$t('comment.reply')}
|
||||||
{postId}
|
postId={node.comment_view.post.id}
|
||||||
parentId={node.comment_view.comment.id}
|
parentId={node.comment_view.comment.id}
|
||||||
oncomment={(e) => {
|
oncomment={(e) => {
|
||||||
node.children = [
|
node.children = [
|
||||||
|
|||||||
@@ -90,8 +90,6 @@
|
|||||||
{#each nodes as node, index (node.comment_view.comment.id)}
|
{#each nodes as node, index (node.comment_view.comment.id)}
|
||||||
<Comment
|
<Comment
|
||||||
bind:node={nodes[index]}
|
bind:node={nodes[index]}
|
||||||
postId={post.id}
|
|
||||||
op={post.creator_id == node.comment_view.creator.id}
|
|
||||||
contentClass={[
|
contentClass={[
|
||||||
(node.children.length > 0 ||
|
(node.children.length > 0 ||
|
||||||
node.comment_view.counts.child_count > 0) &&
|
node.comment_view.counts.child_count > 0) &&
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
circle={avatarCircle}
|
circle={avatarCircle}
|
||||||
class={[
|
class={[
|
||||||
'relative',
|
'relative',
|
||||||
'-mt-8',
|
'-mt-4 @md:-mt-8',
|
||||||
!avatarCircle && 'rounded-xl @md:rounded-3xl!',
|
!avatarCircle && 'rounded-xl @md:rounded-3xl!',
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -97,16 +97,15 @@
|
|||||||
@variant sm {
|
@variant sm {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-left: calc(var(--spacing) * -3);
|
|
||||||
margin-right: calc(var(--spacing) * -3);
|
|
||||||
margin-top: calc(var(--spacing) * -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-bar.bar-header {
|
.tab-bar.bar-header {
|
||||||
padding: calc(var(--spacing));
|
padding: calc(var(--spacing));
|
||||||
gap: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
|
gap: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-left: calc(var(--spacing) * -3);
|
||||||
|
margin-right: calc(var(--spacing) * -3);
|
||||||
|
margin-top: calc(var(--spacing) * -1);
|
||||||
|
|
||||||
@variant sm {
|
@variant sm {
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
|
|||||||
Reference in new issue
Block a user