mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
chore(web): relocations and cleanups (#957)
* delete manifest (vite-plugin-pwa generates it) * fix upper case letter on screen components * fix imports of screens components missing upper case * remove default export from Base.tsx * move RegexPlayground to settings import * replace some relative path imports * remove React and ununsed imports * small alignments on vite.config.ts * move Dashboard and Releases to screens * move filters/index.tsx to filters/index.ts * remove default export from APIKeyAddForm * remove default export from FilterAddForm * organize imports and exports for the router * add .vscode workspace to gitignore * some touchs on .gitignore file * fix some eslint rules
This commit is contained in:
parent
72bb2ddadb
commit
c7ec93722b
41 changed files with 187 additions and 230 deletions
|
@ -9,10 +9,10 @@ import { ArrowPathIcon, CheckIcon } from "@heroicons/react/24/solid";
|
|||
import { ClockIcon, ExclamationCircleIcon, NoSymbolIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
import { classNames, simplifyDate } from "@utils";
|
||||
import { Tooltip } from "../tooltips/Tooltip";
|
||||
import { Tooltip } from "@components/tooltips/Tooltip";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { APIClient } from "@api/APIClient";
|
||||
import { filterKeys } from "@screens/filters/list";
|
||||
import { filterKeys } from "@screens/filters/List";
|
||||
import { toast } from "react-hot-toast";
|
||||
import Toast from "@components/notifications/Toast";
|
||||
import { RingResizeSpinner } from "@components/Icons";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import React, { Fragment } from "react";
|
||||
import { Fragment } from "react";
|
||||
import { Field, FieldProps } from "formik";
|
||||
import { Listbox, Transition } from "@headlessui/react";
|
||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/24/solid";
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Field } from "formik";
|
|||
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
||||
import { OptionBasicTyped } from "@domain/constants";
|
||||
import CreatableSelect from "react-select/creatable";
|
||||
import { CustomTooltip } from "../tooltips/CustomTooltip";
|
||||
import { CustomTooltip } from "@components/tooltips/CustomTooltip";
|
||||
|
||||
interface SelectFieldProps<T> {
|
||||
name: string;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Field } from "formik";
|
|||
import { Switch as HeadlessSwitch } from "@headlessui/react";
|
||||
|
||||
import { classNames } from "@utils";
|
||||
import { CustomTooltip } from "../tooltips/CustomTooltip";
|
||||
import { CustomTooltip } from "@components/tooltips/CustomTooltip";
|
||||
|
||||
type SwitchProps<V = unknown> = {
|
||||
label?: string
|
||||
|
@ -137,4 +137,4 @@ const SwitchGroup = ({
|
|||
</HeadlessSwitch.Group>
|
||||
);
|
||||
|
||||
export { SwitchGroup };
|
||||
export { SwitchGroup };
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import React, { FC, forwardRef, ReactNode } from "react";
|
||||
import { FC, forwardRef, ReactNode } from "react";
|
||||
import { DeepMap, FieldError, Path, RegisterOptions, UseFormRegister } from "react-hook-form";
|
||||
import { classNames, get } from "@utils";
|
||||
import { useToggle } from "@hooks/hooks";
|
||||
|
@ -194,4 +194,3 @@ export const PasswordInput = <TFormValues extends Record<string, unknown>>({
|
|||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import React, { FC, Fragment } from "react";
|
||||
import { FC, Fragment, MutableRefObject } from "react";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import { ExclamationTriangleIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
interface DeleteModalProps {
|
||||
isOpen: boolean;
|
||||
buttonRef: React.MutableRefObject<HTMLElement | null> | undefined;
|
||||
buttonRef: MutableRefObject<HTMLElement | null> | undefined;
|
||||
toggle: () => void;
|
||||
deleteAction: () => void;
|
||||
title: string;
|
||||
|
@ -94,4 +94,4 @@ export const DeleteModal: FC<DeleteModalProps> = ({ isOpen, buttonRef, toggle, d
|
|||
</div>
|
||||
</Dialog>
|
||||
</Transition.Root>
|
||||
);
|
||||
);
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import React, { Fragment, useRef } from "react";
|
||||
import { Fragment, useRef, ReactNode, ReactElement } from "react";
|
||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import { Form, Formik } from "formik";
|
||||
import type { FormikValues } from "formik";
|
||||
|
||||
import DEBUG from "../debug";
|
||||
import DEBUG from "@components/debug";
|
||||
import { useToggle } from "@hooks/hooks";
|
||||
import { DeleteModal } from "../modals";
|
||||
import { DeleteModal } from "@components/modals";
|
||||
import { classNames } from "@utils";
|
||||
|
||||
interface SlideOverProps<DataType> {
|
||||
|
@ -21,14 +21,14 @@ interface SlideOverProps<DataType> {
|
|||
onSubmit: (values?: DataType) => void;
|
||||
isOpen: boolean;
|
||||
toggle: () => void;
|
||||
children?: (values: DataType) => React.ReactNode;
|
||||
children?: (values: DataType) => ReactNode;
|
||||
deleteAction?: () => void;
|
||||
type: "CREATE" | "UPDATE";
|
||||
testFn?: (data: unknown) => void;
|
||||
isTesting?: boolean;
|
||||
isTestSuccessful?: boolean;
|
||||
isTestError?: boolean;
|
||||
extraButtons?: (values: DataType) => React.ReactNode;
|
||||
extraButtons?: (values: DataType) => ReactNode;
|
||||
}
|
||||
|
||||
function SlideOver<DataType>({
|
||||
|
@ -46,7 +46,7 @@ function SlideOver<DataType>({
|
|||
isTestSuccessful,
|
||||
isTestError,
|
||||
extraButtons
|
||||
}: SlideOverProps<DataType>): React.ReactElement {
|
||||
}: SlideOverProps<DataType>): ReactElement {
|
||||
const cancelModalButtonRef = useRef<HTMLInputElement | null>(null);
|
||||
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
||||
|
||||
|
@ -215,4 +215,4 @@ function SlideOver<DataType>({
|
|||
);
|
||||
}
|
||||
|
||||
export { SlideOver };
|
||||
export { SlideOver };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue