From 9f3dfe3bcd8bbafacac29092e39fa217c80ce038 Mon Sep 17 00:00:00 2001 From: Wojciech Mista Date: Thu, 3 Feb 2022 13:59:36 +0100 Subject: [PATCH] Fix card menu styles on small screens (#1813) * Move cardMenu to page header * Update tests * Fix extension menu items * Refactor card menu in page header * Update tests * Apply new page styling to gift cards list --- .../ButtonWithSelect/ButtonWithSelect.tsx | 4 +- .../ExtendedPageHeader/ExtendedPageHeader.tsx | 14 +- src/components/PageHeader/PageHeader.tsx | 26 +- .../GiftCardsListHeader.tsx | 8 +- .../OrderDetailsPage/OrderDetailsPage.tsx | 5 +- .../OrderListPage/OrderListPage.tsx | 30 +- .../ProductListPage/ProductListPage.tsx | 36 +- .../__snapshots__/Stories.test.ts.snap | 3932 +++++++++++------ 8 files changed, 2560 insertions(+), 1495 deletions(-) diff --git a/src/components/ButtonWithSelect/ButtonWithSelect.tsx b/src/components/ButtonWithSelect/ButtonWithSelect.tsx index 71610c8e8..8e507ee69 100644 --- a/src/components/ButtonWithSelect/ButtonWithSelect.tsx +++ b/src/components/ButtonWithSelect/ButtonWithSelect.tsx @@ -68,7 +68,9 @@ export const ButtonWithSelect: React.FC = ({ aria-label="button with select" {...props} > - + {options.length > 0 && ( - ); }; diff --git a/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx index 2372d4db1..94c9c5eb3 100644 --- a/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx +++ b/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx @@ -229,9 +229,8 @@ const OrderDetailsPage: React.FC = props => { } - > - - + cardMenu={} + />
{order && order.created ? ( diff --git a/src/orders/components/OrderListPage/OrderListPage.tsx b/src/orders/components/OrderListPage/OrderListPage.tsx index c69537bbc..4493da85a 100644 --- a/src/orders/components/OrderListPage/OrderListPage.tsx +++ b/src/orders/components/OrderListPage/OrderListPage.tsx @@ -77,21 +77,23 @@ const OrderListPage: React.FC = ({ } ) } + cardMenu={ + !!onSettingsOpen && ( + + ) + } > - {!!onSettingsOpen && ( - - )} +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Fulfilled +
+ Fulfilled +
+
+ +
-
- -
-
+ />
+
+
+
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Partially fulfilled +
+ Partially fulfilled +
+
+ +
-
- -
-
+ />
- 9
+ class="ExtendedPageHeader-titleRow-id" + > + 9 +
+
- Unfulfilled +
+ Unfulfilled +
+
+ +
-
- -
-
+ />
- #24 +
+ #24 +
- - ‌ - + + ‌ + +
- #24 +
+ #24 +
- #24 +
+ #24 +
- Orders +
+ Orders +
+
+ +
230/500 orders
-
- -
+
500/500 orders
-
- -
+
230/500 orders
-
- -
+
-
- -
+
230/500 orders
-
- -
+
100/1000 SKUs used
-
- -
@@ -205817,6 +206634,7 @@ exports[`Storyshots Views / Products / Product list default 1`] = ` > +
1000/1000 SKUs used
-
- -
@@ -208504,6 +209326,7 @@ exports[`Storyshots Views / Products / Product list limits reached 1`] = ` +
100/1000 SKUs used
-
- -
@@ -211269,6 +212096,7 @@ exports[`Storyshots Views / Products / Product list loading 1`] = ` > +
100/1000 SKUs used
-
- -
@@ -211824,6 +212656,7 @@ exports[`Storyshots Views / Products / Product list no channels 1`] = ` > +
100/1000 SKUs used
-
- -
@@ -214210,6 +215047,7 @@ exports[`Storyshots Views / Products / Product list no data 1`] = ` > +
-
- -
@@ -214602,6 +215444,7 @@ exports[`Storyshots Views / Products / Product list no limits 1`] = ` > +
100/1000 SKUs used
-
- -
@@ -217288,6 +218135,7 @@ exports[`Storyshots Views / Products / Product list with data 1`] = ` >