2019-08-26 17:08:32 +00:00
|
|
|
import Card from "@material-ui/core/Card";
|
|
|
|
import CardContent from "@material-ui/core/CardContent";
|
2019-08-27 12:36:19 +00:00
|
|
|
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
2019-08-26 17:08:32 +00:00
|
|
|
import Typography from "@material-ui/core/Typography";
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
import CardTitle from "@saleor/components/CardTitle";
|
|
|
|
import ControlledSwitch from "@saleor/components/ControlledSwitch";
|
|
|
|
import FormSpacer from "@saleor/components/FormSpacer";
|
|
|
|
import Hr from "@saleor/components/Hr";
|
|
|
|
import i18n from "../../../i18n";
|
|
|
|
import { FormData } from "../PluginsDetailsPage";
|
|
|
|
|
|
|
|
interface PluginInfoProps {
|
|
|
|
data: FormData;
|
|
|
|
onChange: (event: React.ChangeEvent<any>) => void;
|
|
|
|
}
|
|
|
|
|
2019-08-27 12:36:19 +00:00
|
|
|
const styles = createStyles({
|
|
|
|
status: {
|
|
|
|
paddingTop: 20
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
fontSize: 14,
|
|
|
|
paddingTop: 10
|
|
|
|
}
|
|
|
|
});
|
2019-08-26 17:08:32 +00:00
|
|
|
|
|
|
|
const PluginInfo = withStyles(styles, { name: "PluginInfo" })(
|
|
|
|
({
|
|
|
|
data,
|
|
|
|
classes,
|
|
|
|
onChange
|
|
|
|
}: PluginInfoProps & WithStyles<typeof styles>) => {
|
|
|
|
return (
|
|
|
|
<Card>
|
|
|
|
<CardTitle
|
|
|
|
title={i18n.t("Plugin Information and Status", {
|
|
|
|
context: "plugin configuration"
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<CardContent>
|
|
|
|
<Typography className={classes.title} variant="h6">
|
|
|
|
{i18n.t("Plugin Name")}
|
|
|
|
</Typography>
|
|
|
|
<Typography>{data.name}</Typography>
|
|
|
|
{data.description && (
|
|
|
|
<>
|
|
|
|
<Typography className={classes.title} variant="h6">
|
|
|
|
{i18n.t("Plugin Description")}
|
|
|
|
</Typography>
|
|
|
|
<Typography>{data.description}</Typography>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
<FormSpacer />
|
|
|
|
<Hr />
|
2019-08-29 14:16:16 +00:00
|
|
|
<Typography className={classes.status}>{i18n.t("Status")}</Typography>
|
2019-08-26 17:08:32 +00:00
|
|
|
<ControlledSwitch
|
|
|
|
checked={data.active}
|
|
|
|
label={"Set plugin as Active"}
|
|
|
|
name={"active" as keyof FormData}
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</CardContent>
|
|
|
|
</Card>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
PluginInfo.displayName = "PluginInfo";
|
|
|
|
export default PluginInfo;
|