Skip to content
Snippets Groups Projects
Commit 2faa3c17 authored by chris's avatar chris
Browse files

set active

parent f1f1a9d5
No related branches found
No related tags found
1 merge request!161Connect ui
...@@ -7,10 +7,26 @@ import CommentBox from '../../ui/comments/CommentBox'; ...@@ -7,10 +7,26 @@ import CommentBox from '../../ui/comments/CommentBox';
export default ({ key, comment, dataBox, top, commentId, commentData }) => { export default ({ key, comment, dataBox, top, commentId, commentData }) => {
const MemorizedComponent = memo(() => { const MemorizedComponent = memo(() => {
const {
view,
view: {
main: {
props: { user },
},
},
app,
activeView,
} = useContext(WaxContext);
let active = false;
const commentPlugin = app.PmPlugins.get('commentPlugin');
const activeComment = commentPlugin.getState(activeView.state).comment;
if (activeComment && commentId === activeComment.attrs.id) active = true;
return ( return (
<CommentBox <CommentBox
key={commentId} key={commentId}
comment={commentData} active={active}
dataBox={commentId} dataBox={commentId}
top={top} top={top}
commentId={commentId} commentId={commentId}
......
...@@ -79,6 +79,7 @@ const CommentBox = props => { ...@@ -79,6 +79,7 @@ const CommentBox = props => {
<Wrapper <Wrapper
style={style} style={style}
active={active} active={active}
data-box={commentId}
className={className} className={className}
onClick={onClickWrapper} onClick={onClickWrapper}
top={top} top={top}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment