Skip to content

Commit

Permalink
Fix forbidden prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstotsky committed May 3, 2023
1 parent 0e702a4 commit fab3c20
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const AccountSummaryFeeTierVolume = ({ data, t }) => {

AccountSummaryFeeTierVolume.propTypes = {
t: PropTypes.func.isRequired,
data: PropTypes.arrayOf(PropTypes.object).isRequired,
data: PropTypes.arrayOf(PropTypes.shape({
curr: PropTypes.string,
})).isRequired,
}

export default memo(AccountSummaryFeeTierVolume)
4 changes: 3 additions & 1 deletion src/components/AccountSummary/AccountSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class AccountSummary extends PureComponent {
takerFeeToCrypto: PropTypes.number,
takerFeeToFiat: PropTypes.number,
takerFeeToStable: PropTypes.number,
trade_vol_30d: PropTypes.arrayOf(PropTypes.object),
trade_vol_30d: PropTypes.arrayOf(PropTypes.shape({
curr: PropTypes.string,
})),
}),
dataReceived: PropTypes.bool.isRequired,
fetchData: PropTypes.func.isRequired,
Expand Down
4 changes: 3 additions & 1 deletion src/components/Auth/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class Auth extends PureComponent {
isUsersLoaded: PropTypes.bool,
t: PropTypes.func.isRequired,
usersLoading: PropTypes.bool,
users: PropTypes.arrayOf(PropTypes.object).isRequired,
users: PropTypes.arrayOf(PropTypes.shape({
email: PropTypes.string,
})).isRequired,
}

static defaultProps = {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Candles/Candles.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const TYPE = queryConstants.MENU_CANDLES
class Candles extends PureComponent {
static propTypes = {
candles: PropTypes.shape({
entries: PropTypes.arrayOf(PropTypes.object),
entries: PropTypes.arrayOf(PropTypes.shape({
time: PropTypes.number,
})),
isLoading: PropTypes.bool,
nextPage: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
}),
Expand All @@ -49,7 +51,9 @@ class Candles extends PureComponent {
t: PropTypes.func.isRequired,
toggleGoToRangeDialog: PropTypes.func.isRequired,
trades: PropTypes.shape({
entries: PropTypes.arrayOf(PropTypes.object),
entries: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number,
})),
isLoading: PropTypes.bool,
nextPage: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
}),
Expand Down
4 changes: 3 additions & 1 deletion src/components/Derivatives/Derivatives.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class Derivatives extends PureComponent {
width: PropTypes.number,
})),
dataReceived: PropTypes.bool.isRequired,
entries: PropTypes.arrayOf(PropTypes.object),
entries: PropTypes.arrayOf(PropTypes.shape({
pair: PropTypes.string,
})),
existingPairs: PropTypes.arrayOf(PropTypes.string),
getFullTime: PropTypes.func.isRequired,
inactivePairs: PropTypes.arrayOf(PropTypes.string),
Expand Down
4 changes: 3 additions & 1 deletion src/components/Invoices/Invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class Invoices extends PureComponent {
orderId: PropTypes.string.isRequired,
payCurrencies: PropTypes.arrayOf(PropTypes.string).isRequired,
status: PropTypes.string.isRequired,
invoices: PropTypes.arrayOf(PropTypes.object).isRequired,
invoices: PropTypes.arrayOf(PropTypes.shape({
currency: PropTypes.string,
})).isRequired,
duration: PropTypes.number.isRequired,
merchantName: PropTypes.string.isRequired,
redirectUrl: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ SubAccountRemove.propTypes = {
t: PropTypes.func.isRequired,
masterAccount: PropTypes.string,
removeSubAccount: PropTypes.func.isRequired,
subUsers: PropTypes.arrayOf(PropTypes.object),
subUsers: PropTypes.arrayOf(PropTypes.shape({
email: PropTypes.string,
})),
}
SubAccountRemove.defaultProps = {
subUsers: [],
Expand Down
4 changes: 3 additions & 1 deletion src/components/WeightedAverages/WeightedAverages.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class WeightedAverages extends PureComponent {
width: PropTypes.number,
})),
dataReceived: PropTypes.bool.isRequired,
entries: PropTypes.arrayOf(PropTypes.object),
entries: PropTypes.arrayOf(PropTypes.shape({
pair: PropTypes.string,
})),
existingPairs: PropTypes.arrayOf(PropTypes.string),
inactivePairs: PropTypes.arrayOf(PropTypes.string),
nextPage: PropTypes.oneOfType([
Expand Down
8 changes: 6 additions & 2 deletions src/ui/Charts/Candlestick/CandleStats/CandleStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import _throttle from 'lodash/throttle'

class CandleStats extends React.PureComponent {
static propTypes = {
chart: PropTypes.objectOf(PropTypes.object),
candleSeries: PropTypes.objectOf(PropTypes.object),
chart: PropTypes.objectOf(PropTypes.shape({
ve: PropTypes.string,
})),
candleSeries: PropTypes.objectOf(PropTypes.shape({
_series: PropTypes.string,
})),
defaultCandle: PropTypes.objectOf(PropTypes.number),
}

Expand Down
9 changes: 6 additions & 3 deletions src/ui/Charts/Candlestick/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ const tooltipMargin = 15

class Tooltip extends React.PureComponent {
static propTypes = {
chart: PropTypes.objectOf(PropTypes.object),
chart: PropTypes.objectOf(PropTypes.shape({
ve: PropTypes.string,
})),
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
tradeSeries: PropTypes.objectOf(PropTypes.object),
tradeSeries: PropTypes.objectOf(PropTypes.shape({
_series: PropTypes.string,
})),
t: PropTypes.func.isRequired,
}

Expand Down Expand Up @@ -133,7 +137,6 @@ class Tooltip extends React.PureComponent {

render() {
const { trade } = this.state

return (
<div className='candlestick-tooltip'>
{trade && this.getTradeData()}
Expand Down

0 comments on commit fab3c20

Please sign in to comment.