Skip to content

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

Fix visual bugs

dominik-zeglen31b72f974971
diff --git a/saleor/static/dashboard-next/components/AddressFormatter/AddressFormatter.tsx b/saleor/static/dashboard-next/components/AddressFormatter/AddressFormatter.tsx
index 32a934e199..f9f7fef8d4 100644
--- a/saleor/static/dashboard-next/components/AddressFormatter/AddressFormatter.tsx
+++ b/saleor/static/dashboard-next/components/AddressFormatter/AddressFormatter.tsx
@@ -15,7 +15,11 @@ const AddressFormatter: React.StatelessComponent<AddressFormatterProps> = ({
return <Skeleton />;
}
return (
- <address>
+ <address
+ style={{
+ fontStyle: "inherit"
+ }}
+ >
<Typography component="span">
{address.firstName} {address.lastName}
</Typography>
diff --git a/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx b/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx
index 31bc02c43a..63d3ba225e 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx
@@ -1,4 +1,3 @@
-import Button from "@material-ui/core/Button";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import { withStyles } from "@material-ui/core/styles";
@@ -25,20 +24,20 @@ const decorate = withStyles(theme => ({
}
}));
const CustomerAddresses = decorate<CustomerAddressesProps>(
- ({ classes, customer, disabled, onAddressManageClick }) => (
+ ({ classes, customer }) => (
<Card>
<CardTitle
title={i18n.t("Address Information")}
- toolbar={
- <Button
- color="secondary"
- disabled={disabled}
- variant="flat"
- onClick={onAddressManageClick}
- >
- {i18n.t("Manage", { context: "button" })}
- </Button>
- }
+ // toolbar={ // TODO: add address management #3173
+ // <Button
+ // color="secondary"
+ // disabled={disabled}
+ // variant="flat"
+ // onClick={onAddressManageClick}
+ // >
+ // {i18n.t("Manage", { context: "button" })}
+ // </Button>
+ // }
/>
{customer &&
customer.defaultBillingAddress &&
@@ -50,7 +49,7 @@ const CustomerAddresses = decorate<CustomerAddressesProps>(
<>
<CardContent>
<Typography className={classes.label}>
- {i18n.t("Default billing address")}
+ {i18n.t("Billing address")}
</Typography>
<AddressFormatter
address={maybe(() => customer.defaultBillingAddress)}
@@ -59,7 +58,7 @@ const CustomerAddresses = decorate<CustomerAddressesProps>(
<Hr />
<CardContent>
<Typography className={classes.label}>
- {i18n.t("Default shipping address")}
+ {i18n.t("Shipping address")}
</Typography>
<AddressFormatter
address={maybe(() => customer.defaultShippingAddress)}
@@ -68,9 +67,7 @@ const CustomerAddresses = decorate<CustomerAddressesProps>(
</>
) : (
<CardContent>
- <Typography className={classes.label}>
- {i18n.t("Default address")}
- </Typography>
+ <Typography className={classes.label}>{i18n.t("Address")}</Typography>
<AddressFormatter
address={maybe(() => customer.defaultBillingAddress)}
/>
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
index 3d5adb3d0d..00113a6f37 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
@@ -28,16 +28,11 @@ export interface CustomerDetailsProps {
onChange: (event: React.ChangeEvent<any>) => void;
}
-const decorate = withStyles(theme => ({
+const decorate = withStyles({
cardTitle: {
height: 64
- },
- root: {
- display: "grid" as "grid",
- gridColumnGap: theme.spacing.unit * 2 + "px",
- gridTemplateColumns: "1fr 1fr"
}
-}));
+});
const CustomerDetails = decorate<CustomerDetailsProps>(
({ classes, customer, data, disabled, errors, onChange }) => (
<Card>
@@ -66,19 +61,17 @@ const CustomerDetails = decorate<CustomerDetailsProps>(
onChange={onChange}
/>
<FormSpacer />
- <div className={classes.root}>
- <TextField
- disabled={disabled}
- error={!!errors.email}
- fullWidth
- helperText={errors.email}
- name="email"
- type="email"
- label={i18n.t("E-mail")}
- value={data.email}
- onChange={onChange}
- />
- </div>
+ <TextField
+ disabled={disabled}
+ error={!!errors.email}
+ fullWidth
+ helperText={errors.email}
+ name="email"
+ type="email"
+ label={i18n.t("E-mail")}
+ value={data.email}
+ onChange={onChange}
+ />
<FormSpacer />
<TextField
disabled={disabled}
diff --git a/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx b/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx
index 67f083b180..b23693fb03 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx
@@ -16,21 +16,27 @@ export interface CustomerStatsProps {
customer: CustomerDetails_user;
}
-const decorate = withStyles({
+const decorate = withStyles(theme => ({
+ label: {
+ marginBottom: theme.spacing.unit,
+ textTransform: "uppercase" as "uppercase"
+ },
value: {
fontSize: 24
}
-});
+}));
const CustomerStats = decorate<CustomerStatsProps>(({ classes, customer }) => (
<Card>
<CardTitle title={i18n.t("Customer History")} />
<CardContent>
- <Typography variant="body2">{i18n.t("Last login")}</Typography>
+ <Typography className={classes.label} variant="body2">
+ {i18n.t("Last login")}
+ </Typography>
{maybe(
() => (
<Typography variant="title" className={classes.value}>
{customer.lastLogin === null ? (
- i18n.t("Never")
+ i18n.t("-")
) : (
<DateFormatter date={customer.lastLogin} />
)}
@@ -41,12 +47,14 @@ const CustomerStats = decorate<CustomerStatsProps>(({ classes, customer }) => (
</CardContent>
<Hr />
<CardContent>
- <Typography variant="body2">{i18n.t("Last order")}</Typography>
+ <Typography className={classes.label} variant="body2">
+ {i18n.t("Last order")}
+ </Typography>
{maybe(
() => (
<Typography variant="title" className={classes.value}>
{customer.lastPlacedOrder.edges.length === 0 ? (
- i18n.t("No orders yet")
+ i18n.t("-")
) : (
<DateFormatter
date={customer.lastPlacedOrder.edges[0].node.created}