@shopgate/engage
Version:
Shopgate's ENGAGE library.
46 lines (45 loc) • 1.47 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { RippleButton, I18n } from '@shopgate/engage/components';
import { i18n } from '@shopgate/engage/core';
import { wrapper, inner, innerStandalone, heading, name, button } from "./GlobalLocationSwitcherBar.style";
/**
* @returns {JSX.Element}
*/
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const GlobalLocationSwitcherBar = ({
locationName,
handleChange,
standalone
}) => /*#__PURE__*/_jsx("div", {
className: wrapper,
children: /*#__PURE__*/_jsxs("div", {
className: classNames(inner, {
[innerStandalone]: standalone
}),
children: [/*#__PURE__*/_jsxs("span", {
"aria-label": `${i18n.text('locations.your_current_location.heading')}: ${locationName}`,
children: [/*#__PURE__*/_jsx("span", {
className: heading,
children: `${i18n.text('locations.your_current_location.heading')}:`
}), /*#__PURE__*/_jsx("span", {
className: name,
children: locationName
})]
}), /*#__PURE__*/_jsx(RippleButton, {
onClick: handleChange,
type: "secondary",
className: button,
"aria-haspopup": true,
flat: true,
children: /*#__PURE__*/_jsx(I18n.Text, {
string: "locations.your_current_location.change"
})
})]
})
});
GlobalLocationSwitcherBar.defaultProps = {
standalone: false
};
export default GlobalLocationSwitcherBar;