mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
chore(web): add prettier and format
This commit is contained in:
@@ -1,14 +1,7 @@
|
||||
import {
|
||||
Box,
|
||||
InputGroup,
|
||||
InputLeftElement,
|
||||
InputRightElement,
|
||||
Text,
|
||||
Input,
|
||||
} from "@chakra-ui/react";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useEffect } from "react";
|
||||
import { IInput } from "../../../interfaces/dialog";
|
||||
import { Box, InputGroup, InputLeftElement, InputRightElement, Text, Input } from '@chakra-ui/react';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { useEffect } from 'react';
|
||||
import { IInput } from '../../../interfaces/dialog';
|
||||
|
||||
interface Props {
|
||||
row: IInput;
|
||||
@@ -20,7 +13,7 @@ interface Props {
|
||||
|
||||
const InputField: React.FC<Props> = (props) => {
|
||||
useEffect(() => {
|
||||
if(props.row.default) props.handleChange(props.row.default, props.index);
|
||||
if (props.row.default) props.handleChange(props.row.default, props.index);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -29,20 +22,13 @@ const InputField: React.FC<Props> = (props) => {
|
||||
<Text>{props.row.label}</Text>
|
||||
<InputGroup>
|
||||
{props.row.icon && (
|
||||
<InputLeftElement
|
||||
pointerEvents="none"
|
||||
children={<FontAwesomeIcon icon={props.row.icon} />}
|
||||
/>
|
||||
<InputLeftElement pointerEvents="none" children={<FontAwesomeIcon icon={props.row.icon} />} />
|
||||
)}
|
||||
<Input
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.handleChange(e.target.value, props.index)}
|
||||
placeholder={props.row.placeholder}
|
||||
defaultValue={props.row.default}
|
||||
type={
|
||||
!props.row.password || props.passwordStates[props.index]
|
||||
? "text"
|
||||
: "password"
|
||||
}
|
||||
type={!props.row.password || props.passwordStates[props.index] ? 'text' : 'password'}
|
||||
/>
|
||||
{props.row.password && (
|
||||
<InputRightElement
|
||||
@@ -51,7 +37,7 @@ const InputField: React.FC<Props> = (props) => {
|
||||
children={
|
||||
<FontAwesomeIcon
|
||||
fixedWidth
|
||||
icon={props.passwordStates[props.index] ? "eye" : "eye-slash"}
|
||||
icon={props.passwordStates[props.index] ? 'eye' : 'eye-slash'}
|
||||
fontSize="1em"
|
||||
style={{ paddingRight: 8 }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user