Beispiel #1
0
          <span>{team.name}</span>
        </h2>
        <ul className="list-grid">{playersElement}</ul>
      </div>
    );
  }
}

Roster.propTypes = {
  loading: PropTypes.bool.isRequired,
  team: PropTypes.shape({}).isRequired,
  fetchTeam: PropTypes.func.isRequired,
  fetchPlayers: PropTypes.func.isRequired,
  match: PropTypes.shape({
    url: PropTypes.string,
    params: PropTypes.shape({ id: PropTypes.string })
  }).isRequired
};

function mapStateToProps(state) {
  return {
    loading: state.team.loading || state.players.loading,
    team: state.team.team,
    players: state.players.players
  };
}

export default withRouter(
  connect(mapStateToProps, { fetchTeam, fetchPlayers })(Roster)
);
Beispiel #2
0
                        {todo.starred ? (
                            <Icon style={{color: amber[500]}}>star</Icon>
                        ) : (
                            <Icon>star_outline</Icon>
                        )}
                    </IconButton>
                </div>
            </ListItem>
        );
    }
}

function mapDispatchToProps(dispatch)
{
    return bindActionCreators({
        toggleCompleted   : Actions.toggleCompleted,
        toggleImportant   : Actions.toggleImportant,
        toggleStarred     : Actions.toggleStarred,
        openEditTodoDialog: Actions.openEditTodoDialog
    }, dispatch);
}

function mapStateToProps({todoApp})
{
    return {
        labels: todoApp.labels
    }
}

export default withStyles(styles, {withTheme: true})(withRouter(connect(mapStateToProps, mapDispatchToProps)(TodoListItem)));
                                <td>{selected.opened}</td>
                            </tr>

                            <tr className="created">
                                <th>Created</th>
                                <td>{selected.created}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </FuseAnimate>
        )
    };
}


function mapDispatchToProps(dispatch)
{
    return bindActionCreators({}, dispatch);
}

function mapStateToProps({fileManagerApp})
{
    return {
        files       : fileManagerApp.files,
        selectedItem: fileManagerApp.selectedItem
    }
}

export default withStyles(styles, {withTheme: true})(withRouter(connect(mapStateToProps, mapDispatchToProps)(DetailSidebarContent)));
Beispiel #4
0
        } catch (error) {
            this.logError("Failed to get random", error);
            notification.add("error", error.message, 10000);
            this.setState({ loading: false });
        }
    }

    render() {
        if (!this.state.user || this.state.user.name === "guest") {
            return null;
        }

        return (
            <Menu.Item
                icon="random"
                fitted="vertically"
                onClick={() => this.onRandom()}
                disabled={this.state.loading}
            />
        );
    }
}

RandomButton.propTypes = {
    theme: PropTypes.object,
    location: PropTypes.object.isRequired,
    history: PropTypes.object.isRequired
};

export default withRouter(RandomButton);
Beispiel #5
0
                <Col sm='12'>
                    <span><em>Cửa hàng của bạn:</em></span>
                </Col>
                <Col sm='12' lg='9' >

                    <h1 className='text-info display-3'>{this.props.shopDataBo.title}</h1>
                    <h5 className='ml-3' >{this.props.shopDataBo.description}</h5>
                    <p className='ml-5' >Trạng thái: {shopStatut}</p>
                </Col>
                <Col sm='12' lg='3' className='text-right' >
                    <Button size='sm' color='secondary' onClick={this.changeIsUpdate} outline >Thay đổi thông tin cửa hàng</Button>
                    <div className="cart mt-5 text-center">
                        <OrderListInShop orderData={this.props.shopDataBo.listOrder} />
                        <h6 className="mt-2">Danh Sách Order</h6>
                    </div>
                </Col>
                <Col className='text-center'>
                    <Button onClick={this._handleOnClickSwitchPage} size='sm' outline color='success'>Xem với tư cách người mua hàng</Button>
                </Col>
            </Row> : <UpdateInfoInShopManager changeIsUpdate={this.changeIsUpdate} shopID={this.props.shopDataBo._id} />;

        return (
            <div>
                {isUpdateInfo}
            </div>
        );
    }
}

