
* Minor fixes for intl messages * Add esbuild-loader * switch from babel to esbuild-loader * use formatjs enforce-id linter * Generate ids for intl messages * id format defined by idInterpolationPattern * Modify intl messages extraction * remove react-intl-translations-manager * remove transpile-tx.js * use formatjs cli * Modify defaultMessages.json * modify ids in defaultMessages.json with defined idInterpolationPattern * Fix errors * Fix page crash * Use babel to transpile tests * Fix useStateFromProps * Improve render count * Add test to useStateFromProps * Fix reloading state buh * Do not check if form with channels is dirty * Stop blocking save if form has not changed * Remove debug code * Fix form disabling * Fix variant selection checkbox onClick * Update translations * Update messages * Use esbuild to build storybook Co-authored-by: Bartłomiej Wiaduch <tukan2can@gmail.com> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import CardSpacer from "@saleor/components/CardSpacer";
|
|
import Container from "@saleor/components/Container";
|
|
import Grid from "@saleor/components/Grid";
|
|
import Metadata from "@saleor/components/Metadata";
|
|
import Savebar from "@saleor/components/Savebar";
|
|
import React from "react";
|
|
|
|
import GiftCardHistory from "./GiftCardHistory/GiftCardHistory";
|
|
import GiftCardUpdateDetailsCard from "./GiftCardUpdateDetailsCard";
|
|
import GiftCardUpdateInfoCard from "./GiftCardUpdateInfoCard";
|
|
import GiftCardUpdatePageHeader from "./GiftCardUpdatePageHeader";
|
|
import useGiftCardUpdateDialogs from "./providers/GiftCardUpdateDialogsProvider/hooks/useGiftCardUpdateDialogs";
|
|
import useGiftCardUpdate from "./providers/GiftCardUpdateFormProvider/hooks/useGiftCardUpdate";
|
|
import useGiftCardUpdateForm from "./providers/GiftCardUpdateFormProvider/hooks/useGiftCardUpdateForm";
|
|
|
|
const GiftCardUpdatePage: React.FC = () => {
|
|
const { navigateBack, openDeleteDialog } = useGiftCardUpdateDialogs();
|
|
|
|
const {
|
|
submit,
|
|
data,
|
|
handlers: { changeMetadata }
|
|
} = useGiftCardUpdateForm();
|
|
|
|
const {
|
|
opts: { loading: loadingUpdate, status }
|
|
} = useGiftCardUpdate();
|
|
|
|
return (
|
|
<Container>
|
|
<GiftCardUpdatePageHeader />
|
|
<Grid>
|
|
<div>
|
|
<GiftCardUpdateDetailsCard />
|
|
<CardSpacer />
|
|
<Metadata data={data} onChange={changeMetadata} />
|
|
</div>
|
|
<div>
|
|
<GiftCardUpdateInfoCard />
|
|
</div>
|
|
<GiftCardHistory />
|
|
</Grid>
|
|
<Savebar
|
|
state={status}
|
|
disabled={loadingUpdate}
|
|
onCancel={navigateBack}
|
|
onSubmit={submit}
|
|
onDelete={openDeleteDialog}
|
|
/>
|
|
</Container>
|
|
);
|
|
};
|
|
|
|
export default GiftCardUpdatePage;
|