Skip to content
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

Merged
merged 12 commits into from Feb 18, 2021
Merged

Feature/chart data #201

merged 12 commits into from Feb 18, 2021

Conversation

allenan
Copy link
Member

@allenan allenan commented Feb 17, 2021

resolves #88

depends on wallet api PR: https://github.com/helium/wallet-api/pull/13

Copy link
Contributor

@matthewcarlreetz matthewcarlreetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few suggestions for you. Everything seems to be working well.

There may be one alignment issue...
iPhone 11 2021-02-17 at 2 22 30 PM


const changeTimeframe = (t: number) => {
setTimeframe(t)
const changeTimeframe = useCallback((range: ChartRange) => {
Copy link
Contributor

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 }} />
Copy link
Contributor

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 />
Copy link
Contributor

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 => {
Copy link
Contributor

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
Copy link
Contributor

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?

@@ -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('/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

@allenan
Copy link
Member Author

allenan commented Feb 17, 2021

Just a few suggestions for you. Everything seems to be working well.

There may be one alignment issue...
iPhone 11 2021-02-17 at 2 22 30 PM

damn ok I'll tilt at the alignment windmill some more. mine are the reverse, with the blue bars being the largest and the green dots at the top.

* 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)
@allenan allenan merged commit 9434e19 into main Feb 18, 2021
@allenan allenan deleted the feature/chart-data branch February 18, 2021 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wallet Chart: Credits and Debits
2 participants