mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
refactor(web): move all types into typings folder
This commit is contained in:
@@ -5,19 +5,7 @@ import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import { useLocales } from '../../providers/LocaleProvider';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
export interface AlertProps {
|
||||
header: string;
|
||||
content: string;
|
||||
centered?: boolean;
|
||||
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
||||
overflow?: boolean;
|
||||
cancel?: boolean;
|
||||
labels?: {
|
||||
cancel?: string;
|
||||
confirm?: string;
|
||||
};
|
||||
}
|
||||
import type { AlertProps } from '../../typings';
|
||||
|
||||
const AlertDialog: React.FC = () => {
|
||||
const { locale } = useLocales();
|
||||
|
||||
@@ -3,18 +3,7 @@ import React from 'react';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { useLocales } from '../../providers/LocaleProvider';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import {
|
||||
IInput,
|
||||
ICheckbox,
|
||||
ISelect,
|
||||
INumber,
|
||||
ISlider,
|
||||
IColorInput,
|
||||
OptionValue,
|
||||
IDateInput,
|
||||
ITextarea,
|
||||
ITimeInput,
|
||||
} from '../../interfaces/dialog';
|
||||
import { OptionValue } from '../../typings';
|
||||
import InputField from './components/fields/input';
|
||||
import CheckboxField from './components/fields/checkbox';
|
||||
import SelectField from './components/fields/select';
|
||||
@@ -25,14 +14,7 @@ import ColorField from './components/fields/color';
|
||||
import DateField from './components/fields/date';
|
||||
import TextareaField from './components/fields/textarea';
|
||||
import TimeField from './components/fields/time';
|
||||
|
||||
export interface InputProps {
|
||||
heading: string;
|
||||
rows: Array<IInput | ICheckbox | ISelect | INumber | ISlider | IColorInput | IDateInput | ITextarea | ITimeInput>;
|
||||
options?: {
|
||||
allowCancel?: boolean;
|
||||
};
|
||||
}
|
||||
import type { InputProps } from '../../typings';
|
||||
|
||||
export type FormValues = {
|
||||
test: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Checkbox } from '@mantine/core';
|
||||
import { ICheckbox } from '../../../../interfaces/dialog';
|
||||
import { ICheckbox } from '../../../../typings/dialog';
|
||||
import { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IColorInput } from '../../../../interfaces/dialog';
|
||||
import { IColorInput } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { ColorInput } from '@mantine/core';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IDateInput } from '../../../../interfaces/dialog';
|
||||
import { IDateInput } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { DatePicker, DateRangePicker, TimeInput } from '@mantine/dates';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createStyles, PasswordInput, TextInput } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React from 'react';
|
||||
import { IInput } from '../../../../interfaces/dialog';
|
||||
import { IInput } from '../../../../typings/dialog';
|
||||
import { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NumberInput } from '@mantine/core';
|
||||
import { INumber } from '../../../../interfaces/dialog';
|
||||
import { INumber } from '../../../../typings/dialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MultiSelect, Select } from '@mantine/core';
|
||||
import { ISelect } from '../../../../interfaces/dialog';
|
||||
import { ISelect } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, Slider, Text } from '@mantine/core';
|
||||
import { ISlider } from '../../../../interfaces/dialog';
|
||||
import { ISlider } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Textarea } from '@mantine/core';
|
||||
import { UseFormRegisterReturn } from 'react-hook-form';
|
||||
import { ITextarea } from '../../../../interfaces/dialog';
|
||||
import { ITextarea } from '../../../../typings/dialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { TimeInput } from '@mantine/dates';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { ITimeInput } from '../../../../interfaces/dialog';
|
||||
import { ITimeInput } from '../../../../typings/dialog';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
|
||||
interface Props {
|
||||
|
||||
Reference in New Issue
Block a user