From c8ef68283b3bf5d7069daae1d5665558bb42eaef Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 27 Feb 2019 23:33:26 -0500 Subject: [PATCH] Fixed: More UI tweaks --- frontend/src/Activity/Queue/QueueConnector.js | 1 + frontend/src/Calendar/CalendarConnector.js | 1 + frontend/src/Components/Page/PageJumpBar.js | 11 ++--------- .../src/Wanted/CutoffUnmet/CutoffUnmetConnector.js | 1 + 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/Activity/Queue/QueueConnector.js b/frontend/src/Activity/Queue/QueueConnector.js index f7f853089..ae2c50433 100644 --- a/frontend/src/Activity/Queue/QueueConnector.js +++ b/frontend/src/Activity/Queue/QueueConnector.js @@ -164,6 +164,7 @@ class QueueConnector extends Component { } QueueConnector.propTypes = { + useCurrentPage: PropTypes.bool.isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired, fetchQueue: PropTypes.func.isRequired, gotoQueueFirstPage: PropTypes.func.isRequired, diff --git a/frontend/src/Calendar/CalendarConnector.js b/frontend/src/Calendar/CalendarConnector.js index c5f3e32e6..a97589c59 100644 --- a/frontend/src/Calendar/CalendarConnector.js +++ b/frontend/src/Calendar/CalendarConnector.js @@ -155,6 +155,7 @@ class CalendarConnector extends Component { } CalendarConnector.propTypes = { + useCurrentPage: PropTypes.bool.isRequired, time: PropTypes.string, view: PropTypes.string.isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired, diff --git a/frontend/src/Components/Page/PageJumpBar.js b/frontend/src/Components/Page/PageJumpBar.js index f555d5426..503cf04cd 100644 --- a/frontend/src/Components/Page/PageJumpBar.js +++ b/frontend/src/Components/Page/PageJumpBar.js @@ -1,6 +1,6 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import dimensions from 'Styles/Variables/dimensions'; import Measure from 'Components/Measure'; import PageJumpBarItem from './PageJumpBarItem'; @@ -8,7 +8,7 @@ import styles from './PageJumpBar.css'; const ITEM_HEIGHT = parseInt(dimensions.jumpBarItemHeight); -class PageJumpBar extends Component { +class PageJumpBar extends PureComponent { // // Lifecycle @@ -26,13 +26,6 @@ class PageJumpBar extends Component { this.computeVisibleItems(); } - shouldComponentUpdate(nextProps, nextState) { - return ( - nextProps.items !== this.props.items || - nextState.height !== this.state.height - ); - } - componentDidUpdate(prevProps, prevState) { if ( prevProps.items !== this.props.items || diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js index 8af140999..f1259b258 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js @@ -162,6 +162,7 @@ class CutoffUnmetConnector extends Component { } CutoffUnmetConnector.propTypes = { + useCurrentPage: PropTypes.bool.isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired, fetchCutoffUnmet: PropTypes.func.isRequired, gotoCutoffUnmetFirstPage: PropTypes.func.isRequired,