@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 1.53 kB
JavaScript
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{responsiveMediaQuery}from'@shopgate/engage/styles';import{css}from'glamor';import{useCheckoutContext}from"../../hooks/common";var styles={root:css(_defineProperty(_defineProperty(_defineProperty(_defineProperty({outline:'none',border:'1px solid rgba(0, 0, 0, 0.12)',borderRadius:4,background:'#fff',height:52,width:160,display:'flex',flexDirection:'row',justifyContent:'center',alignItems:'center'},responsiveMediaQuery('xs'),{width:'50%'}),'&:not(:last-child)',{borderTopRightRadius:0,borderBottomRightRadius:0}),'&:not(:first-child)',{borderLeft:'none',borderTopLeftRadius:0,borderBottomLeftRadius:0}),'&:hover',{background:'rgba(0, 0, 0, 0.05)'})).toString(),active:css({background:'rgba(0, 0, 0, 0.12)','&:hover':{background:'rgba(0, 0, 0, 0.12)'}}).toString()};/**
* Payment Button
* @param {Object} props Props
* @returns {JSX}
*/var PaymentMethodButton=function PaymentMethodButton(_ref){var children=_ref.children,active=_ref.active,onChange=_ref.onChange;var _useCheckoutContext=useCheckoutContext(),isLocked=_useCheckoutContext.isLocked;return React.createElement("button",{type:"button",disabled:isLocked,className:"".concat(styles.root," ").concat(active&&styles.active),onClick:function onClick(){return onChange();}},children);};export default PaymentMethodButton;