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

track change boxes in progress

parent 10926d2a
No related branches found
No related tags found
1 merge request!109Track changes ids
...@@ -5,12 +5,10 @@ import styled from "styled-components"; ...@@ -5,12 +5,10 @@ import styled from "styled-components";
import { WaxContext } from "wax-prosemirror-core"; import { WaxContext } from "wax-prosemirror-core";
const TrackChangeBoxStyled = styled.div` const TrackChangeBoxStyled = styled.div`
height: 50px;
width: 50px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 10px; margin-top: 10px;
background: blue; border: 1px solid blue;
position: absolute; position: absolute;
transition: ${({ state }) => "top 1s, opacity 1.5s, left 1s"}; transition: ${({ state }) => "top 1s, opacity 1.5s, left 1s"};
top: ${props => (props.top ? `${props.top}px` : 0)}; top: ${props => (props.top ? `${props.top}px` : 0)};
...@@ -30,9 +28,18 @@ const TrackChangeBoxStyled = styled.div` ...@@ -30,9 +28,18 @@ const TrackChangeBoxStyled = styled.div`
`; `;
export default ({ trackChange, view, top, dataBox }) => { export default ({ trackChange, view, top, dataBox }) => {
console.log(trackChange instanceof Mark); console.log(trackChange);
const [animate, setAnimate] = useState(false); const [animate, setAnimate] = useState(false);
const { view: { main }, app, activeView } = useContext(WaxContext); const { view: { main }, app, activeView } = useContext(WaxContext);
let action;
if (trackChange instanceof Mark) {
if ((trackChange.type.name = "format_change")) {
const { attrs: { username, before, after } } = trackChange;
action = `User ${username} added ${after[0]}`;
}
} else {
action = `User demo changed paragraph to heading 1`;
}
// const { attrs: { id } } = comment; // const { attrs: { id } } = comment;
// const activeCommentPlugin = app.PmPlugins.get("activeComment"); // const activeCommentPlugin = app.PmPlugins.get("activeComment");
...@@ -53,7 +60,11 @@ export default ({ trackChange, view, top, dataBox }) => { ...@@ -53,7 +60,11 @@ export default ({ trackChange, view, top, dataBox }) => {
data-box={dataBox} data-box={dataBox}
active={active} active={active}
> >
<span>hohohohho</span> <div>
{action}
<button>Accept</button>
<button>Reject</button>
</div>
</TrackChangeBoxStyled> </TrackChangeBoxStyled>
)} )}
</Transition> </Transition>
......
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