Skip to content

Commit

Permalink
Apply project prettier config to NumericStepper
Browse files Browse the repository at this point in the history
  • Loading branch information
estacioneto committed Feb 26, 2021
1 parent b8b25a1 commit 82529e5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions react/components/NumericStepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'

import styles from '../Input/Input.css'

const normalizeMin = (min) => (min == null ? -Infinity : min)
const normalizeMax = (max) => (max == null ? Infinity : max)
const normalizeMin = min => (min == null ? -Infinity : min)
const normalizeMax = max => (max == null ? Infinity : max)

const validateValue = (
value,
Expand All @@ -26,7 +26,9 @@ const validateValue = (
}

const parsedValue = parseFloat(value, 10)
const normalizedValue = isTyping ? Math.round(parsedValue / unitMultiplier) : parsedValue
const normalizedValue = isTyping
? Math.round(parsedValue / unitMultiplier)
: parsedValue

return Math.max(min, Math.min(max, normalizedValue))
}
Expand Down Expand Up @@ -177,19 +179,19 @@ class NumericStepper extends Component {
}
}

handleTypeQuantity = (event) => {
handleTypeQuantity = event => {
this.changeValue(event.target.value, event, true)
}

handleIncreaseValue = (event) => {
handleIncreaseValue = event => {
this.changeValue(this.state.value + 1, event, false)
}

handleDecreaseValue = (event) => {
handleDecreaseValue = event => {
this.changeValue(this.state.value - 1, event, false)
}

handleFocusInput = (e) => {
handleFocusInput = e => {
e.target.select()
this.setState({ inputFocused: true })
}
Expand Down

0 comments on commit 82529e5

Please sign in to comment.