Beispiel #1
0
import {actions} from '../redux/categories';
import {actions as currentCategoryActions} from '../redux/currentCategory';
import { ContextMenu, MenuItem, ContextMenuLayer } from "react-contextmenu";
import CategoryContextMenu from './CategoryContextMenu';
import { Link } from 'react-router';
import ExtTextInput from './ExtTextInput';

const InfiniteScroll = reactInfiniteScroll(React);

const mapStateToProps = ({categories, currentCategory}) => ({
  categories, currentCategory
});

//Component on which context-menu must be triggred
const CategoryItem = ContextMenuLayer("category_context_menu", (props) => {
  return {category: props.category};
})(({category, onClick}) =>
  <div onClick={onClick}>{ category.name }</div>
);

class CategoryList extends Component {

  constructor(props) {
    super();
    props.fetchCategoriesAsync();
  }

  render() {
    const {categories} = this.props;
    const { docs, total, editing } = categories;
    const hasMore = docs.length < total;
Beispiel #2
0
          <button onClick={this.createItem}>
            Create
          </button>
          <br />
          <div className='window tooltip-window'>
            <div id='characterstats' className='tooltip tooltip-stat'>
              <CharacterStats player={this.state.player} />
            </div>
          </div>
        </div>
      </div>
    )
  }
}

const ContextMenuInvItem = ContextMenuLayer('inventory-item', props => props)(InvItem)

class InventoryItemContextMenu extends Component {
  constructor () {
    super()
    this.handleClick = this.handleClick.bind(this)
  }

  render () {
    return (
      <ContextMenu identifier='inventory-item'>
        <MenuItem data={{action: 'view-details'}} onClick={this.handleClick}>
          View Details
        </MenuItem>
      </ContextMenu>
    )
Beispiel #3
0
import reactInfiniteScroll from 'react-infinite-scroll';
import {actions} from '../redux/posts';
import {actions as currentPostActions} from '../redux/currentPost';
import { ContextMenu, MenuItem, ContextMenuLayer } from "react-contextmenu";
import PostContextMenu from './PostContextMenu';
import { Link } from 'react-router';

const InfiniteScroll = reactInfiniteScroll(React);

const mapStateToProps = ({posts, currentPost, currentCategory}) => ({
  posts, currentPost, currentCategory,
});

//Component on which context-menu must be triggred
const PostItem = ContextMenuLayer("post_context_menu", (props) => {
  return {post: props.post};
})(({post, onClick}) =>
  <div onClick={onClick}>{ post.name }</div>
);

class PostList extends Component {

  constructor(props) {
    super();
    if (props.params && props.params.categoryId) {
      props.fetchPostsAsync(props.params.categoryId);
      return;
    }
    props.fetchPostsAsync();
  }
Beispiel #4
0
			}
		}

		this.props.fetchCurrentData(config, () => {
			this.props.notifications.addNotification({
				title: 'Data Fetch Error',
				message: 'No data was received from the server. Make sure you have the right source in your config options.',
				level: 'error',
				position: 'tr',
				autoDismiss: '5'
			});
		});
	}
}

const StreamContext = ContextMenuLayer("StreamData")(StreamData);

class LayerControls extends Component {
	constructor(props) {
		super(props);

		this.state = {
			events: false,
			fields: false,
			geo: false,
			advanced: false,
			sources: false
		};
	}

	render() {