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
Feature/chart data #201
Feature/chart data #201
Conversation
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 changeTimeframe = (t: number) => { | ||
setTimeframe(t) | ||
const changeTimeframe = useCallback((range: ChartRange) => { |
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.
you could curry this function so you don't have to have inline functions
const changeTimeframe = useCallback(
(range: ChartRange) => () => {
setTimeframe(range)
triggerImpact()
},
[],
)
Then just call it right away...
<TouchableWithoutFeedback onPress={changeTimeframe('daily')}>
@@ -66,60 +85,47 @@ const WalletChart = ({ height }: Props) => { | |||
> | |||
<CarotRight width={12} height={12} style={{ marginRight: 4 }} /> |
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.
Would be a good idea to get rid of some of the inline styling
<Box flexDirection="row" alignItems="center">
<CarotRight width={12} height={12} />
<Text variant="body2" marginLeft="s">
{round(focusedData?.down, 2).toLocaleString()}
</Text>
</Box
justifyContent="center" | ||
position="absolute" | ||
> | ||
<ActivityIndicator /> |
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.
ActivityIndicator needs a color prop in order to show on Android
|
||
const handleFocusData = (data: ChartData | null): void => { | ||
setFocusedData(data) | ||
const handleFocusData = (chartData: ChartData | null): void => { |
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.
Could useCallback
here
id: [2, i].join('-'), | ||
})), | ||
} | ||
|
||
export default WalletChart |
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.
might want to memoize this?
src/utils/walletClient.ts
Outdated
@@ -12,6 +13,7 @@ const makeRequest = async (url: string, opts: RequestInit) => { | |||
} | |||
|
|||
const route = [Config.WALLET_API_BASE_URL, url].join('/') | |||
// const route = ['http://localhost:4000/api', url].join('/') |
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.
remove?
* main: add japanese (#196) Feature/notifications UI updates (#197) Remove animation pandemonium (#198) Handle hotspot not yet being added to the chain. (#204) qr scan copy, learn link copy, externlize for translation (#199) Hotspot Checklist (#194) Bugfix/hotspot onboarding (#192) Feature/activity loading ux (#186)
resolves #88
depends on wallet api PR: https://github.com/helium/wallet-api/pull/13