Skip to content

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

Update snapshots

dominik-zeglend5b656b3d570
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
index 00113a6f37..5c2baca122 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
@@ -12,6 +12,7 @@ import { FormSpacer } from "../../../components/FormSpacer";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
import { CustomerDetails_user } from "../../types/CustomerDetails";
+import Skeleton from "../../../components/Skeleton";
export interface CustomerDetailsProps {
customer: CustomerDetails_user;
@@ -41,12 +42,16 @@ const CustomerDetails = decorate<CustomerDetailsProps>(
title={
<>
{i18n.t("General Information")}
- <Typography variant="caption">
- {i18n.t("Customer since: {{ month }} {{ year }}", {
- month: moment(maybe(() => customer.dateJoined)).format("MMM"),
- year: moment(maybe(() => customer.dateJoined)).format("YYYY")
- })}
- </Typography>
+ {customer && customer.dateJoined ? (
+ <Typography variant="caption">
+ {i18n.t("Customer since: {{ month }} {{ year }}", {
+ month: moment(customer.dateJoined).format("MMM"),
+ year: moment(customer.dateJoined).format("YYYY")
+ })}
+ </Typography>
+ ) : (
+ <Skeleton style={{ width: "10rem" }} />
+ )}
</>
}
/>
diff --git a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
index 5231413148..1f9b7783ea 100644
--- a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
+++ b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
@@ -16498,9 +16498,10 @@ exports[`Storyshots Views / Customers / Customer details loading 1`] = `
>
General Information
<span
- class="MuiTypography-root-id MuiTypography-caption-id"
+ class="Skeleton-skeleton-id"
+ style="width:10rem"
>
- Customer since: Nov 2018
+ ‌
</span>
</span>
<div