chore(web): add prettier and format

This commit is contained in:
Luke
2022-08-27 15:58:36 +02:00
parent cc76d23419
commit 4a5251b60b
44 changed files with 2933 additions and 1984 deletions

View File

@@ -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 }}
/>