:/
Something went wrong
diff --git a/client/src/common/components/eventTimes/EventTimes.jsx b/client/src/common/components/eventTimes/EventTimes.jsx deleted file mode 100644 index dffeb68d1..000000000 --- a/client/src/common/components/eventTimes/EventTimes.jsx +++ /dev/null @@ -1,70 +0,0 @@ -import { useCallback, useContext } from 'react'; -import EditableTimer from 'common/components/input/EditableTimer'; -import PropTypes from 'prop-types'; - -import { LoggingContext } from '../../context/LoggingContext'; -import { validateTimes } from '../../utils/entryValidator'; - -export default function EventTimes(props) { - const { actionHandler, delay, timeStart, timeEnd, previousEnd } = props; - const { emitWarning } = useContext(LoggingContext); - - /** - * This code is duplicated from EventTimesVertical - * @description Validates a time input against its pair - * @param {string} entry - field to validate: timeStart, timeEnd, durationOverride - * @param {number} val - field value - * @return {boolean} - */ - const handleValidate = useCallback( - () => (entry, val) => { - if (val == null || timeStart == null || timeEnd == null) return true; - if (timeStart === 0) return true; - - let start = timeStart; - let end = timeEnd; - if (entry === 'timeStart') { - start = val; - } else if (entry === 'timeEnd') { - end = val; - } else return entry === 'durationOverride'; - - const valid = validateTimes(start, end); - // give warning but not enforce validation - if (!valid.value) { - emitWarning(`Time Input Warning: ${valid.catch}`); - } - return valid.value; - }, - [emitWarning, timeEnd, timeStart] - ); - - return ( - <> -