From 803f1b952a3795e07eeed50553e7dbfad606e108 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Mon, 12 Aug 2024 16:37:57 +0200 Subject: [PATCH] chore: Clean up --- packages/frontend/src/components/form/auto-form.tsx | 1 - .../frontend/src/components/form/fields/checkbox.tsx | 6 +++--- .../frontend/src/components/form/fields/combobox.tsx | 10 +++++----- .../src/components/form/fields/common/label.tsx | 1 + .../src/components/form/fields/common/wrapper.tsx | 1 + .../src/components/form/fields/radio-group.tsx | 1 + .../frontend/src/components/form/fields/select.tsx | 1 + .../steps/account/account-install-configs-view.tsx | 4 ++-- .../steps/license/form-license-install-configs.tsx | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/frontend/src/components/form/auto-form.tsx b/packages/frontend/src/components/form/auto-form.tsx index 08af3b34b..9422a7e29 100644 --- a/packages/frontend/src/components/form/auto-form.tsx +++ b/packages/frontend/src/components/form/auto-form.tsx @@ -10,7 +10,6 @@ import { Form } from '../ui/form'; import { Button } from '../ui/button'; import { cn } from '@/helpers/classnames'; import { AutoFormObject } from '@/components/form/object'; - import { getDefaultValues, getObjectFormSchema } from './utils'; import { Dependency, FieldConfig, ZodObjectOrWrapped } from './type'; diff --git a/packages/frontend/src/components/form/fields/checkbox.tsx b/packages/frontend/src/components/form/fields/checkbox.tsx index 51a8a7737..7a3f8b978 100644 --- a/packages/frontend/src/components/form/fields/checkbox.tsx +++ b/packages/frontend/src/components/form/fields/checkbox.tsx @@ -1,13 +1,13 @@ import { AutoFormInputComponentProps } from '../type'; import { cn } from '@/helpers/classnames'; - -import { FormControl, FormMessage } from '../../ui/form'; -import { Checkbox } from '../../ui/checkbox'; import { AutoFormWrapper } from './common/wrapper'; import { DefaultParent } from './common/children'; import { AutoFormLabel } from './common/label'; import { AutoFormTooltip } from './common/tooltip'; +import { Checkbox } from '../../ui/checkbox'; +import { FormControl, FormMessage } from '../../ui/form'; + export const AutoFormCheckbox = ({ autoFormProps: { isRequired, fieldConfigItem, field, theme, isDisabled }, ...props diff --git a/packages/frontend/src/components/form/fields/combobox.tsx b/packages/frontend/src/components/form/fields/combobox.tsx index 9873970c0..158b06651 100644 --- a/packages/frontend/src/components/form/fields/combobox.tsx +++ b/packages/frontend/src/components/form/fields/combobox.tsx @@ -4,9 +4,13 @@ import { useTranslations } from 'next-intl'; import { Check, ChevronsUpDown } from 'lucide-react'; import { cn } from '@/helpers/classnames'; - import { getBaseSchema } from '../utils'; import { AutoFormInputComponentProps } from '../type'; +import { DefaultParent } from './common/children'; +import { AutoFormWrapper } from './common/wrapper'; +import { AutoFormLabel } from './common/label'; +import { AutoFormTooltip } from './common/tooltip'; + import { FormControl, FormMessage } from '../../ui/form'; import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'; import { Button } from '../../ui/button'; @@ -18,10 +22,6 @@ import { CommandItem, CommandList, } from '../../ui/command'; -import { DefaultParent } from './common/children'; -import { AutoFormWrapper } from './common/wrapper'; -import { AutoFormLabel } from './common/label'; -import { AutoFormTooltip } from './common/tooltip'; export const AutoFormCombobox = ({ autoFormProps: { diff --git a/packages/frontend/src/components/form/fields/common/label.tsx b/packages/frontend/src/components/form/fields/common/label.tsx index 31ab87df1..e587c9774 100644 --- a/packages/frontend/src/components/form/fields/common/label.tsx +++ b/packages/frontend/src/components/form/fields/common/label.tsx @@ -1,5 +1,6 @@ import { FormLabel } from '@/components/ui/form'; import { cn } from '@/helpers/classnames'; + import { AutoFormInputComponentProps } from '../../type'; export const AutoFormLabel = ({ diff --git a/packages/frontend/src/components/form/fields/common/wrapper.tsx b/packages/frontend/src/components/form/fields/common/wrapper.tsx index 0a1df50c4..429dd5e2c 100644 --- a/packages/frontend/src/components/form/fields/common/wrapper.tsx +++ b/packages/frontend/src/components/form/fields/common/wrapper.tsx @@ -1,5 +1,6 @@ import { FormItem } from '@/components/ui/form'; import { cn } from '@/helpers/classnames'; + import { AutoFormInputComponentProps } from '../../type'; export const AutoFormWrapper = ({ diff --git a/packages/frontend/src/components/form/fields/radio-group.tsx b/packages/frontend/src/components/form/fields/radio-group.tsx index aa939c64f..a6ff28503 100644 --- a/packages/frontend/src/components/form/fields/radio-group.tsx +++ b/packages/frontend/src/components/form/fields/radio-group.tsx @@ -1,4 +1,5 @@ import * as z from 'zod'; + import { AutoFormInputComponentProps } from '../type'; import { getBaseSchema } from '../utils'; import { DefaultParent } from './common/children'; diff --git a/packages/frontend/src/components/form/fields/select.tsx b/packages/frontend/src/components/form/fields/select.tsx index 774cb990c..cc9381a91 100644 --- a/packages/frontend/src/components/form/fields/select.tsx +++ b/packages/frontend/src/components/form/fields/select.tsx @@ -1,5 +1,6 @@ import * as z from 'zod'; import { useTranslations } from 'next-intl'; + import { AutoFormInputComponentProps } from '../type'; import { Select, diff --git a/packages/frontend/src/views/admin/views/install/content/steps/account/account-install-configs-view.tsx b/packages/frontend/src/views/admin/views/install/content/steps/account/account-install-configs-view.tsx index 10fdd8f07..f61282b23 100644 --- a/packages/frontend/src/views/admin/views/install/content/steps/account/account-install-configs-view.tsx +++ b/packages/frontend/src/views/admin/views/install/content/steps/account/account-install-configs-view.tsx @@ -7,11 +7,11 @@ import { Progress } from '@/components/ui/progress'; import { Button } from '@/components/ui/button'; import { removeSpecialCharacters } from '@/helpers/special-characters'; import { AutoFormCheckbox } from '@/components/form/fields/checkbox'; - -import { useInstallVitnode } from '../../hooks/use-install-vitnode'; import { AutoForm } from '@/components/form/auto-form'; import { AutoFormInput } from '@/components/form/fields/input'; +import { useInstallVitnode } from '../../hooks/use-install-vitnode'; + export const AccountInstallConfigsView = () => { const t = useTranslations('core'); const { onSubmit, formSchema, values, setValues } = useSignUpView(); diff --git a/packages/frontend/src/views/admin/views/install/content/steps/license/form-license-install-configs.tsx b/packages/frontend/src/views/admin/views/install/content/steps/license/form-license-install-configs.tsx index e99f89c90..2523b2e1a 100644 --- a/packages/frontend/src/views/admin/views/install/content/steps/license/form-license-install-configs.tsx +++ b/packages/frontend/src/views/admin/views/install/content/steps/license/form-license-install-configs.tsx @@ -3,9 +3,9 @@ import * as z from 'zod'; import { Button } from '@/components/ui/button'; import { AutoFormCheckbox } from '@/components/form/fields/checkbox'; +import { AutoForm } from '@/components/form/auto-form'; import { useInstallVitnode } from '../../hooks/use-install-vitnode'; -import { AutoForm } from '@/components/form/auto-form'; export const FormLicenseInstallConfigs = () => { const tCore = useTranslations('core');