Fix for loading
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import {Container, Grid} from 'semantic-ui-react';
|
||||
import { Container, Grid } from 'semantic-ui-react';
|
||||
|
||||
import MainMenu from '../../components/MainMenu';
|
||||
import DateRangePicker from '../../components/DateRangePicker';
|
||||
import MemberSelector from './components/MemberSelector';
|
||||
import MemberSummary from './components/MemberSummary';
|
||||
import MemberIncidentsTables from '../../components/MemberIncidentsTables';
|
||||
import GenerateFeesInORDButton from '../../components/GenerateFeesInORDButton';
|
||||
|
||||
import { fetchMemberIncidents } from '../../store/actions';
|
||||
|
||||
@@ -39,8 +40,12 @@ class PracticeSummaryReport extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { memberIncidents, loading } = this.props;
|
||||
const { memberId } = this.state;
|
||||
const { memberIncidents, loadingMemberIncidents, loadingAddFeesStatus } = this.props;
|
||||
const { memberId, dateRange } = this.state;
|
||||
|
||||
const loading = loadingAddFeesStatus || loadingMemberIncidents;
|
||||
|
||||
const addFeesButtonDisabled = !memberId || !dateRange || loading;
|
||||
|
||||
return (
|
||||
<Container>
|
||||
@@ -64,6 +69,16 @@ class PracticeSummaryReport extends Component {
|
||||
/>
|
||||
</Grid.Column>
|
||||
</Grid.Row>
|
||||
<Grid.Row>
|
||||
<Grid.Column>
|
||||
<GenerateFeesInORDButton
|
||||
singleMember
|
||||
disabled={addFeesButtonDisabled}
|
||||
dateRange={dateRange}
|
||||
memberIds={[memberId]}
|
||||
/>
|
||||
</Grid.Column>
|
||||
</Grid.Row>
|
||||
<Grid.Row/>
|
||||
<Grid.Row>
|
||||
<Grid.Column>
|
||||
@@ -78,7 +93,8 @@ class PracticeSummaryReport extends Component {
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
memberIncidents: state.memberIncidents.result,
|
||||
loading: state.memberIncidents.pending,
|
||||
loadingMemberIncidents: state.memberIncidents.pending,
|
||||
loadingAddFeesStatus: state.addFeesStatus.pending,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
Reference in New Issue
Block a user