Fix swap prop type errors (#9532)

* Fix swap prop type errors

* Fix prop type of sortColumn in sort-list
feature/default_network_editable
Dan J Miller 4 years ago committed by GitHub
parent 3353c33981
commit 0ebc465221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/app/pages/swaps/index.js
  2. 2
      ui/app/pages/swaps/select-quote-popover/quote-details/quote-details.js
  3. 2
      ui/app/pages/swaps/select-quote-popover/select-quote-popover-constants.js
  4. 4
      ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.js

@ -324,7 +324,7 @@ export default function Swap () {
return aggregatorMetadata return aggregatorMetadata
? ( ? (
<LoadingQuote <LoadingQuote
loadingComplete={!fetchingQuotes && Object.values(quotes).length} loadingComplete={!fetchingQuotes && Boolean(Object.values(quotes).length)}
onDone={async () => { onDone={async () => {
await dispatch(setBackgroundSwapRouteState('')) await dispatch(setBackgroundSwapRouteState(''))

@ -96,7 +96,7 @@ const QuoteDetails = ({
} }
QuoteDetails.propTypes = { QuoteDetails.propTypes = {
slippage: PropTypes.string.isRequired, slippage: PropTypes.number.isRequired,
sourceTokenValue: PropTypes.string.isRequired, sourceTokenValue: PropTypes.string.isRequired,
sourceTokenSymbol: PropTypes.string.isRequired, sourceTokenSymbol: PropTypes.string.isRequired,
destinationTokenValue: PropTypes.string.isRequired, destinationTokenValue: PropTypes.string.isRequired,

@ -1,7 +1,7 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
export const QUOTE_DATA_ROWS_PROPTYPES_SHAPE = PropTypes.shape({ export const QUOTE_DATA_ROWS_PROPTYPES_SHAPE = PropTypes.shape({
aggregatorId: PropTypes.string.isRequired, aggId: PropTypes.string.isRequired,
amountReceiving: PropTypes.string.isRequired, amountReceiving: PropTypes.string.isRequired,
destinationTokenDecimals: PropTypes.number.isRequired, destinationTokenDecimals: PropTypes.number.isRequired,
destinationTokenSymbol: PropTypes.string.isRequired, destinationTokenSymbol: PropTypes.string.isRequired,

@ -21,7 +21,7 @@ export default function SortList ({
swapToSymbol, swapToSymbol,
sortDirection, sortDirection,
setSortDirection, setSortDirection,
sortColumn, sortColumn = null,
setSortColumn, setSortColumn,
}) { }) {
const t = useContext(I18nContext) const t = useContext(I18nContext)
@ -171,6 +171,6 @@ SortList.propTypes = {
quoteDataRows: PropTypes.arrayOf(QUOTE_DATA_ROWS_PROPTYPES_SHAPE).isRequired, quoteDataRows: PropTypes.arrayOf(QUOTE_DATA_ROWS_PROPTYPES_SHAPE).isRequired,
sortDirection: PropTypes.number.isRequired, sortDirection: PropTypes.number.isRequired,
setSortDirection: PropTypes.func.isRequired, setSortDirection: PropTypes.func.isRequired,
sortColumn: PropTypes.string.isRequired, sortColumn: PropTypes.string,
setSortColumn: PropTypes.func.isRequired, setSortColumn: PropTypes.func.isRequired,
} }

Loading…
Cancel
Save