diff --git a/web/src/features/dialog/AlertDialog.tsx b/web/src/features/dialog/AlertDialog.tsx index a6643a8..a828ec0 100644 --- a/web/src/features/dialog/AlertDialog.tsx +++ b/web/src/features/dialog/AlertDialog.tsx @@ -57,13 +57,7 @@ const AlertDialog: React.FC = () => { {dialogData.content} {dialogData.cancel && ( - )} diff --git a/web/src/features/dialog/InputDialog.tsx b/web/src/features/dialog/InputDialog.tsx index f9cf774..658933a 100644 --- a/web/src/features/dialog/InputDialog.tsx +++ b/web/src/features/dialog/InputDialog.tsx @@ -1,4 +1,4 @@ -import { Modal, ModalOverlay, ModalContent, ModalFooter, ModalHeader, ModalBody, Button } from '@chakra-ui/react'; +import { Group, Modal, Button, Stack } from '@mantine/core'; import React from 'react'; import { useNuiEvent } from '../../hooks/useNuiEvent'; import { useLocales } from '../../providers/LocaleProvider'; @@ -62,42 +62,48 @@ const InputDialog: React.FC = () => { return ( <> - - - { - if (e.key === 'Enter' && visible) return handleConfirm(); - }} - > - {fields.heading} - - {fields.rows.map((row: IInput | ICheckbox | ISelect | INumber | ISlider, index) => ( - - {row.type === 'input' && ( - - )} - {row.type === 'checkbox' && } - {row.type === 'select' && } - {row.type === 'number' && } - {row.type === 'slider' && } - - ))} - - - - - - + + ); diff --git a/web/src/features/dialog/components/fields/checkbox.tsx b/web/src/features/dialog/components/fields/checkbox.tsx index 6c36afc..bab6483 100644 --- a/web/src/features/dialog/components/fields/checkbox.tsx +++ b/web/src/features/dialog/components/fields/checkbox.tsx @@ -1,7 +1,6 @@ -import { Box, Checkbox, HStack, Text } from '@chakra-ui/react'; +import { Checkbox } from '@mantine/core'; import { useEffect } from 'react'; import { ICheckbox } from '../../../../interfaces/dialog'; -import Label from '../Label'; interface Props { row: ICheckbox; @@ -15,16 +14,12 @@ const CheckboxField: React.FC = (props) => { }, []); return ( - <> - - ) => props.handleChange(e.target.checked, props.index)} - defaultChecked={props.row.checked} - > - - - + ) => props.handleChange(e.target.checked, props.index)} + defaultChecked={props.row.checked} + /> ); }; diff --git a/web/src/features/dialog/components/fields/input.tsx b/web/src/features/dialog/components/fields/input.tsx index 0535e0f..5347d91 100644 --- a/web/src/features/dialog/components/fields/input.tsx +++ b/web/src/features/dialog/components/fields/input.tsx @@ -1,8 +1,7 @@ -import { Box, InputGroup, InputLeftElement, InputRightElement, Input } from '@chakra-ui/react'; +import { TextInput } from '@mantine/core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useEffect } from 'react'; import { IInput } from '../../../../interfaces/dialog'; -import Label from '../Label'; interface Props { row: IInput; @@ -18,37 +17,25 @@ const InputField: React.FC = (props) => { }, []); return ( - <> - - - + ) + } + /> ); }; diff --git a/web/src/features/dialog/components/fields/number.tsx b/web/src/features/dialog/components/fields/number.tsx index 4a82969..f3c3049 100644 --- a/web/src/features/dialog/components/fields/number.tsx +++ b/web/src/features/dialog/components/fields/number.tsx @@ -1,17 +1,7 @@ -import { - Box, - NumberInput, - NumberInputField, - NumberInputStepper, - NumberIncrementStepper, - NumberDecrementStepper, - InputLeftElement, - InputGroup, -} from '@chakra-ui/react'; +import { NumberInput } from '@mantine/core'; import { useEffect } from 'react'; import { INumber } from '../../../../interfaces/dialog'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import Label from '../Label'; interface Props { row: INumber; @@ -25,28 +15,16 @@ const NumberField: React.FC = (props) => { }, []); return ( - - + props.handleChange(value as number, props.index)} + icon={props.row.icon && } + /> ); }; diff --git a/web/src/features/dialog/components/fields/select.tsx b/web/src/features/dialog/components/fields/select.tsx index 28b7dea..7626667 100644 --- a/web/src/features/dialog/components/fields/select.tsx +++ b/web/src/features/dialog/components/fields/select.tsx @@ -1,4 +1,4 @@ -import { Box, Select } from '@chakra-ui/react'; +import { Select } from '@mantine/core'; import { useEffect } from 'react'; import { ISelect } from '../../../../interfaces/dialog'; @@ -8,6 +8,7 @@ interface Props { handleChange: (value: string, index: number) => void; } +// TODO: set label to value of value when there is no label provided const SelectField: React.FC = (props) => { useEffect(() => { if (props.row.default) { @@ -20,27 +21,14 @@ const SelectField: React.FC = (props) => { }, []); return ( - <> - - - - +