diff --git a/src/components/Article/Article.module.scss b/src/components/Article/Article.module.scss
index 9f632f7a..35442400 100644
--- a/src/components/Article/Article.module.scss
+++ b/src/components/Article/Article.module.scss
@@ -144,6 +144,7 @@ img {
.shoutStatsItem {
@include font-size(1.5rem);
+
font-weight: 500;
display: inline-block;
margin: 0 3.2rem 1em 0;
@@ -175,6 +176,19 @@ img {
a {
border: none;
+ text-decoration: none;
+ &:hover {
+ background: unset;
+ color: #000;
+
+ img {
+ filter: unset;
+ }
+ }
+ }
+
+ &:hover {
+ cursor: pointer;
}
}
diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx
index c9fb2671..d099e0df 100644
--- a/src/components/Article/Comment.tsx
+++ b/src/components/Article/Comment.tsx
@@ -1,7 +1,7 @@
import styles from './Comment.module.scss'
import { Icon } from '../_shared/Icon'
import { AuthorCard } from '../Author/Card'
-import { Show, createMemo, createSignal, For, lazy, Suspense } from 'solid-js'
+import { Show, createMemo, createSignal, For, lazy, Suspense, createEffect } from 'solid-js'
import { clsx } from 'clsx'
import type { Author, Reaction } from '../../graphql/types.gen'
import MD from './MD'
@@ -30,6 +30,7 @@ export const Comment = (props: Props) => {
const [isReplyVisible, setIsReplyVisible] = createSignal(false)
const [loading, setLoading] = createSignal(false)
const [editMode, setEditMode] = createSignal(false)
+ const [submitted, setSubmitted] = createSignal(false)
const { session } = useSession()
const {
@@ -66,6 +67,7 @@ export const Comment = (props: Props) => {
})
setIsReplyVisible(false)
setLoading(false)
+ setSubmitted(true)
} catch (error) {
console.error('[handleCreate reaction]:', error)
}
@@ -94,6 +96,7 @@ export const Comment = (props: Props) => {
}
const createdAt = new Date(comment()?.createdAt)
+
return (
}>
- handleCreate(value)} />
+ handleCreate(value)}
+ cancel={() => setIsReplyVisible(false)}
+ />
diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx
index 81daa4e0..119d7a04 100644
--- a/src/components/Article/CommentsTree.tsx
+++ b/src/components/Article/CommentsTree.tsx
@@ -39,15 +39,16 @@ type Props = {
}
export const CommentsTree = (props: Props) => {
+ const { session } = useSession()
+ const { t } = useLocalize()
const [commentsOrder, setCommentsOrder] = createSignal('createdAt')
+ const [newReactions, setNewReactions] = createSignal([])
+ const [submitted, setSubmitted] = createSignal(false)
const {
reactionEntities,
actions: { createReaction }
} = useReactions()
- const { t } = useLocalize()
- const [newReactions, setNewReactions] = createSignal([])
-
const comments = createMemo(() =>
Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT')
)
@@ -78,7 +79,7 @@ export const CommentsTree = (props: Props) => {
setCookie()
} else if (currentDate > dateFromLocalStorage) {
const newComments = comments().filter((c) => {
- if (c.replyTo) {
+ if (c.replyTo || c.createdBy.slug === session()?.user.slug) {
return
}
const created = new Date(c.createdAt)
@@ -89,8 +90,6 @@ export const CommentsTree = (props: Props) => {
}
})
- const { session } = useSession()
- const [submitted, setSubmitted] = createSignal(false)
const handleSubmitComment = async (value) => {
try {
await createReaction({
@@ -113,41 +112,42 @@ export const CommentsTree = (props: Props) => {
+{newReactions().length}
-
-
+
+
+
+