mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
refactor(web): rename custom components (#1581)
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
parent
7d7bf9ed4c
commit
e8e45c664d
17 changed files with 459 additions and 430 deletions
|
@ -13,7 +13,7 @@ interface ButtonProps {
|
|||
onClick?: () => void;
|
||||
}
|
||||
|
||||
export const Button = ({ children, className, disabled, onClick }: ButtonProps) => (
|
||||
export const TableButton = ({ children, className, disabled, onClick }: ButtonProps) => (
|
||||
<button
|
||||
type="button"
|
||||
className={classNames(
|
||||
|
@ -27,7 +27,7 @@ export const Button = ({ children, className, disabled, onClick }: ButtonProps)
|
|||
</button>
|
||||
);
|
||||
|
||||
export const PageButton = ({ children, className, disabled, onClick }: ButtonProps) => (
|
||||
export const TablePageButton = ({ children, className, disabled, onClick }: ButtonProps) => (
|
||||
<button
|
||||
type="button"
|
||||
className={classNames(
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
export { Button, PageButton } from "./Buttons";
|
||||
export { TableButton, TablePageButton } from "./Buttons";
|
||||
export { AgeCell, IndexerCell, NameCell, TitleCell, ReleaseStatusCell, LinksCell } from "./Cells";
|
||||
|
|
|
@ -13,10 +13,18 @@ import { useToggle } from "@hooks/hooks";
|
|||
import { EyeIcon, EyeSlashIcon } from "@heroicons/react/24/solid";
|
||||
|
||||
import { SelectFieldProps } from "./select";
|
||||
import * as common from "./common";
|
||||
|
||||
import { DocsTooltip } from "@components/tooltips/DocsTooltip";
|
||||
import { Checkbox } from "@components/Checkbox";
|
||||
import {
|
||||
DropdownIndicator,
|
||||
ErrorField, IndicatorSeparator,
|
||||
RequiredField,
|
||||
SelectControl,
|
||||
SelectInput,
|
||||
SelectMenu,
|
||||
SelectOption
|
||||
} from "@components/inputs/common.tsx";
|
||||
|
||||
interface TextFieldWideProps {
|
||||
name: string;
|
||||
|
@ -50,7 +58,7 @@ export const TextFieldWide = ({
|
|||
{tooltip ? (
|
||||
<DocsTooltip label={label}>{tooltip}</DocsTooltip>
|
||||
) : label}
|
||||
<common.RequiredField required={required} />
|
||||
<RequiredField required={required} />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -85,7 +93,7 @@ export const TextFieldWide = ({
|
|||
{help && (
|
||||
<p className="mt-2 text-sm text-gray-500" id={`${name}-description`}>{help}</p>
|
||||
)}
|
||||
<common.ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
<ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -125,7 +133,7 @@ export const PasswordFieldWide = ({
|
|||
{tooltip ? (
|
||||
<DocsTooltip label={label}>{tooltip}</DocsTooltip>
|
||||
) : label}
|
||||
<common.RequiredField required={required} />
|
||||
<RequiredField required={required} />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -163,7 +171,7 @@ export const PasswordFieldWide = ({
|
|||
{help && (
|
||||
<p className="mt-2 text-sm text-gray-500" id={`${name}-description`}>{help}</p>
|
||||
)}
|
||||
<common.ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
<ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -198,7 +206,7 @@ export const NumberFieldWide = ({
|
|||
{tooltip ? (
|
||||
<DocsTooltip label={label}>{tooltip}</DocsTooltip>
|
||||
) : label}
|
||||
<common.RequiredField required={required} />
|
||||
<RequiredField required={required} />
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -233,7 +241,7 @@ export const NumberFieldWide = ({
|
|||
{help && (
|
||||
<p className="mt-2 text-sm text-gray-500 dark:text-gray-500" id={`${name}-description`}>{help}</p>
|
||||
)}
|
||||
<common.ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
<ErrorField name={name} classNames="block text-red-500 mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -325,12 +333,12 @@ export const SelectFieldWide = ({
|
|||
isClearable={true}
|
||||
isSearchable={true}
|
||||
components={{
|
||||
Input: common.SelectInput,
|
||||
Control: common.SelectControl,
|
||||
Menu: common.SelectMenu,
|
||||
Option: common.SelectOption,
|
||||
IndicatorSeparator: common.IndicatorSeparator,
|
||||
DropdownIndicator: common.DropdownIndicator
|
||||
Input: SelectInput,
|
||||
Control: SelectControl,
|
||||
Menu: SelectMenu,
|
||||
Option: SelectOption,
|
||||
IndicatorSeparator: IndicatorSeparator,
|
||||
DropdownIndicator: DropdownIndicator
|
||||
}}
|
||||
placeholder={optionDefaultText}
|
||||
styles={{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue