import * as React from "react"; import AppHeader from "@saleor/components/AppHeader"; import CardSpacer from "@saleor/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton"; import Container from "@saleor/components/Container"; import Form from "@saleor/components/Form"; import Grid from "@saleor/components/Grid"; import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; import i18n from "../../../i18n"; import { UserError } from "../../../types"; import { SaleType } from "../../../types/globalTypes"; import SaleInfo from "../SaleInfo"; import SalePricing from "../SalePricing"; export interface FormData { name: string; startDate: string; endDate: string; value: string; type: SaleType; } export interface SaleCreatePageProps { defaultCurrency: string; disabled: boolean; errors: UserError[]; saveButtonBarState: ConfirmButtonTransitionState; onBack: () => void; onSubmit: (data: FormData) => void; } const SaleCreatePage: React.StatelessComponent = ({ defaultCurrency, disabled, errors, onSubmit, saveButtonBarState, onBack }) => { const initialForm: FormData = { endDate: "", name: "", startDate: "", type: SaleType.FIXED, value: "" }; return (
{({ change, data, errors: formErrors, hasChanged, submit }) => ( {i18n.t("Sales")}
)}
); }; SaleCreatePage.displayName = "SaleCreatePage"; export default SaleCreatePage;