export default withRouter(InfoInShopManager);
            color: '#F44336',
            emphasis: {
              shadowBlur: 10,
              shadowColor: 'rgba(0,0,0,0.20)',
            },
          },
          stack: 'total',
          data: yAxis.pipelineFailFrequency,
        },
        {
          name: `${formatMessage({ id: `${languageType}.build-number.total` })}`,
          type: 'bar',
          color: '#FFF',
          stack: 'total',
        },
      ],
    };
  }

  render() {
    const { echartsLoading, height } = this.props;
    return (
      <Spin spinning={echartsLoading}>
        <ReactEcharts style={{ height }} option={this.getOption()} />
      </Spin>
    );
  }
}

export default withRouter(injectIntl(BuildTable));
Beispiel #7
0
                  type="password"
                  value={this.state.password2}
                  onChange={this.onChange}
                  error={errors.password2}
                />
                <input type="submit" className="btn btn-info btn-block mt-4" />
              </form>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

Register.propTypes = {
  registerUser: propTypes.func.isRequired,
  auth: propTypes.object.isRequired,
  errors: propTypes.object.isRequired
};

const mapStatetoProps = state => ({
  auth: state.auth,
  errors: state.errors
});

export default connect(
  mapStatetoProps,
  { registerUser }
)(withRouter(Register));
                  {
                    min: 8,
                    message: messages["auth.registration_password_length"],
                  },
                  {
                    validator: this.checkPassword,
                  },
                ],
              })(
                <Input
                  type="password"
                  onBlur={this.handleConfirmBlur}
                  prefix={<Icon type="lock" style={{ fontSize: 13 }} />}
                  placeholder="Confirm New Password"
                />,
              )}
            </FormItem>
            <FormItem>
              <Button type="primary" htmlType="submit" style={{ width: "100%" }}>
                Change Password
              </Button>
            </FormItem>
          </Form>
        </Col>
      </Row>
    );
  }
}

export default withRouter(Form.create()(ChangePasswordView));
Beispiel #9
0
        {nav &&
          nav.prev && (
            <a
              className="footer-nav__link footer-nav__left"
              onClick={() => {
                this.handleNavClick(nav.prev.pathname);
              }}
            >
              <i className="zenticon zenticon-right" />
              {nav.prev.title}
            </a>
          )}
        {nav &&
          nav.next && (
            <a
              className="footer-nav__link footer-nav__right"
              onClick={() => {
                this.handleNavClick(nav.next.pathname);
              }}
            >
              <i className="zenticon zenticon-right" />
              {nav.next.title}
            </a>
          )}
      </div>
    );
  }
}

export default withRouter(FooterNav);
        if(savedGame!==null){
            window.location = "play";
        }else{
            Helpers.showToast('Not found!')
        }
    }

    render() {
        return (
            <div className={'content home'}>
                <div className={'row button-container center'}>
                    <div className={'col l12 m12 s12'}>
                        <NewGame className={'button'} />
                    </div>
                    <div className={'col l12 m12 s12'}>
                        <Button waves='light' className={'button'} onClick={this.loadGame}>Load game<Icon left>autorenew</Icon></Button>
                    </div>

                </div>
            </div>

        );
    }
}

HomeContainer.propTypes = {
    history: PropTypes.object,
};

export default withRouter(HomeContainer);
                <input
                  type="submit"
                  value="Submit"
                  className="btn btn-info btn-block mt-4"
                />
              </form>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

CreateProfile.propTypes = {
  createProfile: PropTypes.func.isRequired,
  getCurrentProfile: PropTypes.func.isRequired,
  profile: PropTypes.object.isRequired,
  errors: PropTypes.object
};

const mapStateToProps = state => ({
  profile: state.profile,
  errors: state.errors
});

export default connect(
  mapStateToProps,
  { createProfile, getCurrentProfile }
)(withRouter(CreateProfile));
      <Link to={routes.HOME}>Organization</Link>
    </div>

    {pathname === routes.HOME && (
      <OrganizationSearch
        value={value}
        onChange={onChange}
        onSubmit={onSubmit}
      />
    )}
  </header>
);

const OrganizationSearch = ({ value, onChange, onSubmit }) => (
  <div className="Navigation-search">
    <form onSubmit={onSubmit}>
      <Input
        color={'white'}
        type="text"
        value={value}
        onChange={e => onChange(e.target.value)}
      />{' '}
      <Button color={'white'} type="submit">
        Search
      </Button>
    </form>
  </div>
);

