mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 14:06:19 +00:00
Move shlink-frontend-kit tests to its own dir
This commit is contained in:
@@ -2,10 +2,10 @@ import type { ReactNode } from 'react';
|
||||
import type { CardProps } from 'reactstrap';
|
||||
import { Card, CardBody, CardHeader } from 'reactstrap';
|
||||
|
||||
interface SimpleCardProps extends Omit<CardProps, 'title'> {
|
||||
export type SimpleCardProps = Omit<CardProps, 'title'> & {
|
||||
title?: ReactNode;
|
||||
bodyClassName?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export const SimpleCard = ({ title, children, bodyClassName, ...rest }: SimpleCardProps) => (
|
||||
<Card {...rest}>
|
||||
|
||||
@@ -10,9 +10,9 @@ export type BooleanControlProps = PropsWithChildren<{
|
||||
inline?: boolean;
|
||||
}>;
|
||||
|
||||
interface BooleanControlWithTypeProps extends BooleanControlProps {
|
||||
type BooleanControlWithTypeProps = BooleanControlProps & {
|
||||
type: 'switch' | 'checkbox';
|
||||
}
|
||||
};
|
||||
|
||||
export const BooleanControl: FC<BooleanControlWithTypeProps> = (
|
||||
{ checked = false, onChange = identity, className, children, type, inline = false },
|
||||
|
||||
@@ -7,13 +7,13 @@ import './SearchField.scss';
|
||||
const DEFAULT_SEARCH_INTERVAL = 500;
|
||||
let timer: NodeJS.Timeout | null;
|
||||
|
||||
interface SearchFieldProps {
|
||||
type SearchFieldProps = {
|
||||
onChange: (value: string) => void;
|
||||
className?: string;
|
||||
large?: boolean;
|
||||
noBorder?: boolean;
|
||||
initialValue?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export const SearchField = ({ onChange, className, large = true, noBorder = false, initialValue = '' }: SearchFieldProps) => {
|
||||
const [searchTerm, setSearchTerm] = useState(initialValue);
|
||||
|
||||
@@ -7,14 +7,14 @@ import type { Order, OrderDir } from './ordering';
|
||||
import { determineOrderDir } from './ordering';
|
||||
import './OrderingDropdown.scss';
|
||||
|
||||
export interface OrderingDropdownProps<T extends string = string> {
|
||||
export type OrderingDropdownProps<T extends string = string> = {
|
||||
items: Record<T, string>;
|
||||
order: Order<T>;
|
||||
onChange: (orderField?: T, orderDir?: OrderDir) => void;
|
||||
isButton?: boolean;
|
||||
right?: boolean;
|
||||
prefixed?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export function OrderingDropdown<T extends string = string>(
|
||||
{ items, order, onChange, isButton = true, right = false, prefixed = true }: OrderingDropdownProps<T>,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export type OrderDir = 'ASC' | 'DESC' | undefined;
|
||||
|
||||
export interface Order<Fields> {
|
||||
export type Order<Fields> = {
|
||||
field?: Fields;
|
||||
dir?: OrderDir;
|
||||
}
|
||||
};
|
||||
|
||||
export const determineOrderDir = <T extends string = string>(
|
||||
currentField: T,
|
||||
|
||||
Reference in New Issue
Block a user