PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 6.3.1
Pay with Vipps and MobilePay for WooCommerce v6.3.1
6.3.1 6.2.6 6.3.0 6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 6.2.0 6.1.10 6.1.9 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1.0 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 All 190 releases
woo-vipps / payment / Blocks / dist / vipps-badge / index.js

index.js in Pay with Vipps and MobilePay for WooCommerce 6.3.1, at payment/Blocks/dist/vipps-badge/index.js

1 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";const e=window.wp.blocks,a=window.wp.i18n,n=window.wp.blockEditor,s=window.wp.components,t=window.ReactJSXRuntime,l=injectedVippsBadgeBlockConfig,i=injectedVippsBadgeBlockConfig,o=JSON.parse('{"UU":"woo-vipps/vipps-badge"}'),r=injectedVippsBadgeBlockConfig;(0,e.registerBlockType)(o.UU,{title:r.title,icon:(0,t.jsx)("img",{className:"block-editor-block-icon has-colors vipps-smile vipps-component-icon",src:r.iconSrc,alt:r.title+" icon"}),attributes:{variant:{default:r.defaultVariant},language:{default:r.defaultLanguage}},edit:function({attributes:e,setAttributes:i}){const o=l.variants,r=e.variant;let p=!1;for(let e=0;e<o.length;e++)if(r==o[e].value){p=!0;break}p||o.push({label:r,value:r});const c={variant:r,language:"dk"===e.language?"da":e.language,brand:l.brand};let d=e.className&&"undefined"!==e.className?e.className:"";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...(0,n.useBlockProps)({className:"vipps-badge-wrapper "+d}),children:(0,t.jsx)("vipps-mobilepay-badge",{...c})}),(0,t.jsx)(n.InspectorControls,{children:(0,t.jsxs)(s.PanelBody,{children:[(0,t.jsx)(s.SelectControl,{onChange:e=>i({variant:e}),label:(0,a.__)("Variant","woo-vipps"),value:e.variant,options:o,help:(0,a.__)("Choose the badge variant with the perfect colors for your site","woo-vipps")}),(0,t.jsx)(s.SelectControl,{onChange:e=>i({language:e}),label:(0,a.__)("Language","woo-vipps"),value:e.language,options:l.languages,help:(0,a.__)("Choose language, or use the default","woo-vipps")})]})})]})},save:function({attributes:e}){const a=i.variants,s=e.variant;let l=!1;for(let e=0;e<a.length;e++)if(s==a[e].value){l=!0;break}l||a.push({label:s,value:s});const o={variant:s,language:"dk"===e.language?"da":e.language,brand:i.brand};let r=e.className&&"undefined"!==e.className?e.className:"";return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{...n.useBlockProps.save({className:"vipps-badge-wrapper "+r}),children:(0,t.jsx)("vipps-mobilepay-badge",{...o})})})}})})();