mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 00:19:21 +00:00
style: input text alignment
This commit is contained in:
committed by
Carlos Valente
parent
71a7fe96d1
commit
b8d5a30caf
@@ -11,11 +11,12 @@ interface TimeInputProps<T extends string> {
|
|||||||
time?: number;
|
time?: number;
|
||||||
placeholder: string;
|
placeholder: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
align?: 'left' | 'center';
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
|
export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
|
||||||
const { name, submitHandler, time = 0, placeholder, disabled, className } = props;
|
const { name, submitHandler, time = 0, placeholder, disabled, align = 'center', className } = props;
|
||||||
const { emitError } = useEmitLog();
|
const { emitError } = useEmitLog();
|
||||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||||
const [value, setValue] = useState<string>('');
|
const [value, setValue] = useState<string>('');
|
||||||
@@ -135,7 +136,7 @@ export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
|
|||||||
maxWidth='7.5em'
|
maxWidth='7.5em'
|
||||||
letterSpacing='1px'
|
letterSpacing='1px'
|
||||||
autoComplete='off'
|
autoComplete='off'
|
||||||
textAlign='center'
|
textAlign={align}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,3 @@ $input-delayed-border-color: $ontime-delay-text;
|
|||||||
border: 1px solid $input-delayed-border-color;
|
border: 1px solid $input-delayed-border-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputField {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function TimeInputWithButton<T extends string>(props: PropsWithCh
|
|||||||
submitHandler={submitHandler}
|
submitHandler={submitHandler}
|
||||||
time={time}
|
time={time}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
className={style.inputField}
|
align='left'
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user