mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(web/dialog): Use conventional naming
This commit is contained in:
@@ -66,15 +66,15 @@ const InputDialog: React.FC = () => {
|
|||||||
const [visible, setVisible] = React.useState(false);
|
const [visible, setVisible] = React.useState(false);
|
||||||
const { locale } = useLocales();
|
const { locale } = useLocales();
|
||||||
|
|
||||||
const [passwordStates, setShowPassword] = React.useState<Array<boolean>>([]);
|
const [passwordStates, setPasswordStates] = React.useState<Array<boolean>>([]);
|
||||||
const handleShowPassword = (index: number) => {
|
const handlePasswordStates = (index: number) => {
|
||||||
setShowPassword({
|
setPasswordStates({
|
||||||
...passwordStates, [index]: !passwordStates[index]
|
...passwordStates, [index]: !passwordStates[index]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
useNuiEvent<Props>("openDialog", (data) => {
|
useNuiEvent<Props>("openDialog", (data) => {
|
||||||
setShowPassword([]);
|
setPasswordStates([]);
|
||||||
setFields(data);
|
setFields(data);
|
||||||
setInputData([]);
|
setInputData([]);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
@@ -119,12 +119,12 @@ const InputDialog: React.FC = () => {
|
|||||||
<InputGroup>
|
<InputGroup>
|
||||||
<Input
|
<Input
|
||||||
onChange={(e) => handleChange(e.target.value, index)}
|
onChange={(e) => handleChange(e.target.value, index)}
|
||||||
type={!row.password || passwordStates[index] ? 'text' : 'password'}
|
type={!row.password || passwordStates[index] ? "text" : "password"}
|
||||||
/>
|
/>
|
||||||
{row.password && (
|
{row.password && (
|
||||||
<InputRightElement
|
<InputRightElement
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
onClick={() => handleShowPassword(index)}
|
onClick={() => handlePasswordStates(index)}
|
||||||
children={
|
children={
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
fixedWidth
|
fixedWidth
|
||||||
|
|||||||
Reference in New Issue
Block a user