Sha256: 4616c97ab231702cc2660e270b1c251d95e939f394b63aa343f0946b2ab1e9e7
Contents?: true
Size: 1.04 KB
Versions: 185
Compression:
Stored size: 1.04 KB
Contents
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { BrowserRouter as Router } from 'react-router-dom'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { orgId } from '../../services/api'; import * as actions from '../../scenes/Organizations/OrganizationActions'; import reducer from '../../scenes/Organizations/OrganizationReducer'; import Routes from './Routes'; import './overrides.scss'; const mapStateToProps = state => ({ organization: state.organization }); const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch); export const organization = reducer; class Application extends Component { componentDidMount() { this.loadData(); } loadData() { if (orgId()) { this.props.loadOrganization(); } } render() { return ( <Router> <Routes /> </Router> ); } } Application.propTypes = { loadOrganization: PropTypes.func.isRequired, }; export default connect(mapStateToProps, mapDispatchToProps)(Application);
Version data entries
185 entries across 185 versions & 1 rubygems