export default withRouter(Navigation);
Beispiel #13
0
		};
	}

	componentWillReceiveProps(nextProps) {
		this.setState({
			href: nextProps.location.pathname + nextProps.location.search,
		});
	}

	render() {
		let url = this.state.href;
		if (url === "" || url === "/") {
			url = "/CourseList"
		}

		return (
			<LinkClickCapturer exclude={["/Certificate/", "/elmah/", "/Courses/"]}>
				<DownloadedHtmlContent url={url} />
			</LinkClickCapturer>
		)
	}

	static propTypes = {
		match: PropTypes.object.isRequired,
		location: PropTypes.object.isRequired,
		history: PropTypes.object.isRequired
	}
}

export default withRouter(AnyPage);
Beispiel #14
0
  isArticlePage () {
    const results = location.pathname.match(/\/posts\/(\d+)\/?$/) || [];
    return results[1];
  }
}

const mapStateToProps = (state, ownProps) => {
  const id = parseInt(state.article.id || 0, 10) || '';
  let data = (state.app.posts.data || {})[id] || state.article.post || {};

  return {
    id: id,
    title: data.title,
    toc: state.article.toc
  };
};

const mapDispatchToProps = (dispatch) => {
  return bindActionCreators({
    setPostToc: setPostToc
  }, dispatch);
};

TOCContainer.defaultProps = {
  // auto表示根据文章内容生成目录;
  // 后期可拓展支持多种方式生成目录
  tocOrigin: 'auto'
};

export default withRouter(connect(mapStateToProps, mapDispatchToProps)(TOCContainer));
Beispiel #15
0
              to="/projects?type=mine"
              activeClassName="headerMenuItemActive"
              isActive={this.isMineProjects}
            >我的项目</NavLink>
            <NavLink
              exact
              styleName="headerMenuItem"
              to="/projects"
              activeClassName="headerMenuItemActive"
              isActive={this.isAllProjects}
            >全部项目</NavLink>
          </div>
          <Popover placement="bottomRight" content={headerMenu} trigger="hover" styleName="headerUser">
            <Avatar icon="user" src={userInfo.avatar} />
          </Popover>
        </div>
      </header>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    userInfo: state.userInfo
  }
}

Header = connect(mapStateToProps)(CSSModules(Header, styles))

export default withRouter(Header)
                }, 100)
              } else {
                this.props.history.push("/")
              }
            }}
          >
            <i className="i-left font40 c-white" />
          </WrapLink>
        ) : (
          <div className="equal-auto" />
        )}

        <div className="font34 bold pt5 c-white equal3 text-overflow-one text-center">
          {title || ""}
        </div>

        {rightCon ||
          (rightShare ? (
            <WrapLink className="equal-auto text-right pt5" onClick={this.onSwitch}>
              <i className="i-share font40 c-white" />
            </WrapLink>
          ) : (
            <div className="equal-auto" />
          ))}
      </div>
    );
  }
}

export default withRouter(NavBar)
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import Product from 'components/product/product';
import { getProduct } from 'actions/product_actions';
import { getOneUser } from 'actions/user_actions';


const mapStateToProps = ({session, entities}, ownProps) => {
  return ({
    product: entities.products[ownProps.match.params.productId],
    products: entities.products,
    photos: entities.photos
  });
};

const mapDispatchToProps = dispatch => {
  return ({
    getProduct: (user_id) => dispatch(getProduct(user_id)),
    getOneUser: id => dispatch(getOneUser(id))
  });
};

export default withRouter(connect(
  mapStateToProps,
  mapDispatchToProps
)(Product));
Beispiel #18
0
                <td></td>
                <td></td>
              </tr>
            </tbody>
          </table>
        </div>;
};

const Row = withRouter(class Row extends Pure_component {
    click = ()=>{
        const url = `/logs?${this.props.logs}=${this.props.stat.key}`;
        this.props.history.push(url);
    };
    render(){
        const {stat, row_key, warning} = this.props;
        return <tr onClick={this.click}>
              <Key_cell row_key={row_key} title={stat.key} warning={warning}/>
              <td><Tooltip_bytes chrome_style bytes={stat.out_bw}/></td>
              <td><Tooltip_bytes chrome_style bytes={stat.in_bw}/></td>
              <td><Cell>{stat.reqs||'—'}</Cell></td>
            </tr>;
    }
});

