@sonic-equipment/ui 215.0.0 → 216.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/header/buttons/account/connected-account-button.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.js +2 -2
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +3 -1
- package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.js +4 -2
- package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.d.ts +1 -1
- package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.js +3 -3
- package/dist/pages/my-sonic/pages/create-ship-to-address-details-page/create-ship-to-address-details-page.js +2 -2
- package/dist/pages/my-sonic/pages/edit-bill-to-address-details-page/edit-bill-to-address-details-page.js +2 -2
- package/dist/pages/my-sonic/pages/edit-ship-to-address-details-page/edit-ship-to-address-details-page.js +2 -2
- package/dist/pages/my-sonic/pages/favorites/favorites-page.js +1 -1
- package/dist/pages/my-sonic/pages/my-account/my-account-page.js +2 -2
- package/dist/pages/my-sonic/pages/order-details/order-details-content.js +2 -2
- package/dist/pages/my-sonic/pages/order-details/order-details-page.d.ts +4 -1
- package/dist/pages/my-sonic/pages/order-details/order-details-page.js +22 -3
- package/dist/pages/my-sonic/pages/order-history/order-history-page.js +1 -1
- package/dist/shared/routing/types.d.ts +1 -1
- package/dist/styles.css +1 -0
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ function ConnectedAccountButton({ className, 'data-test-selector': dataTestSelec
|
|
|
13
13
|
const isAuthenticated = useIsAuthenticated();
|
|
14
14
|
const { href } = useLocation();
|
|
15
15
|
return (jsx(IconButton, { className: className, "data-authenticated": isAuthenticated ? true : false, "data-test-selector": dataTestSelector, href: isAuthenticated
|
|
16
|
-
? paths.
|
|
16
|
+
? paths.MY_SONIC
|
|
17
17
|
: `${paths.SIGN_IN}${href ? `?returnUrl=${encodeURIComponent(href)}` : ''}`, isDisabled: isAuthenticated === undefined, onClick: onClick, children: jsx(AccountIcon, { "aria-label": isAuthenticated ? t('My Sonic') : t('Sign in or create account'), isAuthenticated: isAuthenticated }) }));
|
|
18
18
|
}
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -280,7 +280,7 @@ export { EditShipToAddressDetailsPage, EditShipToAddressDetailsPageBreadcrumb }
|
|
|
280
280
|
export { FavoritesPage, FavoritesPageBreadcrumb } from './pages/my-sonic/pages/favorites/favorites-page.js';
|
|
281
281
|
export { MyAccountPage, MyAccountPageBreadcrumb } from './pages/my-sonic/pages/my-account/my-account-page.js';
|
|
282
282
|
export { OrderDetailsContent, statusMap } from './pages/my-sonic/pages/order-details/order-details-content.js';
|
|
283
|
-
export {
|
|
283
|
+
export { OrderDetailsPage, OrderDetailsPageBreadcrumb } from './pages/my-sonic/pages/order-details/order-details-page.js';
|
|
284
284
|
export { OrderHistoryPage, OrderHistoryPageBreadcrumb } from './pages/my-sonic/pages/order-history/order-history-page.js';
|
|
285
285
|
export { AddressDataCard } from './pages/my-sonic/widgets/components/address-data-card.js';
|
|
286
286
|
export { ConnectedAddressBookWidget } from './pages/my-sonic/widgets/connected-address-book-widget.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order details' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
@@ -12,7 +12,7 @@ import styles from './connected-my-sonic-navigation.module.css.js';
|
|
|
12
12
|
|
|
13
13
|
function ConnectedMySonicNavigation() {
|
|
14
14
|
const paths = usePaths();
|
|
15
|
-
const {
|
|
15
|
+
const { fullPathname } = useLocation();
|
|
16
16
|
const { navigate } = useNavigate();
|
|
17
17
|
const { mutate } = useSignOut({
|
|
18
18
|
onError: logger.error,
|
|
@@ -22,7 +22,7 @@ function ConnectedMySonicNavigation() {
|
|
|
22
22
|
navigate(paths.HOME, { reload: true });
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
-
return (jsxs("div", { style: { display: 'grid' }, children: [jsx(MySonicDesktopNavigation, { className: styles['large'], currentPath:
|
|
25
|
+
return (jsxs("div", { style: { display: 'grid' }, children: [jsx(MySonicDesktopNavigation, { className: styles['large'], currentPath: fullPathname, onLogout: mutate }), jsx(MySonicMobileNavigation, { className: styles['small'], currentPath: fullPathname, onLogout: mutate })] }));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { ConnectedMySonicNavigation };
|
|
@@ -3,18 +3,20 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { FormattedMessage } from '../../../intl/formatted-message.js';
|
|
4
4
|
import { MenuList } from '../../../lists/menu-list/menu-list.js';
|
|
5
5
|
import { MenuListItem } from '../../../lists/menu-list/menu-list-item.js';
|
|
6
|
+
import { useLocation } from '../../../shared/routing/use-location.js';
|
|
6
7
|
import { useMySonicNavigationItems } from './my-sonic-navigation-items.js';
|
|
7
8
|
import styles from './my-sonic-desktop-navigation.module.css.js';
|
|
8
9
|
|
|
9
10
|
function MySonicDesktopNavigation({ className, currentPath, onLogout, }) {
|
|
10
11
|
const mySonicNavigationItems = useMySonicNavigationItems();
|
|
12
|
+
const { basePathname } = useLocation();
|
|
11
13
|
return (jsx(MenuList, { collapsible: true, className: className, children: mySonicNavigationItems.map(item => (jsx(MenuListItem, { badge: jsx(item.Icon, {}), ...(item.type === 'action'
|
|
12
14
|
? item.action === 'logout'
|
|
13
15
|
? { onClick: onLogout }
|
|
14
16
|
: {}
|
|
15
17
|
: {
|
|
16
18
|
href: item.path,
|
|
17
|
-
isSelected: currentPath
|
|
19
|
+
isSelected: currentPath === `${basePathname}${item.path}`,
|
|
18
20
|
}), children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: item.label }) }) }, item.label))) }));
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Select } from '../../../forms/elements/select/select.js';
|
|
4
4
|
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
5
|
+
import { useLocation } from '../../../shared/routing/use-location.js';
|
|
5
6
|
import { useNavigate } from '../../../shared/routing/use-navigate.js';
|
|
6
7
|
import { useMySonicNavigationItems } from './my-sonic-navigation-items.js';
|
|
7
8
|
|
|
8
9
|
function MySonicMobileNavigation({ className, currentPath, onLogout, }) {
|
|
9
10
|
const mySonicNavigationItems = useMySonicNavigationItems();
|
|
11
|
+
const { basePathname } = useLocation();
|
|
10
12
|
const { navigate } = useNavigate();
|
|
11
13
|
const t = useFormattedMessage();
|
|
12
14
|
return (jsx(Select, { className: className, label: t('Navigate to...'), onChange: option => {
|
|
@@ -16,9 +18,9 @@ function MySonicMobileNavigation({ className, currentPath, onLogout, }) {
|
|
|
16
18
|
}, options: mySonicNavigationItems.reduce((options, item) => ({
|
|
17
19
|
...options,
|
|
18
20
|
...(item.type === 'link'
|
|
19
|
-
? { [item.path]: t(item.label) }
|
|
21
|
+
? { [`${basePathname}${item.path}`]: t(item.label) }
|
|
20
22
|
: { [item.action]: t(item.label) }),
|
|
21
|
-
}), {}), selectedOption: currentPath
|
|
23
|
+
}), {}), selectedOption: currentPath }));
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export { MySonicMobileNavigation };
|
|
@@ -6,7 +6,7 @@ interface MySonicNavigationItemBase {
|
|
|
6
6
|
type: 'link' | 'action';
|
|
7
7
|
}
|
|
8
8
|
interface MySonicNavigationLink extends MySonicNavigationItemBase {
|
|
9
|
-
path:
|
|
9
|
+
path: string;
|
|
10
10
|
type: 'link';
|
|
11
11
|
}
|
|
12
12
|
interface MySonicNavigationAction extends MySonicNavigationItemBase {
|
|
@@ -11,19 +11,19 @@ function useMySonicNavigationItems() {
|
|
|
11
11
|
{
|
|
12
12
|
Icon: SolidLoginIcon,
|
|
13
13
|
label: 'Account',
|
|
14
|
-
path: paths.
|
|
14
|
+
path: paths.ACCOUNT,
|
|
15
15
|
type: 'link',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
Icon: SolidFavoriteIcon,
|
|
19
19
|
label: 'Favorites',
|
|
20
|
-
path: paths.ACCOUNT_MY_LISTS
|
|
20
|
+
path: paths.ACCOUNT_MY_LISTS,
|
|
21
21
|
type: 'link',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
Icon: SolidCartIcon,
|
|
25
25
|
label: 'Orders',
|
|
26
|
-
path: paths.ACCOUNT_ORDERS
|
|
26
|
+
path: paths.ACCOUNT_ORDERS,
|
|
27
27
|
type: 'link',
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -17,8 +17,8 @@ function CreateShipToAddressDetailsPageBreadcrumb({ billToId, }) {
|
|
|
17
17
|
const paths = usePaths();
|
|
18
18
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
19
19
|
{ href: paths.HOME, label: t('Home') },
|
|
20
|
-
{ href: paths.
|
|
21
|
-
{ href: paths.
|
|
20
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
21
|
+
{ href: paths.ACCOUNT, label: t('Account') },
|
|
22
22
|
{
|
|
23
23
|
href: `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/new`,
|
|
24
24
|
label: t('Shipping address'),
|
|
@@ -17,8 +17,8 @@ function EditBillToAddressDetailsPageBreadcrumb({ billToId, }) {
|
|
|
17
17
|
const paths = usePaths();
|
|
18
18
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
19
19
|
{ href: paths.HOME, label: t('Home') },
|
|
20
|
-
{ href: paths.
|
|
21
|
-
{ href: paths.
|
|
20
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
21
|
+
{ href: paths.ACCOUNT, label: t('Account') },
|
|
22
22
|
{
|
|
23
23
|
href: `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}`,
|
|
24
24
|
label: t('Billing address'),
|
|
@@ -17,8 +17,8 @@ function EditShipToAddressDetailsPageBreadcrumb({ billToId, shipToId, }) {
|
|
|
17
17
|
const paths = usePaths();
|
|
18
18
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
19
19
|
{ href: paths.HOME, label: t('Home') },
|
|
20
|
-
{ href: paths.
|
|
21
|
-
{ href: paths.
|
|
20
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
21
|
+
{ href: paths.ACCOUNT, label: t('Account') },
|
|
22
22
|
{
|
|
23
23
|
href: `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/${shipToId}`,
|
|
24
24
|
label: t('Shipping address'),
|
|
@@ -15,7 +15,7 @@ function FavoritesPageBreadcrumb() {
|
|
|
15
15
|
const paths = usePaths();
|
|
16
16
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
17
17
|
{ href: paths.HOME, label: t('Home') },
|
|
18
|
-
{ href: paths.
|
|
18
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
19
19
|
{ href: paths.ACCOUNT_MY_LISTS, label: t('Favorites') },
|
|
20
20
|
] }) }));
|
|
21
21
|
}
|
|
@@ -22,8 +22,8 @@ function MyAccountPageBreadcrumb() {
|
|
|
22
22
|
const paths = usePaths();
|
|
23
23
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
24
24
|
{ href: paths.HOME, label: t('Home') },
|
|
25
|
-
{ href: paths.
|
|
26
|
-
{ href: paths.
|
|
25
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
26
|
+
{ href: paths.ACCOUNT, label: t('Account') },
|
|
27
27
|
] }) }));
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -49,7 +49,7 @@ const getOrderShipToAddress = (order) => ({
|
|
|
49
49
|
function OrderDetailsContent({ order, returnUrl, }) {
|
|
50
50
|
const paths = usePaths();
|
|
51
51
|
const status = statusMap[order.status];
|
|
52
|
-
return (jsxs("div", { className: styles['order-details'], children: [jsxs("section", { className: styles['order-header'], children: [jsxs("div", { className: styles['order-header-info'], children: [jsxs(Heading, { size: "xxs", tag: "h2", children: [jsx(FormattedMessage, { id: "Order" }), " #", order.webOrderNumber] }), jsxs("div", { children: [jsx(FormattedMessage, { id: "Status" }), ":", ' ', jsx(StatusText, { "data-test-selector": "order-status", status: status, children: jsx(FormattedMessage, { noTranslationId: true, id: `orderStatus.${order.status}` }) })] })] }), jsx(PrintButton, {
|
|
52
|
+
return (jsxs("div", { className: styles['order-details'], children: [jsxs("section", { className: styles['order-header'], children: [jsxs("div", { className: styles['order-header-info'], children: [jsxs(Heading, { size: "xxs", tag: "h2", children: [jsx(FormattedMessage, { id: "Order" }), " #", order.webOrderNumber] }), jsxs("div", { children: [jsx(FormattedMessage, { id: "Status" }), ":", ' ', jsx(StatusText, { "data-test-selector": "order-status", status: status, children: jsx(FormattedMessage, { noTranslationId: true, id: `orderStatus.${order.status}` }) })] })] }), jsx(PrintButton, {}), jsx(Button, { "data-test-selector": "reorder-button", children: jsx(FormattedMessage, { id: "Reorder" }) })] }), jsxs("section", { className: styles['order-additional-info'], children: [jsxs("dl", { children: [jsx("dt", { children: jsx(FormattedMessage, { id: "orderProperty.Date" }) }), jsx("dd", { children: jsx(FormattedDate, { date: order.orderDate }) })] }), jsxs("dl", { children: [jsx("dt", { children: jsx(FormattedMessage, { id: "orderProperty.PO Number" }) }), jsx("dd", { children: order.customerNumber })] })] }), jsx("section", { className: styles['order-billing-and-shipping'], children: jsx(BillingAndInvoiceInformation, { billToAddress: getOrderBillToAddress(order), shipToAddress: getOrderShipToAddress(order) }) }), jsx("section", { className: styles['order-top-button'], children: jsx(Button, { color: "secondary", href: returnUrl || paths.ACCOUNT_ORDERS, variant: "outline", children: jsx(FormattedMessage, { id: "Back" }) }) }), jsxs("section", { className: styles['order-line-list'], children: [jsx(Heading, { size: "xxs", tag: "h3", children: jsx(FormattedMessage, { id: "Products" }) }), jsx(OrderLineList, { children: order.orderLines?.map(line => (jsx(OrderLineCard, { isReadonly: true, href: line.productUri, image: {
|
|
53
53
|
fit: 'contain',
|
|
54
54
|
image: {
|
|
55
55
|
'1': line.mediumImagePath,
|
|
@@ -63,7 +63,7 @@ function OrderDetailsContent({ order, returnUrl, }) {
|
|
|
63
63
|
originalTotalPrice: ensureNumber(line.lineTotal),
|
|
64
64
|
pricePerUnit: line.unitPrice,
|
|
65
65
|
totalPrice: line.lineTotal,
|
|
66
|
-
}, productId: line.productId, quantity: line.qtyOrdered, sku: line.customerProductNumber, title: line.shortDescription }, line.id))) })] }), jsx("section", { className: styles['order-cost-overview'], children: jsx(CartTotals, { currencyCode: order.currencyCode, shippingCost: order.shippingAndHandling, subtotal: order.orderSubTotal, tax: order.taxAmount, total: order.orderTotal, vatPercentage: undefined }) }), jsx("section", { className: styles['order-bottom-button'], children: jsx(Button, { color: "secondary", href: returnUrl || paths.ACCOUNT_ORDERS,
|
|
66
|
+
}, productId: line.productId, quantity: line.qtyOrdered, sku: line.customerProductNumber, title: line.shortDescription }, line.id))) })] }), jsx("section", { className: styles['order-cost-overview'], children: jsx(CartTotals, { currencyCode: order.currencyCode, shippingCost: order.shippingAndHandling, subtotal: order.orderSubTotal, tax: order.taxAmount, total: order.orderTotal, vatPercentage: undefined }) }), jsx("section", { className: styles['order-bottom-button'], children: jsx(Button, { color: "secondary", href: returnUrl || paths.ACCOUNT_ORDERS, variant: "outline", children: jsx(FormattedMessage, { id: "Back" }) }) })] }));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export { OrderDetailsContent, statusMap };
|
|
@@ -2,4 +2,7 @@ export type OrderDetailsProps = {
|
|
|
2
2
|
orderId: string;
|
|
3
3
|
returnUrl?: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function OrderDetailsPage({ orderId, returnUrl }: OrderDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function OrderDetailsPageBreadcrumb({ orderId }: {
|
|
7
|
+
orderId: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Breadcrumb } from '../../../../breadcrumbs/breadcrumb.js';
|
|
4
|
+
import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
|
|
3
5
|
import { useFetchOrderById } from '../../../../shared/api/storefront/hooks/orders/use-fetch-order-by-id.js';
|
|
6
|
+
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
4
7
|
import { ErrorPage } from '../../../error-page/error-page.js';
|
|
5
8
|
import { LoadingPage } from '../../../loading-page/loading-page.js';
|
|
9
|
+
import { MySonicLayoutBreadcrumb } from '../../layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js';
|
|
10
|
+
import { MySonicLayoutPage } from '../../layouts/my-sonic-layout/my-sonic-layout-page.js';
|
|
6
11
|
import { OrderDetailsContent } from './order-details-content.js';
|
|
7
12
|
|
|
8
|
-
function
|
|
13
|
+
function OrderDetailsPage({ orderId, returnUrl }) {
|
|
9
14
|
const { data: order, error, isLoading } = useFetchOrderById(orderId);
|
|
15
|
+
const t = useFormattedMessage();
|
|
10
16
|
if (isLoading) {
|
|
11
17
|
return jsx(LoadingPage, {});
|
|
12
18
|
}
|
|
@@ -16,7 +22,20 @@ function OrderDetails({ orderId, returnUrl }) {
|
|
|
16
22
|
if (!order) {
|
|
17
23
|
return (jsx(ErrorPage, { error: new Error(`Order with ID ${orderId} not found. Please try again later.`) }));
|
|
18
24
|
}
|
|
19
|
-
return jsx(OrderDetailsContent, { order: order, returnUrl: returnUrl });
|
|
25
|
+
return (jsx(MySonicLayoutPage, { "data-test-selector": "order-history", title: t('Order details'), children: jsx(OrderDetailsContent, { order: order, returnUrl: returnUrl }) }));
|
|
26
|
+
}
|
|
27
|
+
function OrderDetailsPageBreadcrumb({ orderId }) {
|
|
28
|
+
const t = useFormattedMessage();
|
|
29
|
+
const paths = usePaths();
|
|
30
|
+
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
31
|
+
{ href: paths.HOME, label: t('Home') },
|
|
32
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
33
|
+
{ href: paths.ACCOUNT_ORDERS, label: t('Orders') },
|
|
34
|
+
{
|
|
35
|
+
href: `${paths.ACCOUNT_ORDERS}/${orderId}`,
|
|
36
|
+
label: t('Order details'),
|
|
37
|
+
},
|
|
38
|
+
] }) }));
|
|
20
39
|
}
|
|
21
40
|
|
|
22
|
-
export {
|
|
41
|
+
export { OrderDetailsPage, OrderDetailsPageBreadcrumb };
|
|
@@ -182,7 +182,7 @@ function OrderHistoryPageBreadcrumb() {
|
|
|
182
182
|
const paths = usePaths();
|
|
183
183
|
return (jsx(MySonicLayoutBreadcrumb, { children: jsx(Breadcrumb, { links: [
|
|
184
184
|
{ href: paths.HOME, label: t('Home') },
|
|
185
|
-
{ href: paths.
|
|
185
|
+
{ href: paths.MY_SONIC, label: t('My Sonic') },
|
|
186
186
|
{ href: paths.ACCOUNT_ORDERS, label: t('Orders') },
|
|
187
187
|
] }) }));
|
|
188
188
|
}
|
|
@@ -8,12 +8,12 @@ export interface Paths {
|
|
|
8
8
|
ACCOUNT_INVOICES: string;
|
|
9
9
|
ACCOUNT_MY_LISTS: string;
|
|
10
10
|
ACCOUNT_ORDERS: string;
|
|
11
|
-
ACCOUNT_SETTINGS: string;
|
|
12
11
|
CART: string;
|
|
13
12
|
CHECKOUT_SHIPPING: string;
|
|
14
13
|
CHECKOUT_SHIPPING_VIA_SIGNIN: string;
|
|
15
14
|
FAVORITES: string;
|
|
16
15
|
HOME: string;
|
|
16
|
+
MY_SONIC: string;
|
|
17
17
|
ORDER_CONFIRMATION: string;
|
|
18
18
|
REVIEW_AND_SUBMIT: string;
|
|
19
19
|
SIGN_IN: string;
|
package/dist/styles.css
CHANGED