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';
export default ({ key, comment, dataBox, top, commentId, commentData }) => {
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 (
<CommentBox
key={commentId}
comment={commentData}
active={active}
dataBox={commentId}
top={top}
commentId={commentId}
......
......@@ -79,6 +79,7 @@ const CommentBox = props => {
<Wrapper
style={style}
active={active}
data-box={commentId}
className={className}
onClick={onClickWrapper}
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