UNPKG

@shopgate/engage

Version:
3 lines 1.44 kB
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}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} */var GlobalLocationSwitcherBar=function GlobalLocationSwitcherBar(_ref){var locationName=_ref.locationName,handleChange=_ref.handleChange,standalone=_ref.standalone;return React.createElement("div",{className:wrapper},React.createElement("div",{className:classNames(inner,_defineProperty({},innerStandalone,standalone))},React.createElement("span",{"aria-label":"".concat(i18n.text('locations.your_current_location.heading'),": ").concat(locationName)},React.createElement("span",{className:heading},"".concat(i18n.text('locations.your_current_location.heading'),":")),React.createElement("span",{className:name},locationName)),React.createElement(RippleButton,{onClick:handleChange,type:"secondary",className:button,"aria-haspopup":true,flat:true},React.createElement(I18n.Text,{string:"locations.your_current_location.change"}))));};GlobalLocationSwitcherBar.defaultProps={standalone:false};export default GlobalLocationSwitcherBar;