mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-02-01 07:11:02 +00:00
chore: prettier
This commit is contained in:
@@ -4,10 +4,11 @@ import { useTranslation } from "react-i18next";
|
|||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import "./text-field.scss";
|
import "./text-field.scss";
|
||||||
|
|
||||||
export interface TextFieldProps extends React.DetailedHTMLProps<
|
export interface TextFieldProps
|
||||||
React.InputHTMLAttributes<HTMLInputElement>,
|
extends React.DetailedHTMLProps<
|
||||||
HTMLInputElement
|
React.InputHTMLAttributes<HTMLInputElement>,
|
||||||
> {
|
HTMLInputElement
|
||||||
|
> {
|
||||||
theme?: "primary" | "dark";
|
theme?: "primary" | "dark";
|
||||||
label?: string | React.ReactNode;
|
label?: string | React.ReactNode;
|
||||||
hint?: string | React.ReactNode;
|
hint?: string | React.ReactNode;
|
||||||
@@ -42,7 +43,10 @@ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
|
|||||||
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
||||||
const { t } = useTranslation("forms");
|
const { t } = useTranslation("forms");
|
||||||
const showPasswordToggleButton = props.type === "password";
|
const showPasswordToggleButton = props.type === "password";
|
||||||
const inputType = props.type === "password" && isPasswordVisible ? "text" : props.type ?? "text";
|
const inputType =
|
||||||
|
props.type === "password" && isPasswordVisible
|
||||||
|
? "text"
|
||||||
|
: (props.type ?? "text");
|
||||||
const hintContent = error ? (
|
const hintContent = error ? (
|
||||||
<small className="text-field-container__error-label">{error}</small>
|
<small className="text-field-container__error-label">{error}</small>
|
||||||
) : hint ? (
|
) : hint ? (
|
||||||
@@ -106,4 +110,4 @@ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
TextField.displayName = "TextField";
|
TextField.displayName = "TextField";
|
||||||
|
|||||||
Reference in New Issue
Block a user