import React from "react"; import * as Act from "./interface/Actions"; import Store from "./interface/Store"; import Game from "./Game"; import NewMatch from "./NewMatch"; import NewGroup from "./NewGroup"; import delImg from "./Images/delete.png"; import plyImg from "./Images/play.png"; import rfhImg from "./Images/refresh.png"; export default class GameSetup extends React.Component { constructor() { super(); this.state = { serlst: Store.getSeries(), grp: '', rsfh: true, gamtag: '', deal: 0, flag: false, tab: 0 }; this.getSeries = this.getSeries.bind(this); this.color = ['grey', 'red', 'green', 'blue'] } componentDidMount() { Store.on("series", this.getSeries) } componentWillUnmount() { Store.removeListener("series", this.getSeries) } dltSeries(inx, e) { let tag = this.state.serlst[inx].Tag Act.apiCall('service', 'SERDLT', { ser: tag }); } getSeries() { this.setState({ serlst: Store.getSeries(), rfsh: true }) } joinGame(inx, e) { let cond = true let tag = this.state.serlst[inx].Tag let hnd = this.state.serlst[inx].Deal Act.apiCall('service', 'JOINGM', { match: tag }); this.setState({ gamtag: tag, deal: hnd, flag: cond }) } refreshSeries() { Act.apiCall('service', 'SERRFH', {}); this.setState({rfsh: false}) } backButton() { this.setState({ flag: false }) } render() { let series = this.state.serlst.map((g, i) => { return