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

cleanup file

parent 1ed65697
No related branches found
No related tags found
1 merge request!232feat(custom-tag-block): added custom-tag-block
......@@ -6,8 +6,6 @@ import CustomTagBlockComponent from '../../components/customtag/CustomTagBlockCo
import BlockElement from './BlockElement';
import Icon from '../../helpers/Icon';
const Wrapper = styled.div``;
const GroupName = styled.div`
font-size: 14px;
margin-bottom: 4px;
......@@ -28,12 +26,11 @@ const FlexDiv = styled.div`
const StyledIcon = styled(Icon)`
cursor: pointer;
fill: ${th('colorPrimary')};
height: 10px;
width: 10px;
height: 14px;
width: 14px;
`;
const BlockElementGroup = props => {
const { groupName, items, view } = props;
const BlockElementGroup = ({ groupName, items, view }) => {
const [isIconClicked, setIconClicked] = useState(false);
const onIconClick = () => {
......@@ -41,7 +38,7 @@ const BlockElementGroup = props => {
};
return (
<Wrapper>
<>
{groupName !== 'Custom Block' && (
<>
<GroupName>{groupName}</GroupName>
......@@ -72,7 +69,7 @@ const BlockElementGroup = props => {
</ListWrapper>
</>
)}
</Wrapper>
</>
);
};
......
......@@ -4,13 +4,13 @@ import { LeftMenuTitle } from '../../../../../wax-prosemirror-components/src/com
@injectable()
class CustomTagBlockToolGroup extends ToolGroup {
tools = [];
title = "Custom Block";
tools = [];
title = 'Custom Block';
constructor(@inject('CustomTagBlockTool') customTagBlock) {
super();
this.tools = [customTagBlock];
}
constructor(@inject('CustomTagBlockTool') customTagBlock) {
super();
this.tools = [customTagBlock];
}
}
export default CustomTagBlockToolGroup;
\ No newline at end of file
export default CustomTagBlockToolGroup;
......@@ -16,7 +16,11 @@ class DisplayText extends ToolGroup {
tools = [];
toolGroups = [];
constructor(@inject('Display') display, @inject('Text') text, @inject('CustomTagBlockToolGroup') blockTag) {
constructor(
@inject('Display') display,
@inject('Text') text,
@inject('CustomTagBlockToolGroup') blockTag,
) {
super();
this.toolGroups = [
{
......@@ -27,7 +31,7 @@ class DisplayText extends ToolGroup {
}
renderTools(view) {
if (isEmpty(view)) return null;
if (isEmpty(view)) return null;
const first = {
id: '1',
......@@ -37,7 +41,10 @@ class DisplayText extends ToolGroup {
component: (
<BlockLevelTools
groups={this._toolGroups[0].groups.map(group => ({
groupName: group.title === 'Custom Block' ? group.title : group.title.props.title,
groupName:
group.title === 'Custom Block'
? group.title
: group.title.props.title,
items: group._tools,
}))}
view={view}
......
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