Skip to content

Commit

Permalink
Allocations: standardize on usePathHelpers
Browse files Browse the repository at this point in the history
Rather than some files using raw `usePath` and some using
`usePathHelpers`, I think it makes sense to standardize on
`usePathHelpers` everywhere.

I also prefer the named import (`{ requestPath }`) to the positional
import (`[ , requestPath ]`)
  • Loading branch information
Chad Ostrowski committed Dec 16, 2019
1 parent 3fa73e4 commit 7bd6d4b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions apps/allocations/app/components/Card/Budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BigNumber from 'bignumber.js'
import { displayCurrency } from '../../utils/helpers'
import * as types from '../../utils/prop-types'

import { usePath } from '../../api-react'
import usePathHelpers from '../../hooks/usePathHelpers'
import {
Card,
IconCheck,
Expand Down Expand Up @@ -48,7 +48,7 @@ Budget.propTypes = {
}

const Wrapper = ({ budget, children, theme }) => {
const [ , requestPath ] = usePath()
const { requestPath } = usePathHelpers()
const { active, amount, id, name, token } = budget
return (
<Link onClick={() => requestPath(`/budgets/${id}`)}>
Expand Down Expand Up @@ -137,11 +137,6 @@ const CardBottom = styled.div`
border-top: 1px solid ${({ theme }) => theme.border};
`

const MenuContainer = styled.div`
align-self: flex-end;
align-items: center;
`

const CardTitle = styled(Text.Block).attrs({
size: 'large',
weight: 'bold',
Expand Down

0 comments on commit 7bd6d4b

Please sign in to comment.