const Summary_bar = ({enable_ssl_click, show})=>{
    const tooltip = 'Enable HTTPS analyzing for all your proxies. You will '
    +'also need to install SSL certificate. It allows you to use rules and '
    +'logs for HTTPS requests';
    return <div className="summary_bar">
          {show &&
            <a className="link enable_https" onClick={enable_ssl_click}>
Beispiel #19
0
            hasNextPage,
            error,
        },
    } = state

    return {
        hasBeenFetched:   !!fetchedAt,
        //hasActiveFilters: hasActiveFiltersSelector(state),
        hasActiveFilters: false,
        sources:          collectionSelector(state),
        isFetching,
        perPage,
        page,
        sort,
        hasNextPage,
        filters,
        error,
    }
}

const mapDispatchToProps = dispatch => ({
    fetch: options => {
        dispatch(fetchSourcesIfNeeded(options))
    },
})

export default withRouter(connect(
    mapStateToProps,
    mapDispatchToProps
)(Index))
Beispiel #20
0
                />
                <input
                  type="submit"
                  value="Submit"
                  className="btn btn-info btn-block mt-4"
                />
              </form>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

AddExperience.propTypes = {
  addExperience: PropTypes.func.isRequired,
  profile: PropTypes.object.isRequired,
  errors: PropTypes.object.isRequired
};

const mapStateToProps = state => ({
  profile: state.profile,
  errors: state.errors
});

export default connect(
  mapStateToProps,
  { addExperience }
)(withRouter(AddExperience));
Beispiel #21
0
  priceStr,
  createdAt,
  history,
  style
}) => {
  return (
    <ContentPad 
      className="ProductCard-container"
      style={style}
      padding={0}
      borderRadius="4rem 1rem 4rem 1rem"
      onClick={() => history.push(`/product/${id}`)}>
      <img className="ProductCard-img" src={image} alt="" />
      <div className="ProductCard-content">
        <h2 className="ProductCard-title">
          {title}
        </h2>
        <p className="ProductCard-price">
          {priceStr}
        </p>
        <p className="ProductCard-date">
          Posted {new Date(createdAt)
              .toLocaleDateString('en-US', dateFormatOptions)}
        </p>
      </div>
    </ContentPad>
  )
}

export default withRouter(ProductCard)
Beispiel #22
0
  }

  onLogout = () => {
    this.setState({ authenticated: false}, ()=> {
      toast.success(`See you soon! Don't forget the ibuprofen`)
    })
   }
    

  noAuth = () => {
    this.props.history.push('/')
  }

  render() {
    return (
      <div>
      <Switch>
        <Route exact path="/" component={Landing} />
        <Route exact path="/login" render={(()=> <Login onLogin={this.onLogin}/> )}/>
        <Route exact path="/register" component={Register}/>
        <Route exact path="/home" render={(()=> <Home onLogout={this.onLogout} authenticated={this.state.authenticated} isNotAuth={this.noAuth}/> )}/>

      </Switch>

      </div>
    )
  }
}

export default withRouter(App);
    return(
      <Grid container spacing={24}>
        <TitleBar
          buttons={
            <Admin>
              <TitleBarButton
                key={1}
                label="Delete"
                icon={<Delete />}
                color="secondary"
                onClick={this.deleteServiceProfile}
              />
            </Admin>
          }
        >
          <TitleBarTitle to={`/organizations/${this.props.match.params.organizationID}/service-profiles`} title="Service-profiles" />
          <TitleBarTitle title="/" />
          <TitleBarTitle title={this.state.serviceProfile.serviceProfile.name} />
        </TitleBar>

        <Grid item xs={12}>
          <UpdateServiceProfile serviceProfile={this.state.serviceProfile.serviceProfile} admin={this.state.admin} />
        </Grid>
      </Grid>
    );
  }
}

export default withRouter(ServiceProfileLayout);
Beispiel #24
0
                            <Button
                                key={letter}
                                className={this.props.theme.nameLetterButton}
                                content={letter}
                                basic={letter !== currentLetter}
                                color={letter === currentLetter ? "blue" : null}
                                size="mini"
                                active={letter === currentLetter}
                                onClick={() => this.onChange(letter)}
                            />
                        </For>
                    </div>
                </Segment>
                <List
                    theme={this.props.theme}
                    query={query}
                />
            </div>
        );
    }
}

