Use FC instead of deprecated StatelessComponent
This commit is contained in:
parent
11e6743ad7
commit
33e956ea57
153 changed files with 300 additions and 410 deletions
|
@ -3,7 +3,7 @@ import React from "react";
|
|||
import NotFoundPage from "./components/NotFoundPage";
|
||||
import useNavigator from "./hooks/useNavigator";
|
||||
|
||||
export const NotFound: React.StatelessComponent = () => {
|
||||
export const NotFound: React.FC = () => {
|
||||
const navigate = useNavigator();
|
||||
|
||||
return <NotFoundPage onBack={() => navigate("/")} />;
|
||||
|
|
|
@ -13,9 +13,13 @@ export interface AttributeBulkDeleteDialogProps {
|
|||
onClose: () => void;
|
||||
}
|
||||
|
||||
const AttributeBulkDeleteDialog: React.StatelessComponent<
|
||||
AttributeBulkDeleteDialogProps
|
||||
> = ({ confirmButtonState, quantity, onClose, onConfirm, open }) => {
|
||||
const AttributeBulkDeleteDialog: React.FC<AttributeBulkDeleteDialogProps> = ({
|
||||
confirmButtonState,
|
||||
quantity,
|
||||
onClose,
|
||||
onConfirm,
|
||||
open
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -59,7 +59,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||
|
||||
const numberOfColumns = 6;
|
||||
|
||||
const AttributeList: React.StatelessComponent<AttributeListProps> = ({
|
||||
const AttributeList: React.FC<AttributeListProps> = ({
|
||||
attributes,
|
||||
disabled,
|
||||
isChecked,
|
||||
|
|
|
@ -30,9 +30,7 @@ export interface AttributeValueEditDialogProps {
|
|||
onClose: () => void;
|
||||
}
|
||||
|
||||
const AttributeValueEditDialog: React.StatelessComponent<
|
||||
AttributeValueEditDialogProps
|
||||
> = ({
|
||||
const AttributeValueEditDialog: React.FC<AttributeValueEditDialogProps> = ({
|
||||
attributeValue,
|
||||
confirmButtonState,
|
||||
disabled,
|
||||
|
|
|
@ -22,9 +22,9 @@ interface AuthProviderOperationsProps {
|
|||
user: User;
|
||||
}) => React.ReactNode;
|
||||
}
|
||||
const AuthProviderOperations: React.StatelessComponent<
|
||||
AuthProviderOperationsProps
|
||||
> = ({ children }) => {
|
||||
const AuthProviderOperations: React.FC<AuthProviderOperationsProps> = ({
|
||||
children
|
||||
}) => {
|
||||
return (
|
||||
<TypedTokenAuthMutation>
|
||||
{(...tokenAuth) => (
|
||||
|
|
|
@ -14,7 +14,7 @@ interface SectionRouteProps extends RouteProps {
|
|||
permissions?: PermissionEnum[];
|
||||
}
|
||||
|
||||
export const SectionRoute: React.StatelessComponent<SectionRouteProps> = ({
|
||||
export const SectionRoute: React.FC<SectionRouteProps> = ({
|
||||
permissions,
|
||||
...props
|
||||
}) => {
|
||||
|
|
|
@ -36,9 +36,7 @@ export interface CategoryCreatePageProps {
|
|||
onBack();
|
||||
}
|
||||
|
||||
export const CategoryCreatePage: React.StatelessComponent<
|
||||
CategoryCreatePageProps
|
||||
> = ({
|
||||
export const CategoryCreatePage: React.FC<CategoryCreatePageProps> = ({
|
||||
disabled,
|
||||
onSubmit,
|
||||
onBack,
|
||||
|
|
|
@ -24,7 +24,7 @@ export interface CategoryTableProps
|
|||
categories: CategoryFragment[];
|
||||
}
|
||||
|
||||
export const CategoryListPage: React.StatelessComponent<CategoryTableProps> = ({
|
||||
export const CategoryListPage: React.FC<CategoryTableProps> = ({
|
||||
categories,
|
||||
currentTab,
|
||||
disabled,
|
||||
|
|
|
@ -13,9 +13,7 @@ interface CategoryProductsProps extends PageListProps, ListActions {
|
|||
categoryName: string;
|
||||
}
|
||||
|
||||
export const CategoryProducts: React.StatelessComponent<
|
||||
CategoryProductsProps
|
||||
> = ({
|
||||
export const CategoryProducts: React.FC<CategoryProductsProps> = ({
|
||||
products,
|
||||
disabled,
|
||||
pageInfo,
|
||||
|
|
|
@ -70,9 +70,7 @@ export interface CategoryUpdatePageProps
|
|||
const CategoriesTab = Tab(CategoryPageTab.categories);
|
||||
const ProductsTab = Tab(CategoryPageTab.products);
|
||||
|
||||
export const CategoryUpdatePage: React.StatelessComponent<
|
||||
CategoryUpdatePageProps
|
||||
> = ({
|
||||
export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||
changeTab,
|
||||
currentTab,
|
||||
category,
|
||||
|
|
|
@ -19,7 +19,7 @@ import CategoryListComponent from "./views/CategoryList";
|
|||
interface CategoryDetailsRouteParams {
|
||||
id: string;
|
||||
}
|
||||
const CategoryDetails: React.StatelessComponent<
|
||||
const CategoryDetails: React.FC<
|
||||
RouteComponentProps<CategoryDetailsRouteParams>
|
||||
> = ({ location, match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
|
@ -38,7 +38,7 @@ const CategoryDetails: React.StatelessComponent<
|
|||
interface CategoryCreateRouteParams {
|
||||
id: string;
|
||||
}
|
||||
const CategoryCreate: React.StatelessComponent<
|
||||
const CategoryCreate: React.FC<
|
||||
RouteComponentProps<CategoryCreateRouteParams>
|
||||
> = ({ match }) => {
|
||||
return (
|
||||
|
@ -50,9 +50,7 @@ const CategoryCreate: React.StatelessComponent<
|
|||
);
|
||||
};
|
||||
|
||||
const CategoryList: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const CategoryList: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: CategoryListUrlQueryParams = qs;
|
||||
return <CategoryListComponent params={params} />;
|
||||
|
|
|
@ -14,9 +14,9 @@ interface CategoryCreateViewProps {
|
|||
parentId: string;
|
||||
}
|
||||
|
||||
export const CategoryCreateView: React.StatelessComponent<
|
||||
CategoryCreateViewProps
|
||||
> = ({ parentId }) => {
|
||||
export const CategoryCreateView: React.FC<CategoryCreateViewProps> = ({
|
||||
parentId
|
||||
}) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -51,9 +51,10 @@ export function getActiveTab(tabName: string): CategoryPageTab {
|
|||
: CategoryPageTab.categories;
|
||||
}
|
||||
|
||||
export const CategoryDetails: React.StatelessComponent<
|
||||
CategoryDetailsProps
|
||||
> = ({ id, params }) => {
|
||||
export const CategoryDetails: React.FC<CategoryDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -42,9 +42,7 @@ interface CategoryListProps {
|
|||
params: CategoryListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const CategoryList: React.StatelessComponent<CategoryListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const CategoryList: React.FC<CategoryListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const paginate = usePaginator();
|
||||
const { isSelected, listElements, toggle, toggleAll, reset } = useBulkActions(
|
||||
|
|
|
@ -57,9 +57,7 @@ const initialForm: CollectionCreatePageFormData = {
|
|||
seoTitle: ""
|
||||
};
|
||||
|
||||
const CollectionCreatePage: React.StatelessComponent<
|
||||
CollectionCreatePageProps
|
||||
> = ({
|
||||
const CollectionCreatePage: React.FC<CollectionCreatePageProps> = ({
|
||||
disabled,
|
||||
errors,
|
||||
saveButtonBarState,
|
||||
|
|
|
@ -47,9 +47,7 @@ export interface CollectionDetailsPageProps extends PageListProps, ListActions {
|
|||
onSubmit: (data: CollectionDetailsPageFormData) => void;
|
||||
}
|
||||
|
||||
const CollectionDetailsPage: React.StatelessComponent<
|
||||
CollectionDetailsPageProps
|
||||
> = ({
|
||||
const CollectionDetailsPage: React.FC<CollectionDetailsPageProps> = ({
|
||||
collection,
|
||||
disabled,
|
||||
isFeatured,
|
||||
|
|
|
@ -24,7 +24,7 @@ export interface CollectionListPageProps
|
|||
collections: CollectionList_collections_edges_node[];
|
||||
}
|
||||
|
||||
const CollectionListPage: React.StatelessComponent<CollectionListPageProps> = ({
|
||||
const CollectionListPage: React.FC<CollectionListPageProps> = ({
|
||||
currentTab,
|
||||
disabled,
|
||||
initialSearch,
|
||||
|
|
|
@ -59,9 +59,13 @@ interface CollectionUpdateOperationsProps {
|
|||
onRemove: (data: RemoveCollection) => void;
|
||||
}
|
||||
|
||||
const CollectionOperations: React.StatelessComponent<
|
||||
CollectionUpdateOperationsProps
|
||||
> = ({ children, onUpdate, onProductAssign, onProductUnassign, onRemove }) => (
|
||||
const CollectionOperations: React.FC<CollectionUpdateOperationsProps> = ({
|
||||
children,
|
||||
onUpdate,
|
||||
onProductAssign,
|
||||
onProductUnassign,
|
||||
onRemove
|
||||
}) => (
|
||||
<TypedCollectionUpdateMutation onCompleted={onUpdate}>
|
||||
{(...updateCollection) => (
|
||||
<TypedCollectionRemoveMutation onCompleted={onRemove}>
|
||||
|
|
|
@ -16,9 +16,7 @@ import CollectionCreate from "./views/CollectionCreate";
|
|||
import CollectionDetailsView from "./views/CollectionDetails";
|
||||
import CollectionListView from "./views/CollectionList";
|
||||
|
||||
const CollectionList: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const CollectionList: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: CollectionListUrlQueryParams = qs;
|
||||
return <CollectionListView params={params} />;
|
||||
|
@ -27,7 +25,7 @@ const CollectionList: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
|||
interface CollectionDetailsRouteProps {
|
||||
id: string;
|
||||
}
|
||||
const CollectionDetails: React.StatelessComponent<
|
||||
const CollectionDetails: React.FC<
|
||||
RouteComponentProps<CollectionDetailsRouteProps>
|
||||
> = ({ location, match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
|
|
|
@ -39,9 +39,10 @@ interface CollectionDetailsProps {
|
|||
params: CollectionUrlQueryParams;
|
||||
}
|
||||
|
||||
export const CollectionDetails: React.StatelessComponent<
|
||||
CollectionDetailsProps
|
||||
> = ({ id, params }) => {
|
||||
export const CollectionDetails: React.FC<CollectionDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions(
|
||||
|
|
|
@ -49,9 +49,7 @@ interface CollectionListProps {
|
|||
params: CollectionListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const CollectionList: React.FC<CollectionListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -16,7 +16,7 @@ interface StaffStatusProps {
|
|||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const StaffStatus: React.StatelessComponent<StaffStatusProps> = ({
|
||||
const StaffStatus: React.FC<StaffStatusProps> = ({
|
||||
data,
|
||||
disabled,
|
||||
label,
|
||||
|
|
|
@ -8,9 +8,7 @@ interface AddressFormatterProps {
|
|||
address?: AddressType;
|
||||
}
|
||||
|
||||
const AddressFormatter: React.StatelessComponent<AddressFormatterProps> = ({
|
||||
address
|
||||
}) => {
|
||||
const AddressFormatter: React.FC<AddressFormatterProps> = ({ address }) => {
|
||||
if (!address) {
|
||||
return <Skeleton />;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,7 @@ export const AppProgressContext = React.createContext<IAppProgressContext>(
|
|||
undefined
|
||||
);
|
||||
|
||||
export const AppProgressProvider: React.StatelessComponent<{}> = ({
|
||||
children
|
||||
}) => {
|
||||
export const AppProgressProvider: React.FC<{}> = ({ children }) => {
|
||||
const [isProgress, setProgressState] = React.useState(false);
|
||||
|
||||
return (
|
||||
|
|
|
@ -11,9 +11,13 @@ interface ControlledCheckboxProps {
|
|||
onChange(event: any);
|
||||
}
|
||||
|
||||
export const ControlledCheckbox: React.StatelessComponent<
|
||||
ControlledCheckboxProps
|
||||
> = ({ checked, disabled, name, label, onChange }) => (
|
||||
export const ControlledCheckbox: React.FC<ControlledCheckboxProps> = ({
|
||||
checked,
|
||||
disabled,
|
||||
name,
|
||||
label,
|
||||
onChange
|
||||
}) => (
|
||||
<FormControlLabel
|
||||
disabled={disabled}
|
||||
control={
|
||||
|
|
|
@ -12,10 +12,7 @@ interface DateTimeProps {
|
|||
plain?: boolean;
|
||||
}
|
||||
|
||||
export const DateTime: React.StatelessComponent<DateTimeProps> = ({
|
||||
date,
|
||||
plain
|
||||
}) => {
|
||||
export const DateTime: React.FC<DateTimeProps> = ({ date, plain }) => {
|
||||
const getTitle = (value: string, locale?: string, tz?: string) => {
|
||||
let date = moment(value).locale(locale);
|
||||
if (tz !== undefined) {
|
||||
|
|
|
@ -3,14 +3,12 @@ import Debounce from "./Debounce";
|
|||
|
||||
export interface DebounceFormProps {
|
||||
change: (event: React.ChangeEvent<any>, cb?: () => void) => void;
|
||||
children: ((
|
||||
props: (event: React.ChangeEvent<any>) => void
|
||||
) => React.ReactNode);
|
||||
children: (props: (event: React.ChangeEvent<any>) => void) => React.ReactNode;
|
||||
submit: (event: React.FormEvent<any>) => void;
|
||||
time?: number;
|
||||
}
|
||||
|
||||
export const DebounceForm: React.StatelessComponent<DebounceFormProps> = ({
|
||||
export const DebounceForm: React.FC<DebounceFormProps> = ({
|
||||
change,
|
||||
children,
|
||||
submit,
|
||||
|
|
|
@ -7,9 +7,7 @@ interface ErrorMessageCardProps {
|
|||
message: string;
|
||||
}
|
||||
|
||||
const ErrorMessageCard: React.StatelessComponent<ErrorMessageCardProps> = ({
|
||||
message
|
||||
}) => (
|
||||
const ErrorMessageCard: React.FC<ErrorMessageCardProps> = ({ message }) => (
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h5" component="h2">
|
||||
|
|
|
@ -10,10 +10,7 @@ export interface FilterCardProps {
|
|||
handleClear();
|
||||
}
|
||||
|
||||
const FilterCard: React.StatelessComponent<FilterCardProps> = ({
|
||||
children,
|
||||
handleClear
|
||||
}) => {
|
||||
const FilterCard: React.FC<FilterCardProps> = ({ children, handleClear }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -10,7 +10,7 @@ export interface MoneyProps {
|
|||
money: IMoney;
|
||||
}
|
||||
|
||||
export const Money: React.StatelessComponent<MoneyProps> = ({ money }) => (
|
||||
export const Money: React.FC<MoneyProps> = ({ money }) => (
|
||||
<LocaleConsumer>
|
||||
{({ locale }) => {
|
||||
return money.amount.toLocaleString(locale, {
|
||||
|
|
|
@ -15,10 +15,7 @@ const formatMoney = (money: IMoney, locale: string) =>
|
|||
style: "currency"
|
||||
});
|
||||
|
||||
export const MoneyRange: React.StatelessComponent<MoneyRangeProps> = ({
|
||||
from,
|
||||
to
|
||||
}) => {
|
||||
export const MoneyRange: React.FC<MoneyRangeProps> = ({ from, to }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -6,7 +6,7 @@ interface PercentProps {
|
|||
amount: number;
|
||||
}
|
||||
|
||||
const Percent: React.StatelessComponent<PercentProps> = ({ amount }) => (
|
||||
const Percent: React.FC<PercentProps> = ({ amount }) => (
|
||||
<LocaleConsumer>
|
||||
{({ locale }) => {
|
||||
return (amount / 100).toLocaleString(locale, {
|
||||
|
|
|
@ -9,7 +9,7 @@ export interface WeightProps {
|
|||
weight: Weight;
|
||||
}
|
||||
|
||||
const Weight: React.StatelessComponent<WeightProps> = ({ weight }) => (
|
||||
const Weight: React.FC<WeightProps> = ({ weight }) => (
|
||||
<FormattedMessage
|
||||
defaultMessage="{value} {unit}"
|
||||
description="weight"
|
||||
|
|
|
@ -7,9 +7,7 @@ interface WindowTitleProps {
|
|||
title: string;
|
||||
}
|
||||
|
||||
export const WindowTitle: React.StatelessComponent<WindowTitleProps> = ({
|
||||
title
|
||||
}) => {
|
||||
export const WindowTitle: React.FC<WindowTitleProps> = ({ title }) => {
|
||||
const shop = useShop();
|
||||
|
||||
return shop === undefined || !title ? null : (
|
||||
|
|
|
@ -19,7 +19,7 @@ export interface CustomerCreateNoteProps {
|
|||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const CustomerCreateNote: React.StatelessComponent<CustomerCreateNoteProps> = ({
|
||||
const CustomerCreateNote: React.FC<CustomerCreateNoteProps> = ({
|
||||
data,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -52,7 +52,7 @@ export interface CustomerCreatePageProps {
|
|||
onSubmit: (data: CustomerCreatePageFormData) => void;
|
||||
}
|
||||
|
||||
const CustomerCreatePage: React.StatelessComponent<CustomerCreatePageProps> = ({
|
||||
const CustomerCreatePage: React.FC<CustomerCreatePageProps> = ({
|
||||
countries,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -39,9 +39,7 @@ export interface CustomerDetailsPageProps {
|
|||
onDelete: () => void;
|
||||
}
|
||||
|
||||
const CustomerDetailsPage: React.StatelessComponent<
|
||||
CustomerDetailsPageProps
|
||||
> = ({
|
||||
const CustomerDetailsPage: React.FC<CustomerDetailsPageProps> = ({
|
||||
customer,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -24,7 +24,7 @@ export interface CustomerListPageProps
|
|||
customers: ListCustomers_customers_edges_node[];
|
||||
}
|
||||
|
||||
const CustomerListPage: React.StatelessComponent<CustomerListPageProps> = ({
|
||||
const CustomerListPage: React.FC<CustomerListPageProps> = ({
|
||||
currentTab,
|
||||
customers,
|
||||
disabled,
|
||||
|
|
|
@ -19,9 +19,7 @@ import CustomerCreateView from "./views/CustomerCreate";
|
|||
import CustomerDetailsViewComponent from "./views/CustomerDetails";
|
||||
import CustomerListViewComponent from "./views/CustomerList";
|
||||
|
||||
const CustomerListView: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const CustomerListView: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: CustomerListUrlQueryParams = qs;
|
||||
return <CustomerListViewComponent params={params} />;
|
||||
|
@ -30,7 +28,7 @@ const CustomerListView: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
|||
interface CustomerDetailsRouteParams {
|
||||
id: string;
|
||||
}
|
||||
const CustomerDetailsView: React.StatelessComponent<
|
||||
const CustomerDetailsView: React.FC<
|
||||
RouteComponentProps<CustomerDetailsRouteParams>
|
||||
> = ({ location, match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
|
@ -47,7 +45,7 @@ const CustomerDetailsView: React.StatelessComponent<
|
|||
interface CustomerAddressesRouteParams {
|
||||
id: string;
|
||||
}
|
||||
const CustomerAddressesView: React.StatelessComponent<
|
||||
const CustomerAddressesView: React.FC<
|
||||
RouteComponentProps<CustomerAddressesRouteParams>
|
||||
> = ({ match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
|
@ -61,7 +59,7 @@ const CustomerAddressesView: React.StatelessComponent<
|
|||
);
|
||||
};
|
||||
|
||||
export const CustomerSection: React.StatelessComponent<{}> = () => {
|
||||
export const CustomerSection: React.FC<{}> = () => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -11,7 +11,7 @@ import { TypedCustomerCreateDataQuery } from "../queries";
|
|||
import { CreateCustomer } from "../types/CreateCustomer";
|
||||
import { customerListUrl, customerUrl } from "../urls";
|
||||
|
||||
export const CustomerCreate: React.StatelessComponent<{}> = () => {
|
||||
export const CustomerCreate: React.FC<{}> = () => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -29,9 +29,10 @@ interface CustomerDetailsViewProps {
|
|||
params: CustomerUrlQueryParams;
|
||||
}
|
||||
|
||||
export const CustomerDetailsView: React.StatelessComponent<
|
||||
CustomerDetailsViewProps
|
||||
> = ({ id, params }) => {
|
||||
export const CustomerDetailsView: React.FC<CustomerDetailsViewProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -44,9 +44,7 @@ interface CustomerListProps {
|
|||
params: CustomerListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const CustomerList: React.StatelessComponent<CustomerListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const CustomerList: React.FC<CustomerListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -36,7 +36,7 @@ export interface SaleCreatePageProps {
|
|||
onSubmit: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const SaleCreatePage: React.StatelessComponent<SaleCreatePageProps> = ({
|
||||
const SaleCreatePage: React.FC<SaleCreatePageProps> = ({
|
||||
defaultCurrency,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -77,7 +77,7 @@ const CategoriesTab = Tab(SaleDetailsPageTab.categories);
|
|||
const CollectionsTab = Tab(SaleDetailsPageTab.collections);
|
||||
const ProductsTab = Tab(SaleDetailsPageTab.products);
|
||||
|
||||
const SaleDetailsPage: React.StatelessComponent<SaleDetailsPageProps> = ({
|
||||
const SaleDetailsPage: React.FC<SaleDetailsPageProps> = ({
|
||||
activeTab,
|
||||
defaultCurrency,
|
||||
disabled,
|
||||
|
|
|
@ -25,7 +25,7 @@ export interface SaleListPageProps
|
|||
sales: SaleList_sales_edges_node[];
|
||||
}
|
||||
|
||||
const SaleListPage: React.StatelessComponent<SaleListPageProps> = ({
|
||||
const SaleListPage: React.FC<SaleListPageProps> = ({
|
||||
currentTab,
|
||||
initialSearch,
|
||||
onAdd,
|
||||
|
|
|
@ -22,10 +22,7 @@ export interface SaleSummaryProps {
|
|||
sale: SaleDetails_sale;
|
||||
}
|
||||
|
||||
const SaleSummary: React.StatelessComponent<SaleSummaryProps> = ({
|
||||
defaultCurrency,
|
||||
sale
|
||||
}) => {
|
||||
const SaleSummary: React.FC<SaleSummaryProps> = ({ defaultCurrency, sale }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -51,7 +51,7 @@ export interface VoucherCreatePageProps {
|
|||
onSubmit: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const VoucherCreatePage: React.StatelessComponent<VoucherCreatePageProps> = ({
|
||||
const VoucherCreatePage: React.FC<VoucherCreatePageProps> = ({
|
||||
defaultCurrency,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -96,7 +96,7 @@ const CategoriesTab = Tab(VoucherDetailsPageTab.categories);
|
|||
const CollectionsTab = Tab(VoucherDetailsPageTab.collections);
|
||||
const ProductsTab = Tab(VoucherDetailsPageTab.products);
|
||||
|
||||
const VoucherDetailsPage: React.StatelessComponent<VoucherDetailsPageProps> = ({
|
||||
const VoucherDetailsPage: React.FC<VoucherDetailsPageProps> = ({
|
||||
activeTab,
|
||||
defaultCurrency,
|
||||
disabled,
|
||||
|
|
|
@ -25,7 +25,7 @@ export interface VoucherListPageProps
|
|||
vouchers: VoucherList_vouchers_edges_node[];
|
||||
}
|
||||
|
||||
const VoucherListPage: React.StatelessComponent<VoucherListPageProps> = ({
|
||||
const VoucherListPage: React.FC<VoucherListPageProps> = ({
|
||||
currentTab,
|
||||
initialSearch,
|
||||
onAdd,
|
||||
|
|
|
@ -23,7 +23,7 @@ export interface VoucherSummaryProps {
|
|||
voucher: VoucherDetails_voucher;
|
||||
}
|
||||
|
||||
const VoucherSummary: React.StatelessComponent<VoucherSummaryProps> = ({
|
||||
const VoucherSummary: React.FC<VoucherSummaryProps> = ({
|
||||
defaultCurrency,
|
||||
voucher
|
||||
}) => {
|
||||
|
|
|
@ -26,17 +26,16 @@ import VoucherCreateView from "./views/VoucherCreate";
|
|||
import VoucherDetailsViewComponent from "./views/VoucherDetails";
|
||||
import VoucherListViewComponent from "./views/VoucherList";
|
||||
|
||||
const SaleListView: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const SaleListView: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: SaleListUrlQueryParams = qs;
|
||||
return <SaleListViewComponent params={params} />;
|
||||
};
|
||||
|
||||
const SaleDetailsView: React.StatelessComponent<
|
||||
RouteComponentProps<{ id: string }>
|
||||
> = ({ match, location }) => {
|
||||
const SaleDetailsView: React.FC<RouteComponentProps<{ id: string }>> = ({
|
||||
match,
|
||||
location
|
||||
}) => {
|
||||
const { activeTab, ...qs } = parseQs(location.search.substr(1));
|
||||
const params: SaleUrlQueryParams = {
|
||||
...qs,
|
||||
|
@ -50,17 +49,16 @@ const SaleDetailsView: React.StatelessComponent<
|
|||
);
|
||||
};
|
||||
|
||||
const VoucherListView: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const VoucherListView: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: VoucherListUrlQueryParams = qs;
|
||||
return <VoucherListViewComponent params={params} />;
|
||||
};
|
||||
|
||||
const VoucherDetailsView: React.StatelessComponent<
|
||||
RouteComponentProps<{ id: string }>
|
||||
> = ({ match, location }) => {
|
||||
const VoucherDetailsView: React.FC<RouteComponentProps<{ id: string }>> = ({
|
||||
match,
|
||||
location
|
||||
}) => {
|
||||
const { activeTab, ...qs } = parseQs(location.search.substr(1));
|
||||
const params: VoucherUrlQueryParams = {
|
||||
...qs,
|
||||
|
@ -74,7 +72,7 @@ const VoucherDetailsView: React.StatelessComponent<
|
|||
);
|
||||
};
|
||||
|
||||
export const DiscountSection: React.StatelessComponent<{}> = () => {
|
||||
export const DiscountSection: React.FC<{}> = () => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -19,7 +19,7 @@ function discountValueTypeEnum(type: SaleType): DiscountValueTypeEnum {
|
|||
: DiscountValueTypeEnum.PERCENTAGE;
|
||||
}
|
||||
|
||||
export const SaleDetails: React.StatelessComponent = () => {
|
||||
export const SaleDetails: React.FC = () => {
|
||||
const navigate = useNavigator();
|
||||
const pushMessage = useNotifier();
|
||||
const shop = useShop();
|
||||
|
|
|
@ -57,10 +57,7 @@ function discountValueTypeEnum(type: SaleType): DiscountValueTypeEnum {
|
|||
: DiscountValueTypeEnum.PERCENTAGE;
|
||||
}
|
||||
|
||||
export const SaleDetails: React.StatelessComponent<SaleDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
export const SaleDetails: React.FC<SaleDetailsProps> = ({ id, params }) => {
|
||||
const navigate = useNavigator();
|
||||
const paginate = usePaginator();
|
||||
const notify = useNotifier();
|
||||
|
|
|
@ -46,9 +46,7 @@ interface SaleListProps {
|
|||
params: SaleListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const SaleList: React.StatelessComponent<SaleListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const SaleList: React.FC<SaleListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -17,7 +17,7 @@ import { RequirementsPicker } from "../types";
|
|||
import { VoucherCreate } from "../types/VoucherCreate";
|
||||
import { voucherListUrl, voucherUrl } from "../urls";
|
||||
|
||||
export const VoucherDetails: React.StatelessComponent = () => {
|
||||
export const VoucherDetails: React.FC = () => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const shop = useShop();
|
||||
|
|
|
@ -56,7 +56,7 @@ interface VoucherDetailsProps {
|
|||
params: VoucherUrlQueryParams;
|
||||
}
|
||||
|
||||
export const VoucherDetails: React.StatelessComponent<VoucherDetailsProps> = ({
|
||||
export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
|
|
|
@ -46,9 +46,7 @@ interface VoucherListProps {
|
|||
params: VoucherListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const VoucherList: React.StatelessComponent<VoucherListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const VoucherList: React.FC<VoucherListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -14,9 +14,7 @@ interface HomeScreenProps {
|
|||
};
|
||||
}
|
||||
|
||||
export const HomeScreen: React.StatelessComponent<HomeScreenProps> = ({
|
||||
user
|
||||
}) => {
|
||||
export const HomeScreen: React.FC<HomeScreenProps> = ({ user }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -37,7 +37,7 @@ export interface MenuDetailsPageProps {
|
|||
onSubmit: (data: MenuDetailsSubmitData) => Promise<boolean>;
|
||||
}
|
||||
|
||||
const MenuDetailsPage: React.StatelessComponent<MenuDetailsPageProps> = ({
|
||||
const MenuDetailsPage: React.FC<MenuDetailsPageProps> = ({
|
||||
disabled,
|
||||
menu,
|
||||
saveButtonState,
|
||||
|
|
|
@ -73,7 +73,7 @@ function getDisplayValue(menu: IMenu, value: string): string {
|
|||
return getMenuItemByValue(menu, value).label.toString();
|
||||
}
|
||||
|
||||
const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
||||
const MenuItemDialog: React.FC<MenuItemDialogProps> = ({
|
||||
confirmButtonState,
|
||||
disabled,
|
||||
errors: apiErrors,
|
||||
|
|
|
@ -17,7 +17,7 @@ export interface MenuListPageProps extends PageListProps, ListActions {
|
|||
onDelete: (id: string) => void;
|
||||
}
|
||||
|
||||
const MenuListPage: React.StatelessComponent<MenuListPageProps> = ({
|
||||
const MenuListPage: React.FC<MenuListPageProps> = ({
|
||||
disabled,
|
||||
onAdd,
|
||||
onBack,
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface MenuPropertiesProps {
|
|||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const MenuProperties: React.StatelessComponent<MenuPropertiesProps> = ({
|
||||
const MenuProperties: React.FC<MenuPropertiesProps> = ({
|
||||
data,
|
||||
disabled,
|
||||
onChange
|
||||
|
|
|
@ -14,9 +14,13 @@ export interface OrderBulkCancelDialogProps {
|
|||
onConfirm: (restock: boolean) => void;
|
||||
}
|
||||
|
||||
const OrderBulkCancelDialog: React.StatelessComponent<
|
||||
OrderBulkCancelDialogProps
|
||||
> = ({ confirmButtonState, numberOfOrders, open, onClose, onConfirm }) => {
|
||||
const OrderBulkCancelDialog: React.FC<OrderBulkCancelDialogProps> = ({
|
||||
confirmButtonState,
|
||||
numberOfOrders,
|
||||
open,
|
||||
onClose,
|
||||
onConfirm
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const [restock, setRestock] = React.useState(true);
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ interface OrderCustomerNoteProps {
|
|||
note: string;
|
||||
}
|
||||
|
||||
export const OrderCustomerNote: React.StatelessComponent<
|
||||
OrderCustomerNoteProps
|
||||
> = ({ note }) => {
|
||||
export const OrderCustomerNote: React.FC<OrderCustomerNoteProps> = ({
|
||||
note
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -13,9 +13,13 @@ export interface OrderDraftCancelDialogProps {
|
|||
orderNumber: string;
|
||||
}
|
||||
|
||||
const OrderDraftCancelDialog: React.StatelessComponent<
|
||||
OrderDraftCancelDialogProps
|
||||
> = ({ confirmButtonState, onClose, onConfirm, open, orderNumber }) => {
|
||||
const OrderDraftCancelDialog: React.FC<OrderDraftCancelDialogProps> = ({
|
||||
confirmButtonState,
|
||||
onClose,
|
||||
onConfirm,
|
||||
open,
|
||||
orderNumber
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -23,7 +23,7 @@ interface OrderDraftDetailsProps {
|
|||
onShippingMethodEdit: () => void;
|
||||
}
|
||||
|
||||
const OrderDraftDetails: React.StatelessComponent<OrderDraftDetailsProps> = ({
|
||||
const OrderDraftDetails: React.FC<OrderDraftDetailsProps> = ({
|
||||
order,
|
||||
onOrderLineAdd,
|
||||
onOrderLineChange,
|
||||
|
|
|
@ -46,9 +46,7 @@ function translateWarnings(
|
|||
};
|
||||
}
|
||||
|
||||
const OrderDraftFinalizeDialog: React.StatelessComponent<
|
||||
OrderDraftFinalizeDialogProps
|
||||
> = ({
|
||||
const OrderDraftFinalizeDialog: React.FC<OrderDraftFinalizeDialogProps> = ({
|
||||
confirmButtonState,
|
||||
open,
|
||||
warnings,
|
||||
|
|
|
@ -25,7 +25,7 @@ export interface OrderDraftListPageProps
|
|||
orders: OrderDraftList_draftOrders_edges_node[];
|
||||
}
|
||||
|
||||
const OrderDraftListPage: React.StatelessComponent<OrderDraftListPageProps> = ({
|
||||
const OrderDraftListPage: React.FC<OrderDraftListPageProps> = ({
|
||||
currentTab,
|
||||
disabled,
|
||||
initialSearch,
|
||||
|
|
|
@ -25,7 +25,7 @@ interface OrderFulfillmentTrackingDialogProps {
|
|||
onConfirm(data: FormData);
|
||||
}
|
||||
|
||||
const OrderFulfillmentTrackingDialog: React.StatelessComponent<
|
||||
const OrderFulfillmentTrackingDialog: React.FC<
|
||||
OrderFulfillmentTrackingDialogProps
|
||||
> = ({ confirmButtonState, open, trackingNumber, onConfirm, onClose }) => {
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -12,9 +12,12 @@ export interface OrderMarkAsPaidDialogProps {
|
|||
onConfirm: () => void;
|
||||
}
|
||||
|
||||
const OrderMarkAsPaidDialog: React.StatelessComponent<
|
||||
OrderMarkAsPaidDialogProps
|
||||
> = ({ confirmButtonState, onClose, onConfirm, open }) => {
|
||||
const OrderMarkAsPaidDialog: React.FC<OrderMarkAsPaidDialogProps> = ({
|
||||
confirmButtonState,
|
||||
onClose,
|
||||
onConfirm,
|
||||
open
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -26,7 +26,7 @@ interface OrderPaymentDialogProps {
|
|||
onSubmit: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const OrderPaymentDialog: React.StatelessComponent<OrderPaymentDialogProps> = ({
|
||||
const OrderPaymentDialog: React.FC<OrderPaymentDialogProps> = ({
|
||||
confirmButtonState,
|
||||
open,
|
||||
initial,
|
||||
|
|
|
@ -19,9 +19,12 @@ interface OrderPaymentVoidDialogProps {
|
|||
onConfirm?();
|
||||
}
|
||||
|
||||
const OrderPaymentVoidDialog: React.StatelessComponent<
|
||||
OrderPaymentVoidDialogProps
|
||||
> = ({ confirmButtonState, open, onConfirm, onClose }) => (
|
||||
const OrderPaymentVoidDialog: React.FC<OrderPaymentVoidDialogProps> = ({
|
||||
confirmButtonState,
|
||||
open,
|
||||
onConfirm,
|
||||
onClose
|
||||
}) => (
|
||||
<Dialog onClose={onClose} open={open}>
|
||||
<DialogTitle>
|
||||
<FormattedMessage
|
||||
|
|
|
@ -157,7 +157,7 @@ interface OrderOperationsProps {
|
|||
onOrderLineUpdate: (data: OrderLineUpdate) => void;
|
||||
}
|
||||
|
||||
const OrderOperations: React.StatelessComponent<OrderOperationsProps> = ({
|
||||
const OrderOperations: React.FC<OrderOperationsProps> = ({
|
||||
children,
|
||||
onDraftUpdate,
|
||||
onOrderFulfillmentCreate,
|
||||
|
|
|
@ -17,22 +17,18 @@ import OrderDetailsComponent from "./views/OrderDetails";
|
|||
import OrderDraftListComponent from "./views/OrderDraftList";
|
||||
import OrderListComponent from "./views/OrderList";
|
||||
|
||||
const OrderList: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
location
|
||||
}) => {
|
||||
const OrderList: React.FC<RouteComponentProps<any>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: OrderListUrlQueryParams = qs;
|
||||
return <OrderListComponent params={params} />;
|
||||
};
|
||||
const OrderDraftList: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
location
|
||||
}) => {
|
||||
const OrderDraftList: React.FC<RouteComponentProps<any>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: OrderDraftListUrlQueryParams = qs;
|
||||
return <OrderDraftListComponent params={params} />;
|
||||
};
|
||||
|
||||
const OrderDetails: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
const OrderDetails: React.FC<RouteComponentProps<any>> = ({
|
||||
location,
|
||||
match
|
||||
}) => {
|
||||
|
|
|
@ -47,9 +47,9 @@ interface OrderDetailsMessages {
|
|||
}) => React.ReactElement;
|
||||
}
|
||||
|
||||
export const OrderDetailsMessages: React.StatelessComponent<
|
||||
OrderDetailsMessages
|
||||
> = ({ children }) => {
|
||||
export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
|
||||
children
|
||||
}) => {
|
||||
const navigate = useNavigator();
|
||||
const pushMessage = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -76,10 +76,7 @@ interface OrderDetailsProps {
|
|||
params: OrderUrlQueryParams;
|
||||
}
|
||||
|
||||
export const OrderDetails: React.StatelessComponent<OrderDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
|
||||
const navigate = useNavigator();
|
||||
const { user } = useUser();
|
||||
|
||||
|
|
|
@ -46,9 +46,7 @@ interface OrderDraftListProps {
|
|||
params: OrderDraftListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const OrderDraftList: React.StatelessComponent<OrderDraftListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const OrderDraftList: React.FC<OrderDraftListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -48,9 +48,7 @@ interface OrderListProps {
|
|||
params: OrderListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const OrderList: React.StatelessComponent<OrderListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const OrderList: React.FC<OrderListProps> = ({ params }) => {
|
||||
const formatDate = useDateLocalize();
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
|
|
|
@ -45,7 +45,7 @@ export interface PageDetailsPageProps {
|
|||
onSubmit: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const PageDetailsPage: React.StatelessComponent<PageDetailsPageProps> = ({
|
||||
const PageDetailsPage: React.FC<PageDetailsPageProps> = ({
|
||||
disabled,
|
||||
errors,
|
||||
page,
|
||||
|
|
|
@ -16,7 +16,7 @@ export interface PageListPageProps extends PageListProps, ListActions {
|
|||
onBack: () => void;
|
||||
}
|
||||
|
||||
const PageListPage: React.StatelessComponent<PageListPageProps> = ({
|
||||
const PageListPage: React.FC<PageListPageProps> = ({
|
||||
disabled,
|
||||
settings,
|
||||
onAdd,
|
||||
|
|
|
@ -15,7 +15,7 @@ export interface PageSlugProps {
|
|||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const PageSlug: React.StatelessComponent<PageSlugProps> = ({
|
||||
const PageSlug: React.FC<PageSlugProps> = ({
|
||||
data,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -16,17 +16,13 @@ import PageCreate from "./views/PageCreate";
|
|||
import PageDetailsComponent from "./views/PageDetails";
|
||||
import PageListComponent from "./views/PageList";
|
||||
|
||||
const PageList: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
location
|
||||
}) => {
|
||||
const PageList: React.FC<RouteComponentProps<any>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: PageListUrlQueryParams = qs;
|
||||
return <PageListComponent params={params} />;
|
||||
};
|
||||
|
||||
const PageDetails: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
match
|
||||
}) => {
|
||||
const PageDetails: React.FC<RouteComponentProps<any>> = ({ match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: PageUrlQueryParams = qs;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface PageCreateProps {
|
|||
id: string;
|
||||
}
|
||||
|
||||
export const PageCreate: React.StatelessComponent<PageCreateProps> = () => {
|
||||
export const PageCreate: React.FC<PageCreateProps> = () => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -37,10 +37,7 @@ const createPageInput = (data: FormData): PageInput => {
|
|||
};
|
||||
};
|
||||
|
||||
export const PageDetails: React.StatelessComponent<PageDetailsProps> = ({
|
||||
id,
|
||||
params
|
||||
}) => {
|
||||
export const PageDetails: React.FC<PageDetailsProps> = ({ id, params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -33,9 +33,7 @@ interface PageListProps {
|
|||
params: PageListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const PageList: React.StatelessComponent<PageListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const PageList: React.FC<PageListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const paginate = usePaginator();
|
||||
|
|
|
@ -29,7 +29,7 @@ const useStyles = makeStyles(() => ({
|
|||
}
|
||||
}));
|
||||
|
||||
const PluginInfo: React.StatelessComponent<PluginInfoProps> = ({
|
||||
const PluginInfo: React.FC<PluginInfoProps> = ({
|
||||
data,
|
||||
description,
|
||||
name,
|
||||
|
|
|
@ -32,7 +32,7 @@ const useStyles = makeStyles(() => ({
|
|||
}
|
||||
}));
|
||||
|
||||
const PluginSettings: React.StatelessComponent<PluginSettingsProps> = ({
|
||||
const PluginSettings: React.FC<PluginSettingsProps> = ({
|
||||
data,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -31,7 +31,7 @@ export interface PluginsDetailsPageProps {
|
|||
onSubmit: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const PluginsDetailsPage: React.StatelessComponent<PluginsDetailsPageProps> = ({
|
||||
const PluginsDetailsPage: React.FC<PluginsDetailsPageProps> = ({
|
||||
disabled,
|
||||
errors,
|
||||
plugin,
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface PluginsListPageProps extends PageListProps {
|
|||
onBack: () => void;
|
||||
}
|
||||
|
||||
const PluginsListPage: React.StatelessComponent<PluginsListPageProps> = ({
|
||||
const PluginsListPage: React.FC<PluginsListPageProps> = ({
|
||||
disabled,
|
||||
settings,
|
||||
onBack,
|
||||
|
|
|
@ -13,17 +13,13 @@ import {
|
|||
import PluginsDetailsComponent from "./views/PluginsDetails";
|
||||
import PluginsListComponent from "./views/PluginsList";
|
||||
|
||||
const PluginList: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
location
|
||||
}) => {
|
||||
const PluginList: React.FC<RouteComponentProps<any>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: PluginsListUrlQueryParams = qs;
|
||||
return <PluginsListComponent params={params} />;
|
||||
};
|
||||
|
||||
const PageDetails: React.StatelessComponent<RouteComponentProps<any>> = ({
|
||||
match
|
||||
}) => {
|
||||
const PageDetails: React.FC<RouteComponentProps<any>> = ({ match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: PluginsListUrlQueryParams = qs;
|
||||
|
||||
|
|
0
src/plugins/views/PluginDetails.test.ts
Normal file
0
src/plugins/views/PluginDetails.test.ts
Normal file
|
@ -15,9 +15,7 @@ export interface PluginsDetailsProps {
|
|||
params: PluginsListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const PluginsDetails: React.StatelessComponent<PluginsDetailsProps> = ({
|
||||
id
|
||||
}) => {
|
||||
export const PluginsDetails: React.FC<PluginsDetailsProps> = ({ id }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -16,9 +16,7 @@ interface PluginsListProps {
|
|||
params: PluginsListUrlQueryParams;
|
||||
}
|
||||
|
||||
export const PluginsList: React.StatelessComponent<PluginsListProps> = ({
|
||||
params
|
||||
}) => {
|
||||
export const PluginsList: React.FC<PluginsListProps> = ({ params }) => {
|
||||
const navigate = useNavigator();
|
||||
const paginate = usePaginator();
|
||||
const { updateListSettings, settings } = useListSettings(
|
||||
|
|
|
@ -37,7 +37,7 @@ export interface ProductTypeAttributeEditDialogProps {
|
|||
onConfirm: (data: FormData) => void;
|
||||
}
|
||||
|
||||
const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
||||
const ProductTypeAttributeEditDialog: React.FC<
|
||||
ProductTypeAttributeEditDialogProps
|
||||
> = ({ disabled, errors, name, opened, title, values, onClose, onConfirm }) => {
|
||||
const intl = useIntl();
|
||||
|
|
|
@ -56,9 +56,7 @@ function handleTaxTypeChange(
|
|||
);
|
||||
}
|
||||
|
||||
const ProductTypeCreatePage: React.StatelessComponent<
|
||||
ProductTypeCreatePageProps
|
||||
> = ({
|
||||
const ProductTypeCreatePage: React.FC<ProductTypeCreatePageProps> = ({
|
||||
defaultWeightUnit,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -72,9 +72,7 @@ function handleTaxTypeChange(
|
|||
);
|
||||
}
|
||||
|
||||
const ProductTypeDetailsPage: React.StatelessComponent<
|
||||
ProductTypeDetailsPageProps
|
||||
> = ({
|
||||
const ProductTypeDetailsPage: React.FC<ProductTypeDetailsPageProps> = ({
|
||||
defaultWeightUnit,
|
||||
disabled,
|
||||
errors,
|
||||
|
|
|
@ -26,9 +26,7 @@ export interface ProductTypeListPageProps
|
|||
onBack: () => void;
|
||||
}
|
||||
|
||||
const ProductTypeListPage: React.StatelessComponent<
|
||||
ProductTypeListPageProps
|
||||
> = ({
|
||||
const ProductTypeListPage: React.FC<ProductTypeListPageProps> = ({
|
||||
currentTab,
|
||||
initialSearch,
|
||||
onAdd,
|
||||
|
|
|
@ -18,9 +18,12 @@ interface ProductTypeShippingProps {
|
|||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const ProductTypeShipping: React.StatelessComponent<
|
||||
ProductTypeShippingProps
|
||||
> = ({ data, defaultWeightUnit, disabled, onChange }) => {
|
||||
const ProductTypeShipping: React.FC<ProductTypeShippingProps> = ({
|
||||
data,
|
||||
defaultWeightUnit,
|
||||
disabled,
|
||||
onChange
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
|
|
|
@ -90,9 +90,7 @@ interface ProductTypeOperationsProps {
|
|||
onProductTypeUpdate: (data: ProductTypeUpdate) => void;
|
||||
}
|
||||
|
||||
const ProductTypeOperations: React.StatelessComponent<
|
||||
ProductTypeOperationsProps
|
||||
> = ({
|
||||
const ProductTypeOperations: React.FC<ProductTypeOperationsProps> = ({
|
||||
children,
|
||||
productType,
|
||||
onAssignAttribute,
|
||||
|
|
|
@ -16,9 +16,7 @@ import ProductTypeCreate from "./views/ProductTypeCreate";
|
|||
import ProductTypeListComponent from "./views/ProductTypeList";
|
||||
import ProductTypeUpdateComponent from "./views/ProductTypeUpdate";
|
||||
|
||||
const ProductTypeList: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
||||
location
|
||||
}) => {
|
||||
const ProductTypeList: React.FC<RouteComponentProps<{}>> = ({ location }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
const params: ProductTypeListUrlQueryParams = qs;
|
||||
return <ProductTypeListComponent params={params} />;
|
||||
|
@ -27,7 +25,7 @@ const ProductTypeList: React.StatelessComponent<RouteComponentProps<{}>> = ({
|
|||
interface ProductTypeUpdateRouteParams {
|
||||
id: string;
|
||||
}
|
||||
const ProductTypeUpdate: React.StatelessComponent<
|
||||
const ProductTypeUpdate: React.FC<
|
||||
RouteComponentProps<ProductTypeUpdateRouteParams>
|
||||
> = ({ match }) => {
|
||||
const qs = parseQs(location.search.substr(1));
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue