refactor: small tweaks and fixes

This commit is contained in:
Carlos Valente
2024-03-06 22:42:20 +01:00
committed by GitHub
parent 8196ea584d
commit d22cc48565
61 changed files with 401 additions and 198 deletions
@@ -91,9 +91,6 @@ export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
(event: KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
inputRef.current?.blur();
validateAndSubmit((event.target as HTMLInputElement).value);
} else if (event.key === 'Tab') {
validateAndSubmit((event.target as HTMLInputElement).value);
}
if (event.key === 'Escape') {
ignoreChange.current = true;
@@ -101,7 +98,7 @@ export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
resetValue();
}
},
[resetValue, validateAndSubmit],
[resetValue],
);
const onBlurHandler = useCallback(
@@ -1,7 +1,7 @@
.emptyContainer {
width: 100%;
text-align: center;
color: $gray-1350;
color: $white-10;
.empty {
width: 100%;
@@ -5,7 +5,7 @@ import EmptyImage from '../../../assets/images/empty.svg?react';
import style from './Empty.module.scss';
interface EmptyProps {
text: string;
text?: string;
style?: CSSProperties;
}
@@ -14,7 +14,7 @@ export default function Empty(props: EmptyProps) {
return (
<div className={style.emptyContainer} {...rest}>
<EmptyImage className={style.empty} />
<span className={style.text}>{text}</span>
{text && <span className={style.text}>{text}</span>}
</div>
);
}