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

options tool in progress

parent 666451b8
No related branches found
No related tags found
1 merge request!226Ui components
...@@ -122,18 +122,21 @@ const CommentsContainerNotes = styled.div` ...@@ -122,18 +122,21 @@ const CommentsContainerNotes = styled.div`
height: 100%; height: 100%;
`; `;
const CommentTrackTools = styled.div` const CommentTrackToolsContainer = styled.div`
padding: ${grid(2)}0 0 0; padding: ${grid(2)}0 0 0;
position: fixed; position: fixed;
display: flex; display: flex;
margin-left: 5px; margin-left: 5px;
z-index: 1; z-index: 1;
height: 30px; height: 30px;
width: 29.4%; width: 27%;
background: #fff; background: #fff;
span { `;
margin-left: auto;
} const CommentTrackTools = styled.div`
margin-left: 10px;
display: flex;
position: relative;
`; `;
const NotesAreaContainer = styled.div` const NotesAreaContainer = styled.div`
...@@ -290,13 +293,13 @@ const EditoriaLayout = ({ editor }) => { ...@@ -290,13 +293,13 @@ const EditoriaLayout = ({ editor }) => {
<WaxSurfaceScroll> <WaxSurfaceScroll>
<EditorContainer>{editor}</EditorContainer> <EditorContainer>{editor}</EditorContainer>
<CommentsContainer> <CommentsContainer>
<CommentTrackTools> <CommentTrackToolsContainer>
<span> <CommentTrackTools>
{commentsTracks + trackBlockNodes} COMMENTS AND {commentsTracks + trackBlockNodes} COMMENTS AND
SUGGESTIONS SUGGESTIONS
<CommentTrackToolBar /> <CommentTrackToolBar />
</span> </CommentTrackTools>
</CommentTrackTools> </CommentTrackToolsContainer>
<RightArea area="main" /> <RightArea area="main" />
</CommentsContainer> </CommentsContainer>
</WaxSurfaceScroll> </WaxSurfaceScroll>
......
import React from 'react';
const TrackChangeOptionsComponent = ({ view = {}, groups }) => {
console.log(groups);
return <span>Options</span>;
};
export default TrackChangeOptionsComponent;
...@@ -20,8 +20,8 @@ const DropWrapper = styled.div` ...@@ -20,8 +20,8 @@ const DropWrapper = styled.div`
top: 32px; top: 32px;
`; `;
const TrackChangeOptionsTool = ({ view = {}, item }) => { const TrackChangeOptionsTool = ({ view = {}, item, groups }) => {
const { icon, title } = item; // const { icon, title } = item;
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const ref = useRef(); const ref = useRef();
...@@ -33,16 +33,17 @@ const TrackChangeOptionsTool = ({ view = {}, item }) => { ...@@ -33,16 +33,17 @@ const TrackChangeOptionsTool = ({ view = {}, item }) => {
<MenuButton <MenuButton
active={isOpen} active={isOpen}
disabled={false} disabled={false}
iconName={icon} iconName="more"
onMouseDown={() => { onMouseDown={() => {
setIsOpen(!isOpen); setIsOpen(!isOpen);
}} }}
title={title} // title={title}
/> />
{isOpen && ( {isOpen && (
<DropWrapper> <DropWrapper>
<TrackChangeOptionsComponent <TrackChangeOptionsComponent
groups={groups}
close={() => { close={() => {
setIsOpen(false); setIsOpen(false);
}} }}
......
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { injectable, inject } from 'inversify'; import { injectable, inject } from 'inversify';
import { BlockLevelTools, Tabs, ToolGroups } from 'wax-prosemirror-components'; import { TrackChangeOptionsTool } from 'wax-prosemirror-components';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import styled from 'styled-components'; import styled from 'styled-components';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import ToolGroup from '../../lib/ToolGroup'; import ToolGroup from '../../lib/ToolGroup';
const Empty = styled.div`
background: khaki;
height: 100%;
`;
@injectable() @injectable()
class TrackCommentOptions extends ToolGroup { class TrackCommentOptions extends ToolGroup {
tools = []; tools = [];
toolGroups = []; toolGroups = [];
constructor(@inject('TrackOptions') trackOptions, @inject('Text') text) { constructor(@inject('TrackOptions') trackOptions) {
super(); super();
this.toolGroups = [ this.toolGroups = [
{ {
groups: [trackOptions, text], groups: [trackOptions],
}, },
]; ];
} }
renderTools(view) { renderTools(view) {
if (isEmpty(view)) return null; if (isEmpty(view)) return null;
return (
return <span>Options</span>; <TrackChangeOptionsTool
view={view}
groups={this._toolGroups[0].groups.map(group => ({
// groupName: group.title.props.title,
items: group._tools,
}))}
/>
);
} }
} }
......
...@@ -5,11 +5,12 @@ import ToolGroup from '../../lib/ToolGroup'; ...@@ -5,11 +5,12 @@ import ToolGroup from '../../lib/ToolGroup';
class TrackOptions extends ToolGroup { class TrackOptions extends ToolGroup {
tools = []; tools = [];
constructor( constructor(
@inject('ShowHideTrackChange') showHideTrackChange,
@inject('AcceptTrackChange') acceptTrackChange, @inject('AcceptTrackChange') acceptTrackChange,
@inject('RejectTrackChange') rejectTrackChange, @inject('RejectTrackChange') rejectTrackChange,
) { ) {
super(); super();
this.tools = [acceptTrackChange, rejectTrackChange]; this.tools = [showHideTrackChange, acceptTrackChange, rejectTrackChange];
} }
} }
......
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