diff --git a/apps/admin-x-activitypub/src/components/feed/ArticleModal.tsx b/apps/admin-x-activitypub/src/components/feed/ArticleModal.tsx index 52986326bb..b045689616 100644 --- a/apps/admin-x-activitypub/src/components/feed/ArticleModal.tsx +++ b/apps/admin-x-activitypub/src/components/feed/ArticleModal.tsx @@ -78,6 +78,14 @@ const FeedItemDivider: React.FC = () => ( const ArticleModal: React.FC = ({object, actor, comments, allComments, focusReply}) => { const MODAL_SIZE_SM = 640; const MODAL_SIZE_LG = 2800; + const [isFocused, setFocused] = useState(focusReply ? 1 : 0); + function setReplyBoxFocused(focused: boolean) { + if (focused) { + setFocused(prev => prev + 1); + } else { + setFocused(0); + } + } const [modalSize, setModalSize] = useState(MODAL_SIZE_SM); const modal = useModal(); @@ -152,8 +160,11 @@ const ArticleModal: React.FC = ({object, actor, comments, all layout='modal' object={object} type='Note' + onCommentClick={() => { + setReplyBoxFocused(true); + }} /> - + {/* {object.content &&
} */} diff --git a/apps/admin-x-activitypub/src/components/global/APReplyBox.tsx b/apps/admin-x-activitypub/src/components/global/APReplyBox.tsx index d0f4a59a67..d9cc81074c 100644 --- a/apps/admin-x-activitypub/src/components/global/APReplyBox.tsx +++ b/apps/admin-x-activitypub/src/components/global/APReplyBox.tsx @@ -19,7 +19,7 @@ export interface APTextAreaProps extends HTMLProps { className?: string; onChange?: (event: React.ChangeEvent) => void; object: ObjectProperties; - focused: boolean; + focused: number; } const APReplyBox: React.FC = ({