mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
refactor(web/dialog): split interfaces (#68)
* tweak(interface/menu): SetNuiFocusKeepInput Default to allow input; disable with "disableInput = false" during registration. * refactor(web/dialog): Split interfaces for better typing of row options for different input types * fix(web/dialog): Use proper type for onChange event Co-authored-by: Linden <65407488+thelindat@users.noreply.github.com>
This commit is contained in:
@@ -8,12 +8,12 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useEffect } from "react";
|
||||
import { Row } from "../../../interfaces/dialog";
|
||||
import { IInput } from "../../../interfaces/dialog";
|
||||
|
||||
interface Props {
|
||||
row: Row;
|
||||
row: IInput;
|
||||
index: number;
|
||||
handleChange: (value: string | number | boolean, index: number) => void;
|
||||
handleChange: (value: string, index: number) => void;
|
||||
passwordStates: boolean[];
|
||||
handlePasswordStates: (index: number) => void;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ const InputField: React.FC<Props> = (props) => {
|
||||
/>
|
||||
)}
|
||||
<Input
|
||||
onChange={(e) => props.handleChange(e.target.value, props.index)}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.handleChange(e.target.value, props.index)}
|
||||
placeholder={props.row.placeholder}
|
||||
defaultValue={props.row.default}
|
||||
type={
|
||||
|
||||
Reference in New Issue
Block a user