Skip to content

Commit

Permalink
Removing magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanSatyro committed Dec 14, 2018
1 parent 0d7444e commit 270002f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions react/components/MiniCartContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ class MiniCartContent extends Component {
large
) => {
const items = this.props.data.orderForm.items
const MIN_ITEMS_TO_SCROLL = 2

const classes = classNames(
`${minicart.content} overflow-x-hidden pa1`,
{
[`${minicart.contentSmall} bg-base`]: !large,
'overflow-y-auto': large,
'overflow-y-scroll': items.length > 2 && !large,
'overflow-y-hidden': items.length <= 2 && !large,
'overflow-y-scroll': items.length > MIN_ITEMS_TO_SCROLL && !large,
'overflow-y-hidden': items.length <= MIN_ITEMS_TO_SCROLL && !large,
}
)

Expand Down

0 comments on commit 270002f

Please sign in to comment.