Skip to content
Snippets Groups Projects
Commit 2fe5b419 authored by chris's avatar chris
Browse files

remove-view

parent 4dc8c891
No related branches found
No related tags found
1 merge request!268Fixes
......@@ -20,12 +20,12 @@ const dropDownOptions = [
const HeadingsDropDown = ({ dispatch, state, item }) => (
<DropdownStyled
options={dropDownOptions}
onChange={option => {
Commands.setBlockType(state.config.schema.nodes.heading, {
level: option.value,
})(state, dispatch);
}}
options={dropDownOptions}
placeholder="Choose heading"
select={item.select && item.select(state)}
/>
......
......@@ -52,7 +52,7 @@ const dropDownOptions = [
{ label: 'Toggle header cells', value: 'toggleHeaderCell' },
];
const TableDropDown = ({ view: { dispatch, state }, item }) => {
const TableDropDown = ({ item }) => {
const { activeView } = useContext(WaxContext);
const [selectedOption, setSelectedOption] = useState('');
......@@ -61,7 +61,11 @@ const TableDropDown = ({ view: { dispatch, state }, item }) => {
() => (
<DropdownStyled
onChange={option => {
item.run(activeView.state, dispatch, tablesFn[option.value]);
item.run(
activeView.state,
activeView.dispatch,
tablesFn[option.value],
);
setSelectedOption(option.value);
setTimeout(() => {
......
......@@ -35,11 +35,9 @@ class Menu {
render() {
return () => {
const {
view: { main },
activeView,
} = useContext(WaxContext);
const { activeView } = useContext(WaxContext);
const Bar = useMemo(() => (
// eslint-disable-next-line react/no-this-in-sfc
<MenuWrapper items={this.toolGroups} view={activeView || {}} />
));
return <>{Bar}</>;
......
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