fix: small style tweaks and bug fixes

fix: remove interactive styles from display elements

fix: automation form reset on submit

fix: prevent empty image src
This commit is contained in:
Carlos Valente
2025-08-11 05:58:53 +02:00
committed by Carlos Valente
parent 902edf4a85
commit 836fa52757
7 changed files with 23 additions and 18 deletions
@@ -27,7 +27,7 @@
opacity: 0.4;
}
&:hover {
&:hover:not(.disabled) {
background-color: $gray-1100;
cursor: text;
}
@@ -7,12 +7,22 @@ import style from './TextLikeInput.module.scss';
interface TextLikeInputProps extends HTMLAttributes<HTMLSpanElement> {
offset?: 'over' | 'under' | 'muted' | null;
muted?: boolean;
disabled?: boolean;
}
const TextLikeInput = forwardRef(
({ offset, muted, children, className, ...elementProps }: PropsWithChildren<TextLikeInputProps>, textRef) => {
(
{ offset, muted, disabled, children, className, ...elementProps }: PropsWithChildren<TextLikeInputProps>,
textRef,
) => {
const ref = useRef<HTMLDivElement | null>(null);
const classes = cx([style.textInput, offset && style[offset], muted && style.muted, className]);
const classes = cx([
style.textInput,
offset && style[offset],
muted && style.muted,
disabled && style.disabled,
className,
]);
useImperativeHandle(textRef, () => {
return {
@@ -23,7 +33,7 @@ const TextLikeInput = forwardRef(
});
return (
<div className={classes} tabIndex={0} {...elementProps} ref={ref}>
<div className={classes} tabIndex={disabled ? -1 : 0} {...elementProps} ref={ref}>
{children}
</div>
);