-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SALAD-23966] [SALAD-23964] WebApp - Add aggregate data type #1269
base: master
Are you sure you want to change the base?
Conversation
packages/web-app/src/modules/earn-views/components/EarningHistory/utils.ts
Outdated
Show resolved
Hide resolved
packages/web-app/src/modules/earn-views/components/EarningHistory/EarningHistory.tsx
Outdated
Show resolved
Hide resolved
@@ -69,43 +65,103 @@ interface Props extends WithStyles<typeof styles> { | |||
|
|||
const EarningHistoryRaw = ({ classes, viewLast24Hours, viewLast7Days, viewLast30Days }: Props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename is EarningHistory.tsx
, but we keep EarningHistoryRaw
component here, let's make naming aligned
packages/web-app/src/modules/earn-views/components/EarningLineChart/EarningLineChart.tsx
Outdated
Show resolved
Hide resolved
packages/web-app/src/modules/earn-views/components/EarningLineChart/EarningLineChart.tsx
Outdated
Show resolved
Hide resolved
}, | ||
] | ||
|
||
const machineEarnings = isAggregateView ? aggregateMachineEarnings : individualMachineEarnings | ||
|
||
const withMachinesData = machines !== null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const withMachinesData = machines !== null | |
const withMachines = machines !== null |
earningsPerMachine: store.balance.earningsPerMachine, | ||
machines: store.balance.machines, | ||
daysShowing: store.balance.getDaysShowingEarnings, | ||
fetchEarningsPerMachine: store.balance.fetchEarningsPerMachine, | ||
...props, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to not rewrite
earningsPerMachine: store.balance.earningsPerMachine, | |
machines: store.balance.machines, | |
daysShowing: store.balance.getDaysShowingEarnings, | |
fetchEarningsPerMachine: store.balance.fetchEarningsPerMachine, | |
...props, | |
...props, | |
earningsPerMachine: store.balance.earningsPerMachine, | |
machines: store.balance.machines, | |
daysShowing: store.balance.getDaysShowingEarnings, | |
fetchEarningsPerMachine: store.balance.fetchEarningsPerMachine,``` |
}, [earningsPerMachine, isAggregateView]) | ||
|
||
useEffect(() => { | ||
if (Object.values(machineOptions).length > 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why specifically 10?
worth moving to the const with explanatory naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Description: Add aggregate data type