mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-21 23:54:37 +00:00
Update comments.tsx
Some checks failed
Build And Publish / BuildAndPublish (push) Failing after 2m18s
Some checks failed
Build And Publish / BuildAndPublish (push) Failing after 2m18s
This commit is contained in:
parent
50c691d6a2
commit
45141726dd
@ -43,7 +43,7 @@ Comments.ReplyButton = function ReplyButton({comment}: ReplyButton) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className="flex mt-4 text-sm gap-x-2 items-center group active:dark:text-indigo-500 text-zinc-800 dark:text-zinc-100"
|
className="flex mt-4 text-sm gap-x-2 items-center group active:dark:text-indigo-500 active:text-indigo-500 text-zinc-800 dark:text-zinc-100"
|
||||||
onClick={handleReplyButton}
|
onClick={handleReplyButton}
|
||||||
>
|
>
|
||||||
<ArrowLeftIcon
|
<ArrowLeftIcon
|
||||||
@ -134,7 +134,12 @@ const initialState: InitialState = {
|
|||||||
|
|
||||||
const CommentFormContext = createContext<{ focusCommentForm: () => void } | null>(null)
|
const CommentFormContext = createContext<{ focusCommentForm: () => void } | null>(null)
|
||||||
|
|
||||||
Comments.Form = function Form({slug, commentFormRef}: CommentsProps) {
|
type CommentsFormsProps = {
|
||||||
|
slug: string
|
||||||
|
commentFormRef?: RefObject<HTMLTextAreaElement | null>
|
||||||
|
}
|
||||||
|
|
||||||
|
Comments.Form = function Form({slug, commentFormRef}: CommentsFormsProps) {
|
||||||
const [parentId, setParentId] = useState<string | number | null>('')
|
const [parentId, setParentId] = useState<string | number | null>('')
|
||||||
const [state, formAction, pending] = useActionState(addComment, initialState)
|
const [state, formAction, pending] = useActionState(addComment, initialState)
|
||||||
const {data: session} = useSession()
|
const {data: session} = useSession()
|
||||||
@ -219,8 +224,7 @@ const ReplyContext = createContext<ReplyContextType | null>(null)
|
|||||||
|
|
||||||
type CommentsProps = {
|
type CommentsProps = {
|
||||||
slug: string
|
slug: string
|
||||||
comments?: any
|
comments?: Comment[]
|
||||||
commentFormRef?: RefObject<HTMLTextAreaElement | null>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Comments({slug, comments}: CommentsProps) {
|
export default function Comments({slug, comments}: CommentsProps) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user