From 19f90d29e8a8fee3be81e942ec3a9ddf6ab5d707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dro=C5=84?= Date: Mon, 18 Oct 2021 12:18:46 +0200 Subject: [PATCH] Fix wrapping issue & typos on homescreen (#1505) (#1517) * fix wrapping issues & messages * fix messages id & camelCase --- locale/defaultMessages.json | 36 +++++++++--------- .../HomeNotificationTable.tsx | 37 ++----------------- .../HomeNotificationTable/messages.ts | 28 ++++++++++++++ .../__snapshots__/Stories.test.ts.snap | 14 +++---- 4 files changed, 56 insertions(+), 59 deletions(-) create mode 100644 src/home/components/HomeNotificationTable/messages.ts diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index c0c980f6e..81087071e 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -208,24 +208,6 @@ "context": "subheader", "string": "Here is some information we gathered about your store" }, - "homeNotificationTableNoOrders": { - "string": "No orders ready to fulfill" - }, - "homeNotificationTableOrders": { - "string": "{amount, plural,one {One order is ready to fulfill} other {{amount} Orders are ready to fulfill}}" - }, - "homeNotificationTablePayments": { - "string": "{amount, plural,one {One payment to capture}other {{amount} Payments to capture}}" - }, - "homeNotificationTableProducts": { - "string": "{amount, plural,one {One product out of stock}other {{amount} Products out of stock}}" - }, - "homeNotificationsNoPayments": { - "string": "No payments waiting for capture" - }, - "homeNotificationsTableNoProducts": { - "string": "No products out of stock" - }, "homeProductListCardOrders": { "context": "number of ordered products", "string": "{amount, plural,one {One ordered}other {{amount} Ordered}}" @@ -3952,6 +3934,24 @@ "src_dot_home_dot_components_dot_HomeNotificationTable_dot_createNewChannel": { "string": "Create new channel" }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_noOrders": { + "string": "No orders ready to fulfill" + }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_noPaymentWaiting": { + "string": "No payments waiting for capture" + }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_noProductsOut": { + "string": "No products are out of stock" + }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_orderReady": { + "string": "{amount, plural,one {One order is ready to fulfill} other {{amount} orders are ready to fulfill}}" + }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_paymentCapture": { + "string": "{amount, plural,one {One payment to capture}other {{amount} payments to capture}}" + }, + "src_dot_home_dot_components_dot_HomeNotificationTable_dot_productOut": { + "string": "{amount, plural,one {One product out of stock}other {{amount} products out of stock}}" + }, "src_dot_hooks_dot_3382262667": { "string": "Variant {name} has been set as default." }, diff --git a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx index 239755709..4c5702148 100644 --- a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx +++ b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx @@ -13,46 +13,15 @@ import { makeStyles } from "@saleor/macaw-ui"; import { UserPermissionProps } from "@saleor/types"; import { PermissionEnum } from "@saleor/types/globalTypes"; import React from "react"; -import { defineMessages, useIntl } from "react-intl"; +import { useIntl } from "react-intl"; -const messages = defineMessages({ - createNewChannel: { - defaultMessage: "Create new channel" - }, - noOrders: { - defaultMessage: "No orders ready to fulfill", - id: "homeNotificationTableNoOrders" - }, - noPaymentWaiting: { - defaultMessage: "No payments waiting for capture", - id: "homeNotificationsNoPayments" - }, - noProductsOut: { - defaultMessage: "No products out of stock", - id: "homeNotificationsTableNoProducts" - }, - orderReady: { - defaultMessage: - "{amount, plural,one {One order is ready to fulfill} other {{amount} Orders are ready to fulfill}}", - id: "homeNotificationTableOrders" - }, - paymentCapture: { - defaultMessage: - "{amount, plural,one {One payment to capture}other {{amount} Payments to capture}}", - id: "homeNotificationTablePayments" - }, - productOut: { - defaultMessage: - "{amount, plural,one {One product out of stock}other {{amount} Products out of stock}}", - id: "homeNotificationTableProducts" - } -}); +import { homeNotificationTableMessages as messages } from "./messages"; const useStyles = makeStyles( () => ({ arrowIcon: { textAlign: "right", - width: "auto" + width: 100 }, tableCard: { overflow: "hidden" diff --git a/src/home/components/HomeNotificationTable/messages.ts b/src/home/components/HomeNotificationTable/messages.ts new file mode 100644 index 000000000..42e8d3415 --- /dev/null +++ b/src/home/components/HomeNotificationTable/messages.ts @@ -0,0 +1,28 @@ +import { defineMessages } from "react-intl"; + +export const homeNotificationTableMessages = defineMessages({ + createNewChannel: { + defaultMessage: "Create new channel" + }, + noOrders: { + defaultMessage: "No orders ready to fulfill" + }, + noPaymentWaiting: { + defaultMessage: "No payments waiting for capture" + }, + noProductsOut: { + defaultMessage: "No products are out of stock" + }, + orderReady: { + defaultMessage: + "{amount, plural,one {One order is ready to fulfill} other {{amount} orders are ready to fulfill}}" + }, + paymentCapture: { + defaultMessage: + "{amount, plural,one {One payment to capture}other {{amount} payments to capture}}" + }, + productOut: { + defaultMessage: + "{amount, plural,one {One product out of stock}other {{amount} products out of stock}}" + } +}); diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 186251154..5dabde5c4 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -109879,7 +109879,7 @@ exports[`Storyshots Views / HomePage default 1`] = ` 1 - Orders are ready to fulfill + orders are ready to fulfill - No products out of stock + No products are out of stock - No products out of stock + No products are out of stock 1 - Orders are ready to fulfill + orders are ready to fulfill - No products out of stock + No products are out of stock 1 - Orders are ready to fulfill + orders are ready to fulfill - No products out of stock + No products are out of stock