Permalink
Browse files

Add an initial test context menu component and hook it up

  • Loading branch information...
markerikson committed Jul 16, 2017
1 parent f38f38b commit 958a2c310870686965187a766d9c4eb2875e5af8
@@ -3,10 +3,12 @@ import {connect} from "react-redux";
import Portal from 'react-portal';
import ContextMenu from "./ContextMenu";
import TestContextMenu from "./TestContextMenu";
import {selectContextMenu} from "./contextMenuSelectors";
const menuTypes = {
TestContextMenu
};
@@ -0,0 +1,19 @@
import React, { Component } from 'react'
import { Menu } from 'semantic-ui-react'
export default class TestContextMenu extends Component {
render() {
return (
<Menu vertical>
<Menu.Item>
<Menu.Header>Menu Header: {this.props.text} </Menu.Header>
<Menu.Menu>
<Menu.Item>First Menu Item</Menu.Item>
<Menu.Item>Second Menu Item</Menu.Item>
</Menu.Menu>
</Menu.Item>
</Menu>
)
}
}
@@ -6,14 +6,16 @@ import {
} from "semantic-ui-react";
import {loadUnitData} from "../toolActions";
import {openModal} from "features/modals/modalActions.js";
import {showContextMenu} from "features/contextMenus/contextMenuActions";
const actions = {loadUnitData, openModal};
const actions = {loadUnitData, showContextMenu};
class Tools extends Component {
onOpenModalClicked = () => {
this.props.openModal("ColorPickerDialog");
onShowContextMenuClicked = () => {
this.props.showContextMenu(600, 200, "TestContextMenu", {text : "Blah"});
}
render() {
@@ -22,10 +24,11 @@ class Tools extends Component {
return (
<Segment attached="bottom">
<Button onClick={loadUnitData}>Reload Unit Data</Button>
<Button primary onClick={this.onOpenModalClicked}>Show Test Modal</Button>
<Button primary onClick={this.onShowContextMenuClicked}>Show Test Context Menu</Button>
</Segment>
)
}
}
export default connect(null, actions)(Tools);
export default connect(null, actions)(Tools);

0 comments on commit 958a2c3

Please sign in to comment.