Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax-prosemirror
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wax
wax-prosemirror
Commits
6101fa83
Commit
6101fa83
authored
4 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
delete wrong stuff
parent
ca6b7552
No related branches found
No related tags found
1 merge request
!232
feat(custom-tag-block): added custom-tag-block
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js
+7
-27
7 additions, 27 deletions
...nents/src/components/customtag/CustomTagBlockComponent.js
with
7 additions
and
27 deletions
wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js
+
7
−
27
View file @
6101fa83
...
@@ -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
(()
=>
{
le
t
labels
=
[];
cons
t
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
>
),
),
[],
[],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment