Update DurationInput and remove old classes
This commit is contained in:
parent
d57b0fed23
commit
e8d1da58d5
2 changed files with 6 additions and 35 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
.Duration {
|
.duration {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: var(--input-bound-bg);
|
background: var(--input-bound-bg);
|
||||||
border: 2px solid transparent;
|
border: 2px solid transparent;
|
||||||
|
|
@ -14,22 +14,4 @@
|
||||||
border: 2px solid $blue;
|
border: 2px solid $blue;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Input {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
width: initial;
|
|
||||||
height: 100%;
|
|
||||||
padding: calc($unit-2x - 2px) 0;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus,
|
|
||||||
&:focus-visible {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import React, { useState, ChangeEvent, KeyboardEvent } from 'react'
|
import React, { useState, ChangeEvent, KeyboardEvent } from 'react'
|
||||||
import classNames from 'classnames'
|
|
||||||
|
|
||||||
import Input from '~components/common/Input'
|
import Input from '~components/common/Input'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
|
@ -9,13 +7,14 @@ interface Props
|
||||||
React.InputHTMLAttributes<HTMLInputElement>,
|
React.InputHTMLAttributes<HTMLInputElement>,
|
||||||
HTMLInputElement
|
HTMLInputElement
|
||||||
> {
|
> {
|
||||||
|
bound: boolean
|
||||||
value: number
|
value: number
|
||||||
onValueChange: (value: number) => void
|
onValueChange: (value: number) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const DurationInput = React.forwardRef<HTMLInputElement, Props>(
|
const DurationInput = React.forwardRef<HTMLInputElement, Props>(
|
||||||
function DurationInput(
|
function DurationInput(
|
||||||
{ className, value, onValueChange, ...props },
|
{ bound, className, value, onValueChange, ...props },
|
||||||
forwardedRef
|
forwardedRef
|
||||||
) {
|
) {
|
||||||
// State
|
// State
|
||||||
|
|
@ -178,16 +177,11 @@ const DurationInput = React.forwardRef<HTMLInputElement, Props>(
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(className, { Duration: true })}>
|
<div className={styles.duration}>
|
||||||
<Input
|
<Input
|
||||||
ref={minutesRef}
|
ref={minutesRef}
|
||||||
type="text"
|
type="text"
|
||||||
className={classNames(
|
className="alignRight duration"
|
||||||
{
|
|
||||||
AlignRight: true,
|
|
||||||
},
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
value={getMinutes()}
|
value={getMinutes()}
|
||||||
onChange={handleMinutesChange}
|
onChange={handleMinutesChange}
|
||||||
onKeyUp={handleKeyUp}
|
onKeyUp={handleKeyUp}
|
||||||
|
|
@ -199,12 +193,7 @@ const DurationInput = React.forwardRef<HTMLInputElement, Props>(
|
||||||
<Input
|
<Input
|
||||||
ref={secondsRef}
|
ref={secondsRef}
|
||||||
type="text"
|
type="text"
|
||||||
className={classNames(
|
className="alignRight duration"
|
||||||
{
|
|
||||||
AlignRight: true,
|
|
||||||
},
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
value={getSeconds() > 0 ? `${getSeconds()}`.padStart(2, '0') : ''}
|
value={getSeconds() > 0 ? `${getSeconds()}`.padStart(2, '0') : ''}
|
||||||
onChange={handleSecondsChange}
|
onChange={handleSecondsChange}
|
||||||
onKeyUp={handleKeyUp}
|
onKeyUp={handleKeyUp}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue