Fix type errors
This commit is contained in:
parent
b7590dea25
commit
f64e8537c2
6 changed files with 16 additions and 13 deletions
|
@ -48,11 +48,11 @@ export interface FilterActionsPropsSearch {
|
||||||
search: string;
|
search: string;
|
||||||
onSearchChange: (event: React.ChangeEvent<any>) => void;
|
onSearchChange: (event: React.ChangeEvent<any>) => void;
|
||||||
}
|
}
|
||||||
export interface FilterActionsPropsFilters {
|
export interface FilterActionsPropsFilters<TKeys = string> {
|
||||||
currencySymbol: string;
|
currencySymbol: string;
|
||||||
menu: IFilter;
|
menu: IFilter<TKeys>;
|
||||||
filterLabel: string;
|
filterLabel: string;
|
||||||
onFilterAdd: (filter: FilterContentSubmitData) => void;
|
onFilterAdd: (filter: FilterContentSubmitData<TKeys>) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FilterActionsOnlySearch: React.FC<
|
export const FilterActionsOnlySearch: React.FC<
|
||||||
|
|
|
@ -6,8 +6,8 @@ import Debounce from "../Debounce";
|
||||||
import { IFilter } from "../Filter/types";
|
import { IFilter } from "../Filter/types";
|
||||||
import FilterTabs, { FilterChips, FilterTab } from "../TableFilter";
|
import FilterTabs, { FilterChips, FilterTab } from "../TableFilter";
|
||||||
|
|
||||||
export interface FilterBarProps extends FilterProps {
|
export interface FilterBarProps<TKeys = string> extends FilterProps {
|
||||||
filterMenu: IFilter;
|
filterMenu: IFilter<TKeys>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FilterBar: React.FC<FilterBarProps> = ({
|
const FilterBar: React.FC<FilterBarProps> = ({
|
||||||
|
|
|
@ -9,7 +9,7 @@ import TimezoneContext from "@saleor/components/Timezone";
|
||||||
import { FilterProps } from "../../../types";
|
import { FilterProps } from "../../../types";
|
||||||
import { OrderStatusFilter } from "../../../types/globalTypes";
|
import { OrderStatusFilter } from "../../../types/globalTypes";
|
||||||
|
|
||||||
type OrderListFilterProps = FilterProps;
|
type OrderListFilterProps = FilterProps<OrderFilterKeys>;
|
||||||
|
|
||||||
export enum OrderFilterKeys {
|
export enum OrderFilterKeys {
|
||||||
date = "date",
|
date = "date",
|
||||||
|
|
|
@ -7,16 +7,15 @@ import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { OrderFilterKeys } from "@saleor/orders/components/OrderListFilter";
|
|
||||||
import { FilterPageProps, ListActions, PageListProps } from "@saleor/types";
|
import { FilterPageProps, ListActions, PageListProps } from "@saleor/types";
|
||||||
import { OrderList_orders_edges_node } from "../../types/OrderList";
|
import { OrderList_orders_edges_node } from "../../types/OrderList";
|
||||||
import OrderList from "../OrderList";
|
import OrderList from "../OrderList";
|
||||||
import OrderListFilter from "../OrderListFilter";
|
import OrderListFilter, { OrderFilterKeys } from "../OrderListFilter";
|
||||||
|
|
||||||
export interface OrderListPageProps
|
export interface OrderListPageProps
|
||||||
extends PageListProps,
|
extends PageListProps,
|
||||||
ListActions,
|
ListActions,
|
||||||
FilterPageProps {
|
FilterPageProps<OrderFilterKeys> {
|
||||||
orders: OrderList_orders_edges_node[];
|
orders: OrderList_orders_edges_node[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import ProductListFilter, { ProductFilterKeys } from "../ProductListFilter";
|
||||||
export interface ProductListPageProps
|
export interface ProductListPageProps
|
||||||
extends PageListProps<ProductListColumns>,
|
extends PageListProps<ProductListColumns>,
|
||||||
ListActions,
|
ListActions,
|
||||||
FilterPageProps,
|
FilterPageProps<ProductFilterKeys>,
|
||||||
FetchMoreProps {
|
FetchMoreProps {
|
||||||
availableInGridAttributes: AvailableInGridAttributes_availableInGrid_edges_node[];
|
availableInGridAttributes: AvailableInGridAttributes_availableInGrid_edges_node[];
|
||||||
currencySymbol: string;
|
currencySymbol: string;
|
||||||
|
|
10
src/types.ts
10
src/types.ts
|
@ -70,16 +70,20 @@ export interface SearchPageProps {
|
||||||
initialSearch: string;
|
initialSearch: string;
|
||||||
onSearchChange: (value: string) => void;
|
onSearchChange: (value: string) => void;
|
||||||
}
|
}
|
||||||
export interface FilterPageProps extends SearchPageProps, TabPageProps {
|
export interface FilterPageProps<TKeys = string>
|
||||||
|
extends SearchPageProps,
|
||||||
|
TabPageProps {
|
||||||
currencySymbol: string;
|
currencySymbol: string;
|
||||||
filtersList: Filter[];
|
filtersList: Filter[];
|
||||||
onFilterAdd: (filter: FilterContentSubmitData) => void;
|
onFilterAdd: (filter: FilterContentSubmitData<TKeys>) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SearchProps {
|
export interface SearchProps {
|
||||||
searchPlaceholder: string;
|
searchPlaceholder: string;
|
||||||
}
|
}
|
||||||
export interface FilterProps extends FilterPageProps, SearchProps {
|
export interface FilterProps<TKeys = string>
|
||||||
|
extends FilterPageProps<TKeys>,
|
||||||
|
SearchProps {
|
||||||
allTabLabel: string;
|
allTabLabel: string;
|
||||||
filterLabel: string;
|
filterLabel: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue