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
fdb35ec0
Commit
fdb35ec0
authored
4 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
temp
parent
3f5fcc15
No related branches found
No related tags found
1 merge request
!201
Ui components
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersComponent.js
+12
-2
12 additions, 2 deletions
...omponents/specialCharacters/SpecialCharactersComponent.js
with
12 additions
and
2 deletions
wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersComponent.js
+
12
−
2
View file @
fdb35ec0
...
@@ -4,7 +4,7 @@ import styled from 'styled-components';
...
@@ -4,7 +4,7 @@ import styled from 'styled-components';
import
{
grid
}
from
'
@pubsweet/ui-toolkit
'
;
import
{
grid
}
from
'
@pubsweet/ui-toolkit
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
import
{
WaxContext
}
from
'
wax-prosemirror-core
'
;
import
{
WaxContext
}
from
'
wax-prosemirror-core
'
;
import
{
groupBy
}
from
'
lodash
'
;
import
{
filter
,
groupBy
}
from
'
lodash
'
;
import
Icon
from
'
../../helpers/Icon
'
;
import
Icon
from
'
../../helpers/Icon
'
;
import
CharactersList
from
'
./CharactersList
'
;
import
CharactersList
from
'
./CharactersList
'
;
...
@@ -86,8 +86,18 @@ const SpecialCharactersComponent = ({ close }) => {
...
@@ -86,8 +86,18 @@ const SpecialCharactersComponent = ({ close }) => {
const
{
app
,
view
}
=
useContext
(
WaxContext
);
const
{
app
,
view
}
=
useContext
(
WaxContext
);
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
);
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
);
const
groupedCharacters
=
groupBy
(
CharactersList
,
'
group
'
);
const
groupedCharacters
=
groupBy
(
CharactersList
,
'
group
'
);
const
[
specialCharactersList
,
setSpecialCharactersList
]
=
useState
(
CharactersList
,
);
const
onChange
=
()
=>
{
const
onChange
=
()
=>
{
setSearchValue
(
searchRef
.
current
.
value
);
setSearchValue
(
searchRef
.
current
.
value
);
const
filtertedSpecialCharacters
=
filter
(
CharactersList
,
value
=>
{
console
.
log
(
value
);
if
(
value
.
name
.
toLowerCase
().
includes
(
searchValue
.
toLowerCase
()))
return
value
.
name
;
return
false
;
});
setSpecialCharactersList
(
filtertedSpecialCharacters
);
};
};
const
insertCharacter
=
()
=>
{};
const
insertCharacter
=
()
=>
{};
...
@@ -95,7 +105,7 @@ const SpecialCharactersComponent = ({ close }) => {
...
@@ -95,7 +105,7 @@ const SpecialCharactersComponent = ({ close }) => {
const
renderList
=
()
=>
{
const
renderList
=
()
=>
{
const
lists
=
[];
const
lists
=
[];
Object
.
keys
(
group
edCharacters
).
forEach
(
key
=>
{
Object
.
keys
(
group
By
(
specialCharactersList
,
'
group
'
)
).
forEach
(
key
=>
{
lists
.
push
(
lists
.
push
(
<
SpecialCharactersGroup
key
=
{
key
}
>
<
SpecialCharactersGroup
key
=
{
key
}
>
<
GroupTitle
>
{
key
}
<
/GroupTitle
>
<
GroupTitle
>
{
key
}
<
/GroupTitle
>
...
...
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