Skip to content

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

Fix exploding card layout

dominik-zeglen877f02b4ac90
diff --git a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
index 78cc3ed353..0770ac216d 100644
--- a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
+++ b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
@@ -15,11 +15,12 @@ const styles = (theme: Theme) =>
height: 48
},
hr: {
- backgroundColor: "#eaeaea",
border: "none",
- height: 1,
+ borderTop: "1px solid #eaeaea",
+ height: 0,
marginBottom: 0,
- marginTop: 0
+ marginTop: 0,
+ width: "100%"
},
root: theme.mixins.gutters({
alignItems: "center",
diff --git a/saleor/static/dashboard-next/customers/components/CustomerAddress/CustomerAddress.tsx b/saleor/static/dashboard-next/customers/components/CustomerAddress/CustomerAddress.tsx
index 46bb56f206..c9b81eb460 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerAddress/CustomerAddress.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerAddress/CustomerAddress.tsx
@@ -33,6 +33,16 @@ export interface CustomerAddressProps {
const styles = createStyles({
actions: {
flexDirection: "row"
+ },
+ actionsContainer: {
+ display: "flex",
+ flexDirection: "column",
+ height: "100%",
+ justifyContent: "flex-end"
+ },
+ card: {
+ display: "flex",
+ flexDirection: "column"
}
});
const CustomerAddress = withStyles(styles, { name: "CustomerAddress" })(
@@ -47,7 +57,7 @@ const CustomerAddress = withStyles(styles, { name: "CustomerAddress" })(
onRemove,
onSetAsDefault
}: CustomerAddressProps & WithStyles<typeof styles>) => (
- <Card>
+ <Card className={classes.card}>
<CardTitle
title={
address ? (
@@ -93,24 +103,26 @@ const CustomerAddress = withStyles(styles, { name: "CustomerAddress" })(
<CardContent>
<AddressFormatter address={address} />
</CardContent>
- <CardActions className={classes.actions}>
- <Button
- color="secondary"
- disabled={disabled}
- variant="flat"
- onClick={onEdit}
- >
- {i18n.t("Edit")}
- </Button>
- <Button
- color="secondary"
- disabled={disabled}
- variant="flat"
- onClick={onRemove}
- >
- {i18n.t("Delete")}
- </Button>
- </CardActions>
+ <div className={classes.actionsContainer}>
+ <CardActions className={classes.actions}>
+ <Button
+ color="secondary"
+ disabled={disabled}
+ variant="flat"
+ onClick={onEdit}
+ >
+ {i18n.t("Edit")}
+ </Button>
+ <Button
+ color="secondary"
+ disabled={disabled}
+ variant="flat"
+ onClick={onRemove}
+ >
+ {i18n.t("Delete")}
+ </Button>
+ </CardActions>
+ </div>
</Card>
)
);
diff --git a/saleor/static/dashboard-next/customers/fixtures.ts b/saleor/static/dashboard-next/customers/fixtures.ts
index 833a875a5a..9d3e60e1d7 100644
--- a/saleor/static/dashboard-next/customers/fixtures.ts
+++ b/saleor/static/dashboard-next/customers/fixtures.ts
@@ -964,7 +964,7 @@ export const customer: CustomerDetails_user & CustomerAddresses_user = {
phone: "",
postalCode: "52203",
streetAddress1: "419 Ruiz Orchard Apt. 199",
- streetAddress2: ""
+ streetAddress2: "0238 Cremin Freeway"
},
{
__typename: "Address",