diff --git a/app/components/landingPage/styles/style-landingPage.scss b/app/components/landingPage/styles/style-landingPage.scss index 7df958f..213c05d 100644 --- a/app/components/landingPage/styles/style-landingPage.scss +++ b/app/components/landingPage/styles/style-landingPage.scss @@ -66,7 +66,7 @@ } .content { - min-height: 608px; + min-height: 400px; width: 100%; display: flex; align-items: center; diff --git a/app/components/publisherPage/components/checksSection.js b/app/components/publisherPage/components/checksSection.js index 4ef6426..8a8362f 100644 --- a/app/components/publisherPage/components/checksSection.js +++ b/app/components/publisherPage/components/checksSection.js @@ -26,6 +26,8 @@ export default class ChecksSection extends React.Component { coverage: is.object.isRequired, memberId: is.string.isRequired, loadingChecks: is.bool.isRequired, + setTotals: is.func.isRequired, + totals: is.object.isRequired } @@ -165,6 +167,7 @@ export default class ChecksSection extends React.Component { keySig: this.generateKey(prevState.contentFilter, filterName, prevState.titleFilter), filterError: !r.message.Coverage.length })) + this.props.setTotals(r.message.totals) }) .catch( e => { console.error(e) @@ -178,7 +181,7 @@ export default class ChecksSection extends React.Component { .then( r => r.json()) .then( r => { clearTimeout(this.loadingTimeout) - + this.props.setTotals(r.message.totals) this.setState( prevState => { const newState = {dateChecksData: r.message.Coverage} @@ -213,6 +216,7 @@ export default class ChecksSection extends React.Component { } else { clearTimeout(this.loadingTimeout) + this.props.setTotals(this.props.totals) this.setState( prevState => ({ dateChecksData: undefined, loadingFilter: false, diff --git a/app/components/publisherPage/publisherPage.js b/app/components/publisherPage/publisherPage.js index 0d5d469..4779a38 100644 --- a/app/components/publisherPage/publisherPage.js +++ b/app/components/publisherPage/publisherPage.js @@ -30,6 +30,7 @@ export default class PublisherPage extends React.Component { state = { totals: {}, + allTotals:{}, coverage: {}, loadingChecks: true, publisherName:"" @@ -51,13 +52,17 @@ export default class PublisherPage extends React.Component { componentDidMount () { fetch(`${deployConfig.apiBaseUrl}?op=participation-summary&memberid=${this.props.match.params.memberId}`) .then( r => r.json()) - .then( r => this.setState({totals: r.message.totals, coverage: r.message.Coverage, loadingChecks: false})) + .then( r => this.setState({allTotals: r.message.totals, coverage: r.message.Coverage, loadingChecks: false})) .catch( e =>{ console.error(e) this.setState({loadingChecks: false}) }) } +reloadTotals = (filterTotals) => { + this.setState( prevState => prevState.totals === filterTotals ? null : {totals: filterTotals}) +} + render() { const totals = this.state.totals @@ -112,8 +117,10 @@ export default class PublisherPage extends React.Component { coverage={this.state.coverage} memberId={this.props.match.params.memberId} tutorialOverlay={this.state.tutorialOverlay} - loadingChecks={this.state.loadingChecks}/> - + loadingChecks={this.state.loadingChecks} + totals={this.state.allTotals} + setTotals={this.reloadTotals}/> +