import { Button, InputNumber, Select, Popover } from "antd"; import { observer } from "mobx-react"; import React from "react"; import { AutoSizer, Column, Table, TableCellRenderer } from "react-virtualized"; import { huntOptimizerStore, WantedItem } from "../../stores/HuntOptimizerStore"; import { itemStore } from "../../stores/ItemStore"; import './WantedItemsComponent.less'; @observer export class WantedItemsComponent extends React.Component { state = { helpVisible: false } render() { // Make sure render is called on updates. huntOptimizerStore.wantedItems.slice(0, 0); return (

Wanted Items } trigger="click" visible={this.state.helpVisible} onVisibleChange={this.onHelpVisibleChange} >

{({ width, height }) => ( huntOptimizerStore.wantedItems[index]} noRowsRenderer={this.noRowsRenderer} > } /> rowData.item.name} />
)}
); } private addWanted = (itemName: string) => { let added = huntOptimizerStore.wantedItems.find(w => w.item.name === itemName); if (!added) { const item = itemStore.items.current.value.find(i => i.name === itemName)!; huntOptimizerStore.wantedItems.push(new WantedItem(item, 1)); } } private removeWanted = (wanted: WantedItem) => () => { const i = huntOptimizerStore.wantedItems.findIndex(w => w === wanted); if (i !== -1) { huntOptimizerStore.wantedItems.splice(i, 1); } } private tableRemoveCellRenderer: TableCellRenderer = ({ rowData }) => { return