diff --git a/locale/messages.pot b/locale/messages.pot index 31e71828c..7e2a684d4 100644 --- a/locale/messages.pot +++ b/locale/messages.pot @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2019-08-26T21:32:40.783Z\n" +"POT-Creation-Date: 2019-08-26T21:41:35.304Z\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "MIME-Version: 1.0\n" @@ -35,6 +35,22 @@ msgctxt "attribute value edit error" msgid "A value named {name} already exists" msgstr "" +#: build/locale/src/staff/components/StaffStatus/StaffStatus.json +#. [src.staff.components.StaffStatus.2183517419] - section header +#. defaultMessage is: +#. Account Status +msgctxt "section header" +msgid "Account Status" +msgstr "" + +#: build/locale/src/staff/components/StaffList/StaffList.json +#. [src.staff.components.StaffList.3247064221] - staff member status +#. defaultMessage is: +#. Active +msgctxt "staff member status" +msgid "Active" +msgstr "" + #: build/locale/src/discounts/components/VoucherDates/VoucherDates.json #. [src.discounts.components.VoucherDates.1662220323] - time during voucher is active, header #. defaultMessage is: @@ -131,6 +147,14 @@ msgctxt "button" msgid "Add Sale" msgstr "" +#: build/locale/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.json +#. [src.staff.components.StaffAddMemberDialog.3490059488] - dialog header +#. defaultMessage is: +#. Add Staff Member +msgctxt "dialog header" +msgid "Add Staff Member" +msgstr "" + #: build/locale/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.json #. [src.attributes.components.AttributeValueEditDialog.1841790893] - add attribute value #. defaultMessage is: @@ -343,6 +367,14 @@ msgctxt "button" msgid "Add shipping zone" msgstr "" +#: build/locale/src/staff/components/StaffListPage/StaffListPage.json +#. [src.staff.components.StaffListPage.802625341] - button +#. defaultMessage is: +#. Add staff member +msgctxt "button" +msgid "Add staff member" +msgstr "" + #: build/locale/src/categories/components/CategoryList/CategoryList.json #. [src.categories.components.CategoryList.435697837] - button #. defaultMessage is: @@ -895,6 +927,22 @@ msgctxt "unassign country" msgid "Are you sure you want to remove {countryName} from this shipping zone?" msgstr "" +#: build/locale/src/staff/views/StaffDetails.json +#. [src.staff.views.3945766678] +#. defaultMessage is: +#. Are you sure you want to remove {email} avatar? +msgctxt "description" +msgid "Are you sure you want to remove {email} avatar?" +msgstr "" + +#: build/locale/src/staff/views/StaffDetails.json +#. [src.staff.views.2728048444] +#. defaultMessage is: +#. Are you sure you want to remove {email} from staff members? +msgctxt "description" +msgid "Are you sure you want to remove {email} from staff members?" +msgstr "" + #: build/locale/src/productTypes/components/ProductTypeAttributeUnassignDialog/ProductTypeAttributeUnassignDialog.json #. [src.productTypes.components.ProductTypeAttributeUnassignDialog.722498450] #. defaultMessage is: @@ -1423,6 +1471,14 @@ msgctxt "description" msgid "Category name" msgstr "" +#: build/locale/src/staff/components/StaffProperties/StaffProperties.json +#. [src.staff.components.StaffProperties.2771097267] - button +#. defaultMessage is: +#. Change photo +msgctxt "button" +msgid "Change photo" +msgstr "" + #: build/locale/src/products/views/ProductList/ProductList.json #. [src.products.views.ProductList.224127438] - product status update notification #. defaultMessage is: @@ -2219,6 +2275,14 @@ msgctxt "dialog header" msgid "Delete Shipping Zones" msgstr "" +#: build/locale/src/staff/views/StaffDetails.json +#. [src.staff.views.701332676] - dialog header +#. defaultMessage is: +#. Delete Staff User Avatar +msgctxt "dialog header" +msgid "Delete Staff User Avatar" +msgstr "" + #: build/locale/src/products/components/ProductVariantCreatePage/ProductVariantCreatePage.json #. [src.products.components.ProductVariantCreatePage.3726089650] - button #. defaultMessage is: @@ -2351,6 +2415,14 @@ msgctxt "dialog header" msgid "Delete menus" msgstr "" +#: build/locale/src/staff/components/StaffProperties/StaffProperties.json +#. [src.staff.components.StaffProperties.457748370] - button +#. defaultMessage is: +#. Delete photo +msgctxt "button" +msgid "Delete photo" +msgstr "" + #: build/locale/src/categories/views/CategoryDetails.json #. [src.categories.views.2507763081] - dialog title #. defaultMessage is: @@ -2627,6 +2699,14 @@ msgctxt "section header" msgid "Eligible Products" msgstr "" +#: build/locale/src/staff/components/StaffList/StaffList.json +#. [src.staff.components.StaffList.1789607185] +#. defaultMessage is: +#. Email Address +msgctxt "description" +msgid "Email Address" +msgstr "" + #: build/locale/src/intl.json #. [src.endDate] #. defaultMessage is: @@ -2667,6 +2747,22 @@ msgctxt "description" msgid "Enter any extra infotmation regarding this customer." msgstr "" +#: build/locale/src/staff/components/StaffPermissions/StaffPermissions.json +#. [src.staff.components.StaffPermissions.3639008725] +#. defaultMessage is: +#. Expand or restrict user's permissions to access certain part of saleor system. +msgctxt "description" +msgid "Expand or restrict user's permissions to access certain part of saleor system." +msgstr "" + +#: build/locale/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.json +#. [src.staff.components.StaffAddMemberDialog.351138560] +#. defaultMessage is: +#. Expand or restrict user’s permissions to access certain part of saleor system. +msgctxt "description" +msgid "Expand or restrict user’s permissions to access certain part of saleor system." +msgstr "" + #: build/locale/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.json #. [src.collections.components.CollectionDetailsPage.2906897537] - switch button #. defaultMessage is: @@ -2899,6 +2995,14 @@ msgctxt "description" msgid "If this option is disabled, discount will be counted for every eligible product" msgstr "" +#: build/locale/src/staff/components/StaffStatus/StaffStatus.json +#. [src.staff.components.StaffStatus.2683780981] +#. defaultMessage is: +#. If you want to disable this account uncheck the box below +msgctxt "description" +msgid "If you want to disable this account uncheck the box below" +msgstr "" + #: build/locale/src/products/components/ProductVariantImageSelectDialog/ProductVariantImageSelectDialog.json #. [src.products.components.ProductVariantImageSelectDialog.3196043669] - dialog header #. defaultMessage is: @@ -2919,6 +3023,14 @@ msgctxt "section header" msgid "Images" msgstr "" +#: build/locale/src/staff/components/StaffList/StaffList.json +#. [src.staff.components.StaffList.1004218338] - staff member status +#. defaultMessage is: +#. Inactive +msgctxt "staff member status" +msgid "Inactive" +msgstr "" + #: build/locale/src/products/components/ProductStock/ProductStock.json #. [productStockHeader] - product stock, section header #. defaultMessage is: @@ -3323,6 +3435,14 @@ msgctxt "shipping zone" msgid "Name" msgstr "" +#: build/locale/src/staff/components/StaffList/StaffList.json +#. [src.staff.components.StaffList.636461959] - staff member full name +#. defaultMessage is: +#. Name +msgctxt "staff member full name" +msgid "Name" +msgstr "" + #: build/locale/src/siteSettings/components/SiteSettingsDetails/SiteSettingsDetails.json #. [src.siteSettings.components.SiteSettingsDetails.2286355060] #. defaultMessage is: @@ -3591,6 +3711,14 @@ msgctxt "description" msgid "No shipping zones found" msgstr "" +#: build/locale/src/staff/components/StaffList/StaffList.json +#. [src.staff.components.StaffList.480166346] +#. defaultMessage is: +#. No staff members found +msgctxt "description" +msgid "No staff members found" +msgstr "" + #: build/locale/src/categories/components/CategoryList/CategoryList.json #. [src.categories.components.CategoryList.2155313053] #. defaultMessage is: @@ -4103,6 +4231,22 @@ msgctxt "voucher discount type" msgid "Percentage" msgstr "" +#: build/locale/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.json +#. [src.staff.components.StaffAddMemberDialog.2690176844] +#. defaultMessage is: +#. Permissions +msgctxt "description" +msgid "Permissions" +msgstr "" + +#: build/locale/src/staff/components/StaffPermissions/StaffPermissions.json +#. [src.staff.components.StaffPermissions.2690176844] - dialog header +#. defaultMessage is: +#. Permissions +msgctxt "dialog header" +msgid "Permissions" +msgstr "" + #: build/locale/src/siteSettings/components/SiteSettingsAddress/SiteSettingsAddress.json #. [src.siteSettings.components.SiteSettingsAddress.1271289966] #. defaultMessage is: @@ -4947,6 +5091,14 @@ msgctxt "description" msgid "Selling price override" msgstr "" +#: build/locale/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.json +#. [src.staff.components.StaffAddMemberDialog.449055697] - button +#. defaultMessage is: +#. Send invite +msgctxt "button" +msgid "Send invite" +msgstr "" + #: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json #. [src.customers.components.CustomerAddress.3096438859] - button #. defaultMessage is: @@ -5159,6 +5311,14 @@ msgctxt "description" msgid "Specific Price" msgstr "" +#: build/locale/src/staff/components/StaffProperties/StaffProperties.json +#. [src.staff.components.StaffProperties.2650522200] - section header +#. defaultMessage is: +#. Staff Member Information +msgctxt "section header" +msgid "Staff Member Information" +msgstr "" + #: build/locale/src/intl.json #. [src.staff] - staff section name #. defaultMessage is: @@ -6035,6 +6195,30 @@ msgctxt "check to mark this account as active" msgid "User account active" msgstr "" +#: build/locale/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.json +#. [src.staff.components.StaffAddMemberDialog.1570990296] +#. defaultMessage is: +#. User has full access +msgctxt "description" +msgid "User has full access" +msgstr "" + +#: build/locale/src/staff/components/StaffPermissions/StaffPermissions.json +#. [src.staff.components.StaffPermissions.1848599267] - checkbox label +#. defaultMessage is: +#. User has full access to the store +msgctxt "checkbox label" +msgid "User has full access to the store" +msgstr "" + +#: build/locale/src/staff/components/StaffStatus/StaffStatus.json +#. [src.staff.components.StaffStatus.881953347] - checkbox label +#. defaultMessage is: +#. User is active +msgctxt "checkbox label" +msgid "User is active" +msgstr "" + #: build/locale/src/discounts/components/VoucherList/VoucherList.json #. [src.discounts.components.VoucherList.3917820600] - voucher uses #. defaultMessage is: @@ -6351,6 +6535,14 @@ msgctxt "product status is set as" msgid "is set as" msgstr "" +#: build/locale/src/staff/views/StaffDetails.json +#. [src.staff.views.2240444792] - dialog header +#. defaultMessage is: +#. remove Staff User +msgctxt "dialog header" +msgid "remove Staff User" +msgstr "" + #: build/locale/src/home/components/HomeProductListCard/HomeProductListCard.json #. [homeProductListCardOrders] - number of ordered products #. defaultMessage is: diff --git a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx index f4d218a5b..a7cce0e80 100644 --- a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx +++ b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx @@ -12,6 +12,7 @@ import { import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ConfirmButton, { ConfirmButtonTransitionState @@ -19,7 +20,7 @@ import ConfirmButton, { import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox"; import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; -import i18n from "../../../i18n"; +import { buttonMessages, commonMessages } from "@saleor/intl"; import { UserError } from "../../../types"; export interface FormData { @@ -74,81 +75,93 @@ const StaffAddMemberDialog = withStyles(styles, { open, onClose, onConfirm - }: StaffAddMemberDialogProps) => ( - -
- {({ change, data, errors: formErrors, hasChanged }) => ( - <> - {i18n.t("Add Staff Member")} - -
+ }: StaffAddMemberDialogProps) => { + const intl = useIntl(); + + return ( + + + {({ change, data, errors: formErrors, hasChanged }) => ( + <> + + + + +
+ + +
+ - +
+ + + + + + + + -
- - -
-
- - - {i18n.t("Permissions")} - - - {i18n.t( - "Expand or restrict user’s permissions to access certain part of saleor system." - )} - - - - - - - {i18n.t("Send invite", { context: "button" })} - - - - )} -
-
- ) + + + + + + + + + )} + + + ); + } ); StaffAddMemberDialog.displayName = "StaffAddMemberDialog"; export default StaffAddMemberDialog; diff --git a/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx b/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx index a104b703b..66c67179f 100644 --- a/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx +++ b/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import CardSpacer from "@saleor/components/CardSpacer"; @@ -8,7 +9,7 @@ import Form from "@saleor/components/Form"; import Grid from "@saleor/components/Grid"; import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; -import i18n from "../../../i18n"; +import { sectionNames } from "@saleor/intl"; import { getUserName, maybe } from "../../../misc"; import { PermissionEnum } from "../../../types/globalTypes"; import { @@ -57,6 +58,8 @@ const StaffDetailsPage: React.StatelessComponent = ({ onImageUpload, onSubmit }: StaffDetailsPageProps) => { + const intl = useIntl(); + const initialForm: FormData = { email: maybe(() => staffMember.email, ""), firstName: maybe(() => staffMember.firstName, ""), @@ -78,7 +81,9 @@ const StaffDetailsPage: React.StatelessComponent = ({
{({ data, change, hasChanged, submit }) => ( - {i18n.t("Staff Members")} + + {intl.formatMessage(sectionNames.staff)} +
diff --git a/src/staff/components/StaffList/StaffList.tsx b/src/staff/components/StaffList/StaffList.tsx index a3c67c56a..eeefb9f97 100644 --- a/src/staff/components/StaffList/StaffList.tsx +++ b/src/staff/components/StaffList/StaffList.tsx @@ -14,10 +14,10 @@ import TableRow from "@material-ui/core/TableRow"; import Typography from "@material-ui/core/Typography"; import classNames from "classnames"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Skeleton from "@saleor/components/Skeleton"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "@saleor/i18n"; import { getUserInitials, getUserName, @@ -80,97 +80,114 @@ const StaffList = withStyles(styles, { name: "StaffList" })( onRowClick, pageInfo, staffMembers - }: StaffListProps) => ( - - - - - - {i18n.t("Name", { context: "object" })} - - - {i18n.t("Email Address", { context: "object" })} - - - - - - - - - - {renderCollection( - staffMembers, - staffMember => ( - - -
- {maybe(() => staffMember.avatar.url) ? ( - staffMember.avatar.url)} - /> - ) : ( -
- {getUserInitials(staffMember)} -
- )} -
- - {getUserName(staffMember) || } - - + }: StaffListProps) => { + const intl = useIntl(); + + return ( + +
+ + + + + + + + + + + + + + + + + {renderCollection( + staffMembers, + staffMember => ( + + +
+ {maybe(() => staffMember.avatar.url) ? ( + staffMember.avatar.url)} + /> + ) : ( +
+ + {getUserInitials(staffMember)} + +
+ )} +
+ + {getUserName(staffMember) || } + + + {maybe( + () => + staffMember.isActive + ? intl.formatMessage({ + defaultMessage: "Active", + description: "staff member status" + }) + : intl.formatMessage({ + defaultMessage: "Inactive", + description: "staff member status" + }), + + )} + +
+ {maybe( - () => - staffMember.isActive - ? i18n.t("Active", { context: "status" }) - : i18n.t("Inactive", { context: "status" }), + () => staffMember.email, )} - - - - {maybe( - () => staffMember.email, - - )} - -
- ), - () => ( - - - {i18n.t("No staff members found")} - - - ) - )} -
-
-
- ) + + + ), + () => ( + + + + + + ) + )} + + + + ); + } ); StaffList.displayName = "StaffList"; export default StaffList; diff --git a/src/staff/components/StaffListPage/StaffListPage.tsx b/src/staff/components/StaffListPage/StaffListPage.tsx index 73ebd20e0..04e251d8b 100644 --- a/src/staff/components/StaffListPage/StaffListPage.tsx +++ b/src/staff/components/StaffListPage/StaffListPage.tsx @@ -1,11 +1,12 @@ import Button from "@material-ui/core/Button"; import AddIcon from "@material-ui/icons/Add"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import { Container } from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; -import i18n from "@saleor/i18n"; +import { sectionNames } from "@saleor/intl"; import { ListProps } from "@saleor/types"; import { StaffList_staffUsers_edges_node } from "../../types/StaffList"; import StaffList from "../StaffList/StaffList"; @@ -21,22 +22,31 @@ const StaffListPage: React.StatelessComponent = ({ onAdd, onBack, ...listProps -}) => ( - - {i18n.t("Configuration")} - - - - - -); +}) => { + const intl = useIntl(); + + return ( + + + {intl.formatMessage(sectionNames.configuration)} + + + + + + + ); +}; StaffListPage.displayName = "StaffListPage"; export default StaffListPage; diff --git a/src/staff/components/StaffPermissions/StaffPermissions.tsx b/src/staff/components/StaffPermissions/StaffPermissions.tsx index aea41e7bb..0db9cb39e 100644 --- a/src/staff/components/StaffPermissions/StaffPermissions.tsx +++ b/src/staff/components/StaffPermissions/StaffPermissions.tsx @@ -8,11 +8,11 @@ import { } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox"; import Skeleton from "@saleor/components/Skeleton"; -import i18n from "../../../i18n"; import { StaffMemberDetails_shop_permissions } from "../../types/StaffMemberDetails"; const styles = (theme: Theme) => @@ -47,6 +47,8 @@ const StaffPermissions = withStyles(styles, { name: "StaffPermissions" })( permissions, onChange }: StaffPermissionsProps) => { + const intl = useIntl(); + const handleFullAccessChange = (event: React.ChangeEvent) => onChange(event, () => onChange({ @@ -68,19 +70,23 @@ const StaffPermissions = withStyles(styles, { name: "StaffPermissions" })( }; return ( - + - {i18n.t( - "Expand or restrict user's permissions to access certain part of saleor system." - )} +
{ + const intl = useIntl(); const imgInputAnchor = React.createRef(); + const clickImgInput = () => imgInputAnchor.current.click(); + return ( - +
@@ -143,10 +152,16 @@ const StaffProperties = withStyles(styles, { name: "StaffProperties" })(
- {i18n.t("Change photo")} + - {i18n.t("Delete photo")} +
= ({ data, disabled, onChange -}) => ( - - - - - {i18n.t("If you want to disable this account uncheck the box below")} - - { + const intl = useIntl(); + + return ( + + - - -); + + + + + + + + ); +}; StaffStatus.displayName = "StaffStatus"; export default StaffStatus; diff --git a/src/staff/index.tsx b/src/staff/index.tsx index 66dea74b0..84470608f 100644 --- a/src/staff/index.tsx +++ b/src/staff/index.tsx @@ -1,9 +1,10 @@ import { parse as parseQs } from "qs"; import React from "react"; +import { useIntl } from "react-intl"; import { Route, RouteComponentProps, Switch } from "react-router-dom"; +import { sectionNames } from "@saleor/intl"; import { WindowTitle } from "../components/WindowTitle"; -import i18n from "../i18n"; import { staffListPath, StaffListUrlQueryParams, @@ -38,14 +39,18 @@ const StaffDetails: React.StatelessComponent< ); }; -const Component = () => ( - <> - - - - - - -); +const Component = () => { + const intl = useIntl(); + + return ( + <> + + + + + + + ); +}; export default Component; diff --git a/src/staff/views/StaffDetails.tsx b/src/staff/views/StaffDetails.tsx index e71e67f9a..2ae48ba1b 100644 --- a/src/staff/views/StaffDetails.tsx +++ b/src/staff/views/StaffDetails.tsx @@ -1,12 +1,13 @@ import DialogContentText from "@material-ui/core/DialogContentText"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import { WindowTitle } from "@saleor/components/WindowTitle"; import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import useUser from "@saleor/hooks/useUser"; -import i18n from "../../i18n"; +import { commonMessages } from "@saleor/intl"; import { getMutationState, maybe } from "../../misc"; import StaffDetailsPage from "../components/StaffDetailsPage/StaffDetailsPage"; import { @@ -38,6 +39,7 @@ export const StaffDetails: React.StatelessComponent = ({ const navigate = useNavigator(); const notify = useNotifier(); const user = useUser(); + const intl = useIntl(); return ( = ({ const handleStaffMemberUpdate = (data: StaffMemberUpdate) => { if (!maybe(() => data.staffUpdate.errors.length !== 0)) { notify({ - text: i18n.t("Succesfully updated staff member account") + text: intl.formatMessage(commonMessages.savedChanges) }); } }; const handleStaffMemberDelete = (data: StaffMemberDelete) => { if (!maybe(() => data.staffDelete.errors.length !== 0)) { notify({ - text: i18n.t("Succesfully removed staff member") + text: intl.formatMessage(commonMessages.savedChanges) }); navigate(staffListUrl()); } @@ -64,14 +66,14 @@ export const StaffDetails: React.StatelessComponent = ({ const handleStaffMemberAvatarUpdate = (data: StaffAvatarUpdate) => { if (!maybe(() => data.userAvatarUpdate.errors.length !== 0)) { notify({ - text: i18n.t("Succesfully updated staff member avatar") + text: intl.formatMessage(commonMessages.savedChanges) }); } }; const handleStaffMemberAvatarDelete = (data: StaffAvatarDelete) => { if (!maybe(() => data.userAvatarDelete.errors.length !== 0)) { notify({ - text: i18n.t("Succesfully removed staff member avatar") + text: intl.formatMessage(commonMessages.savedChanges) }); navigate(staffMemberDetailsUrl(id)); } @@ -167,7 +169,10 @@ export const StaffDetails: React.StatelessComponent = ({ /> @@ -175,20 +180,21 @@ export const StaffDetails: React.StatelessComponent = ({ } onConfirm={deleteStaffMember} > - {{ email }} from staff members?", - { - email: maybe(() => data.user.email) - } - ) - }} - /> + + data.user.email, "...") + }} + /> + @@ -196,16 +202,18 @@ export const StaffDetails: React.StatelessComponent = ({ } onConfirm={deleteStaffAvatar} > - {{ email }} avatar?", - { - email: maybe(() => data.user.email) - } - ) - }} - /> + + + {maybe(() => data.user.email, "...")} + + ) + }} + /> + ); diff --git a/src/staff/views/StaffList.tsx b/src/staff/views/StaffList.tsx index a730d8695..0cc4ad33e 100644 --- a/src/staff/views/StaffList.tsx +++ b/src/staff/views/StaffList.tsx @@ -6,9 +6,10 @@ import useNotifier from "@saleor/hooks/useNotifier"; import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; +import { useIntl } from "react-intl"; import { configurationMenuUrl } from "@saleor/configuration"; -import i18n from "@saleor/i18n"; +import { commonMessages } from "@saleor/intl"; import { getMutationState, maybe } from "@saleor/misc"; import { ListViews } from "@saleor/types"; import StaffAddMemberDialog, { @@ -37,6 +38,7 @@ export const StaffList: React.StatelessComponent = ({ const { updateListSettings, settings } = useListSettings( ListViews.STAFF_MEMBERS_LIST ); + const intl = useIntl(); const closeModal = () => navigate( @@ -55,7 +57,7 @@ export const StaffList: React.StatelessComponent = ({ const handleStaffMemberAddSuccess = (data: StaffMemberAdd) => { if (data.staffCreate.errors.length === 0) { notify({ - text: i18n.t("Succesfully added staff member") + text: intl.formatMessage(commonMessages.savedChanges) }); navigate(staffMemberDetailsUrl(data.staffCreate.user.id)); }