Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add first and last name to create customer component

Lukasz Szewczyk282606b0bbfc
diff --git a/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx b/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx
index 2d9d3609dc..4393c2246a 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx
@@ -17,6 +17,7 @@ const styles = (theme: Theme) =>
root: {
display: "grid",
gridColumnGap: theme.spacing.unit * 2 + "px",
+ gridRowGap: theme.spacing.unit * 3 + "px",
gridTemplateColumns: "1fr 1fr"
}
});
@@ -24,10 +25,14 @@ const styles = (theme: Theme) =>
export interface CustomerCreateDetailsProps extends WithStyles<typeof styles> {
data: {
email: string;
+ firstName: string;
+ lastName: string;
};
disabled: boolean;
errors: Partial<{
email: string;
+ firstName: string;
+ lastName: string;
}>;
onChange: (event: React.ChangeEvent<any>) => void;
}
@@ -46,12 +51,34 @@ const CustomerCreateDetails = withStyles(styles, {
<CardTitle title={i18n.t("Customer overview")} />
<CardContent>
<div className={classes.root}>
+ <TextField
+ disabled={disabled}
+ error={!!errors.firstName}
+ fullWidth
+ name="firstName"
+ label={i18n.t("First Name")}
+ helperText={errors.firstName}
+ type="firstName"
+ value={data.email}
+ onChange={onChange}
+ />
+ <TextField
+ disabled={disabled}
+ error={!!errors.lastName}
+ fullWidth
+ name="lastName"
+ label={i18n.t("Last Name")}
+ helperText={errors.lastName}
+ type="lastName"
+ value={data.lastName}
+ onChange={onChange}
+ />
<TextField
disabled={disabled}
error={!!errors.email}
fullWidth
name="email"
- label={i18n.t("E-mail")}
+ label={i18n.t("Email address")}
helperText={errors.email}
type="email"
value={data.email}