Name.propTypes = {
    theme: PropTypes.object.isRequired,
    match: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
    history: PropTypes.object.isRequired
};

export default withRouter(Name);
Beispiel #25
0
class PreviewStep extends Component {
    constructor(props) {
      super(props);
      this.state = {
      };
  
      this.imgRef = React.createRef();
    }
  
    render() {
      return (
        <div className="camera">
          <div>Step #3: Preview Photograph</div>
          <img ref={this.imgRef} width={this.props.width} height={this.props.height} src={this.props.imgData} alt="" />
          <button className="welcome-button" onClick={() => this.retry()}>Retry</button><br />
          <br/>
          <button className="welcome-button" onClick={() => this.confirm()}>Confirm</button><br />
        </div>);
    }

    retry() {
        this.props.previewCallback(this.props.previewCallbackRef, false);
    }

    confirm() {
        this.props.previewCallback(this.props.previewCallbackRef, true);
    }
  }
  
  export default withRouter(PreviewStep);
  
                                        <Button type="submit">Send</Button>
                                    </div>

                                </form>
                            </Col>
                        </Row>
                        <Modal isOpen={this.state.modal} toggle={this.toggle}>
                            <ModalHeader toggle={this.toggle}>Oops! Something went wrong...</ModalHeader>
                            <ModalBody>
                                Error: {this.state.failedUnregisterMessage}
                            </ModalBody>
                            <ModalFooter>
                                <Button color="primary" onClick={this.toggle}>Close</Button>{' '}
                            </ModalFooter>
                        </Modal>
                    </div>
                    :
                    <div className="mt-5 shadow-sm">
                        <Jumbotron fluid>
                            <Container fluid>
                                <h1 className="display-3">YOU'RE NOT ALLOWED</h1>
                            </Container>
                        </Jumbotron>
                    </div>
            }
        </div>
    }
}

export default withRouter(Unregister)
Beispiel #27
0
                                <span key={i}>&times; {r}</span>
                            ))}
                        </div>
                        :
                        null
                    }
                    <button className="process-order process-order--disabled" onClick={()=>this.why()}>Оформить заказ</button>
                </div>
            )
        }
    }
}

const mapStateToProps = (state) => {
    return {
        isPlacing: state.orderIsPlacing,
        hasErrored: state.ordersHasErrored,
        isAuth: state.userIsAuth,
        cart: state.cartItems,
        summary: state.cartSummary
    };
};

const mapDispatchToProps = (dispatch) => {
    return {
        submitOrder: (payment_type) => dispatch(submitOrder(payment_type))
    };
};

export default withRouter(connect(mapStateToProps, mapDispatchToProps)(CartSide));
Beispiel #28
0
import './HeroPage.scss';
import Hero from './Hero';
import React from 'react';
import { withRouter } from 'react-router-dom';

const HeroPage = ({ match: { params } }) => {
    return <div><Hero id={params.id}/></div>
}

export default withRouter(HeroPage);
    render(){
        const { onClickNexthandle, onClickPrevhandle } = this;
        
        return(
            <Header
                onNext={onClickNexthandle}
                onPrev={onClickPrevhandle}
                total = {60*60}
                startTime = {localStorage.getItem('lStartTime')}
            >
                Listening
            </Header>
        );
    }
}

export default connect(
    (state) => ({
        lNum : state.listening.get('lNum'),
        tNum : state.listening.get('tNum'),
        cNum : state.listening.get('cNum'),
        chooseAnswer : state.listening.get('chooseAnswer'),
        tlNum : state.listening.get('tlNum'),
        listen : state.listening.get('listen')
    }),
    (dispatch) => ({
        ListeningActions : bindActionCreators(listeningActions, dispatch)
    })
)(withRouter(LHeaderContainer));
Beispiel #30
0
import React from "react";
import {Link, withRouter} from "react-router-dom";
import Helmet from "./Helmet";

class NotFound extends React.Component {

    render() {

        if (this.props.staticContext) {
            this.props.staticContext.status = 404;
        }

        return (
            <div>
                <Helmet title="Page Not Found"/>
                <h1>Page Not Found</h1>
                <p>Go to <Link to="/">index page</Link>.</p>
            </div>
        );

    }

}

export default withRouter(NotFound);