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

delete wrong stuff

parent ca6b7552
No related branches found
No related tags found
1 merge request!232feat(custom-tag-block): added custom-tag-block
...@@ -3,7 +3,6 @@ import styled from 'styled-components'; ...@@ -3,7 +3,6 @@ import styled from 'styled-components';
import { WaxContext } from 'wax-prosemirror-core'; import { WaxContext } from 'wax-prosemirror-core';
import useDeepCompareEffect from 'use-deep-compare-effect'; import useDeepCompareEffect from 'use-deep-compare-effect';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { th } from '@pubsweet/ui-toolkit';
const Wrapper = styled.div``; const Wrapper = styled.div``;
...@@ -12,6 +11,7 @@ const Input = styled.input` ...@@ -12,6 +11,7 @@ const Input = styled.input`
border-bottom: 1px solid grey; border-bottom: 1px solid grey;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
&:focus { &:focus {
outline: none; outline: none;
} }
...@@ -48,16 +48,6 @@ const Box = styled.div` ...@@ -48,16 +48,6 @@ const Box = styled.div`
const StyledButton = styled.div``; const StyledButton = styled.div``;
const ActiveStyles = styled.div`
background: ${th('colorPrimary')};
color: #fff;
cursor: pointer;
font-family: 'Fira Sans Condensed';
font-size: 14px;
height: 28px;
padding: 2px;
`;
const CustomTagBlockComponent = props => { const CustomTagBlockComponent = props => {
const { isShowTag, item } = props; const { isShowTag, item } = props;
const ref = useRef(); const ref = useRef();
...@@ -105,17 +95,17 @@ const CustomTagBlockComponent = props => { ...@@ -105,17 +95,17 @@ const CustomTagBlockComponent = props => {
}; };
useDeepCompareEffect(() => { useDeepCompareEffect(() => {
let labels = []; const labels = [];
if (serviceConfig !== undefined) { if (serviceConfig !== undefined) {
serviceConfig.tags.forEach(item => { serviceConfig.tags.forEach(tag => {
if (item.tagType === 'block') { if (tag.tagType === 'block') {
labels.push(item.label); labels.push(tag.label);
} }
}); });
} }
if (localTagList !== null) { if (localTagList !== null) {
localTagList.forEach(item => { localTagList.forEach(tag => {
labels.push(item.label); labels.push(tag.label);
}); });
} }
setServiceList(labels); setServiceList(labels);
...@@ -135,16 +125,6 @@ const CustomTagBlockComponent = props => { ...@@ -135,16 +125,6 @@ const CustomTagBlockComponent = props => {
<Add onClick={onClickAdd}>Add</Add> <Add onClick={onClickAdd}>Add</Add>
</FlexDiv> </FlexDiv>
)} )}
{serviceList !== null &&
serviceList.map((item, pos) => (
<ListStyle key={uuidv4()}>
<FlexDiv onClick={e => onSelectTag(e, item)}>
<Box />
<StyledButton>{item}</StyledButton>
</FlexDiv>
</ListStyle>
))}
</Wrapper> </Wrapper>
), ),
[], [],
......
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