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