2019-06-19 14:40:52 +00:00
|
|
|
import Card from "@material-ui/core/Card";
|
|
|
|
import CardContent from "@material-ui/core/CardContent";
|
|
|
|
import TextField from "@material-ui/core/TextField";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-08-26 21:26:36 +00:00
|
|
|
import { useIntl } from "react-intl";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
import CardTitle from "@saleor/components/CardTitle";
|
2019-08-26 21:26:36 +00:00
|
|
|
import { commonMessages } from "@saleor/intl";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { FormErrors } from "../../../types";
|
|
|
|
import { FormData } from "../ShippingZoneDetailsPage";
|
|
|
|
|
|
|
|
export interface ShippingZoneInfoProps {
|
|
|
|
data: FormData;
|
|
|
|
errors: FormErrors<"name">;
|
|
|
|
onChange: (event: React.ChangeEvent<any>) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ShippingZoneInfo: React.StatelessComponent<ShippingZoneInfoProps> = ({
|
|
|
|
data,
|
|
|
|
errors,
|
|
|
|
onChange
|
2019-08-26 21:26:36 +00:00
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Card>
|
|
|
|
<CardTitle
|
|
|
|
title={intl.formatMessage(commonMessages.generalInformations)}
|
2019-06-19 14:40:52 +00:00
|
|
|
/>
|
2019-08-26 21:26:36 +00:00
|
|
|
<CardContent>
|
|
|
|
<TextField
|
|
|
|
error={!!errors.name}
|
|
|
|
fullWidth
|
|
|
|
helperText={errors.name}
|
|
|
|
label={intl.formatMessage({
|
|
|
|
defaultMessage: "Shipping Zone Name"
|
|
|
|
})}
|
|
|
|
name={"name" as keyof FormData}
|
|
|
|
value={data.name}
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</CardContent>
|
|
|
|
</Card>
|
|
|
|
);
|
|
|
|
};
|
2019-06-19 14:40:52 +00:00
|
|
|
ShippingZoneInfo.displayName = "ShippingZoneInfo";
|
|
|
|
export default ShippingZoneInfo;
|