Skip to content

Commit

Permalink
refactor(AdvancedOptions): Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 19, 2024
1 parent d4f9ba8 commit 9cca53a
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions lib/components/form/call-taker/advanced-options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable react/prop-types */
// FIXME: Remove the following eslint rule exception.
/* eslint-disable jsx-a11y/label-has-for */
import * as TripFormClasses from '@opentripplanner/trip-form/lib/styled'
import { checkIfModeSettingApplies } from '@opentripplanner/trip-form/lib/MetroModeSelector/utils'
import { injectIntl } from 'react-intl'
Expand All @@ -9,7 +7,6 @@ import {
populateSettingWithValue,
SubmodeSelector
} from '@opentripplanner/trip-form'
import isEmpty from 'lodash.isempty'
import React, { Component, lazy, Suspense } from 'react'
import styled from 'styled-components'

Expand Down Expand Up @@ -43,9 +40,6 @@ export const StyledSubmodeSelector = styled(SubmodeSelector)`
margin: 5px 0;
`

const metersToMiles = (meters) => Math.round(meters * 0.000621371 * 100) / 100
const milesToMeters = (miles) => miles / 0.000621371

/**
* Converts a new TransportMode object to legacy style underscore qualifier
*/
Expand Down Expand Up @@ -80,7 +74,7 @@ class AdvancedOptions extends Component {
this.props.findRoutesIfNeeded()
}

componentDidUpdate(prevProps) {
componentDidUpdate() {
const { routes } = this.props
// Once routes are available, map them to the route options format.
const routeOptions = Object.values(routes).map(this.routeToOption)
Expand Down Expand Up @@ -113,17 +107,6 @@ class AdvancedOptions extends Component {
return bannedRoutes && bannedRoutes.find((o) => o.value === option.value)
}

getDistanceStep = (distanceInMeters) => {
// Determine step for max walk/bike based on current value. Increment by a
// quarter mile if dealing with small values, whatever number will round off
// the number if it is not an integer, or default to one mile.
return metersToMiles(distanceInMeters) <= 2
? '.25'
: metersToMiles(distanceInMeters) % 1 !== 0
? `${metersToMiles(distanceInMeters) % 1}`
: '1'
}

_onSubModeChange = (changedMode) => {
// Get previous transit modes from state and all modes from query.
const transitModes = [...this.state.transitModes]
Expand Down

0 comments on commit 9cca53a

Please sign in to comment.