@bikdotai/bik-component-library 0.0.566-webpush-beta0.5 → 0.0.566-webpush-beta0.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../models/WebpushTemplate.js"),s=require("./WebpushPreview.styled.js");exports.default=t=>{let{template:n}=t;var l,a,E,O,P,r
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../models/WebpushTemplate.js"),s=require("./WebpushPreview.styled.js");exports.default=t=>{let{template:n}=t;var l,a,E,O,P,c,r;const{components:_,webpushBroadcastConfig:o}=n,N="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F4daae031-3902-4e58-a57c-32f29ea90812?alt=media&token=a7655ba9-6843-47df-91ba-422345e925c3",T=(e,i)=>{let s=0;return e?e.replace(/{{(.*?)}}/g,((e,t)=>{const n=t.trim();if(i&&i.length&&s<i.length){const e=i[s];return s++,e}return`{{${n}}}`})):""},d=T(_[i.WEB_PUSH_COMPONENT_TYPE.TITLE],null==o?void 0:o.title),u=T(null!==(E=null!==(a=null===(l=_[i.WEB_PUSH_COMPONENT_TYPE.BODY])||void 0===l?void 0:l.text)&&void 0!==a?a:_[i.WEB_PUSH_COMPONENT_TYPE.BODY])&&void 0!==E?E:"",null==o?void 0:o.body);return e.jsxs(s.WebpushPreviewContainer,{children:[e.jsxs("div",Object.assign({className:"icon--header"},{children:[e.jsx("div",Object.assign({className:"icon-img-container"},{children:e.jsx("img",{src:(null===(O=null==o?void 0:o[i.WEB_PUSH_COMPONENT_TYPE.ICON])||void 0===O?void 0:O.length)?o[i.WEB_PUSH_COMPONENT_TYPE.ICON][0]:null!==(P=_[i.WEB_PUSH_COMPONENT_TYPE.ICON])&&void 0!==P?P:N,alt:"icon-image"})})),e.jsxs("div",Object.assign({className:"text--container"},{children:[e.jsx("div",{children:d}),e.jsx("div",Object.assign({style:{marginTop:3}},{children:u}))]}))]})),_[i.WEB_PUSH_COMPONENT_TYPE.IMAGE]&&_[i.WEB_PUSH_COMPONENT_TYPE.IMAGE].length&&e.jsx("div",Object.assign({className:"banner-img-container"},{children:e.jsx("img",{src:(null===(c=null==o?void 0:o[i.WEB_PUSH_COMPONENT_TYPE.IMAGE])||void 0===c?void 0:c.length)?o[i.WEB_PUSH_COMPONENT_TYPE.IMAGE][0]:null!==(r=_[i.WEB_PUSH_COMPONENT_TYPE.IMAGE])&&void 0!==r?r:N,alt:"icon-image"})})),_[i.WEB_PUSH_COMPONENT_TYPE.BUTTONS]&&_[i.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length&&e.jsx("div",Object.assign({className:"button-container "+(1===_[i.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length?"single-button":"")},{children:_[i.WEB_PUSH_COMPONENT_TYPE.BUTTONS].map(((s,t)=>e.jsx("div",Object.assign({className:"each--btn",style:{flex:1===_[i.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length?"0 0 50%":"1"}},{children:e.jsx("div",Object.assign({className:"text-btn"},{children:s.text}))}),`webpush-buttons-${t}`)))}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{WEB_PUSH_COMPONENT_TYPE as t}from"../models/WebpushTemplate.js";import{WebpushPreviewContainer as n}from"./WebpushPreview.styled.js";const l=l=>{let{template:
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{WEB_PUSH_COMPONENT_TYPE as t}from"../models/WebpushTemplate.js";import{WebpushPreviewContainer as n}from"./WebpushPreview.styled.js";const l=l=>{let{template:a}=l;var s,o,c,d,r,m,g;const{components:h,webpushBroadcastConfig:v}=a,u="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F4daae031-3902-4e58-a57c-32f29ea90812?alt=media&token=a7655ba9-6843-47df-91ba-422345e925c3",b=(e,i)=>{let t=0;return e?e.replace(/{{(.*?)}}/g,((e,n)=>{const l=n.trim();if(i&&i.length&&t<i.length){const e=i[t];return t++,e}return`{{${l}}}`})):""},p=b(h[t.TITLE],null==v?void 0:v.title),O=b(null!==(c=null!==(o=null===(s=h[t.BODY])||void 0===s?void 0:s.text)&&void 0!==o?o:h[t.BODY])&&void 0!==c?c:"",null==v?void 0:v.body);return e(n,{children:[e("div",Object.assign({className:"icon--header"},{children:[i("div",Object.assign({className:"icon-img-container"},{children:i("img",{src:(null===(d=null==v?void 0:v[t.ICON])||void 0===d?void 0:d.length)?v[t.ICON][0]:null!==(r=h[t.ICON])&&void 0!==r?r:u,alt:"icon-image"})})),e("div",Object.assign({className:"text--container"},{children:[i("div",{children:p}),i("div",Object.assign({style:{marginTop:3}},{children:O}))]}))]})),h[t.IMAGE]&&h[t.IMAGE].length&&i("div",Object.assign({className:"banner-img-container"},{children:i("img",{src:(null===(m=null==v?void 0:v[t.IMAGE])||void 0===m?void 0:m.length)?v[t.IMAGE][0]:null!==(g=h[t.IMAGE])&&void 0!==g?g:u,alt:"icon-image"})})),h[t.BUTTONS]&&h[t.BUTTONS].length&&i("div",Object.assign({className:"button-container "+(1===h[t.BUTTONS].length?"single-button":"")},{children:h[t.BUTTONS].map(((e,n)=>i("div",Object.assign({className:"each--btn",style:{flex:1===h[t.BUTTONS].length?"0 0 50%":"1"}},{children:i("div",Object.assign({className:"text-btn"},{children:e.text}))}),`webpush-buttons-${n}`)))}))]})};export{l as default};
|