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
7d1f2a2f
Commit
7d1f2a2f
authored
4 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
editing/suggesting initial component
parent
7ac684c9
No related branches found
No related tags found
1 merge request
!215
set id
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js
+60
-0
60 additions, 0 deletions
...components/editingSuggesting/EditingSuggestingDropDown.js
with
60 additions
and
0 deletions
wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js
0 → 100644
+
60
−
0
View file @
7d1f2a2f
/* eslint react/prop-types: 0 */
import
React
,
{
useMemo
,
useContext
}
from
'
react
'
;
import
styled
from
'
styled-components
'
;
import
{
WaxContext
}
from
'
wax-prosemirror-core
'
;
import
Dropdown
from
'
react-dropdown
'
;
import
'
react-dropdown/style.css
'
;
const
DropdownStyled
=
styled
(
Dropdown
)
`
cursor: not-allowed;
display: inline-flex;
opacity:
${
props
=>
(
props
.
select
?
1
:
0.4
)}
;
pointer-events:
${
props
=>
(
props
.
select
?
'
default
'
:
'
none
'
)}
;
.Dropdown-control {
border: none;
}
.Dropdown-arrow {
right: 25px;
top: 14px;
}
.Dropdown-menu {
align-items: flex-start;
display: flex;
flex-direction: column;
width: 120%;
.Dropdown-option {
width: 100%;
}
}
`
;
const
dropDownOptions
=
[
{
label
:
'
Editing
'
,
value
:
'
editing
'
},
{
label
:
'
Suggesting
'
,
value
:
'
suggesting
'
},
{
label
:
'
Viewing
'
,
value
:
'
viewing
'
},
];
const
EditingSuggesting
=
({
view
:
{
dispatch
,
state
},
item
})
=>
{
const
{
activeView
}
=
useContext
(
WaxContext
);
const
isDisabled
=
item
.
select
(
activeView
.
state
);
const
EditingSuggestingComponent
=
useMemo
(
()
=>
(
<
DropdownStyled
onChange
=
{
option
=>
{}}
options
=
{
dropDownOptions
}
placeholder
=
"
Table Options
"
select
=
{
isDisabled
}
/
>
),
[
isDisabled
],
);
return
EditingSuggestingComponent
;
};
export
default
EditingSuggesting
;
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