yt-uikit 0.8.23-gift-wrap-product-image.0 → 0.8.23-gift-wrap-product-image.1
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.
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1939,7 +1939,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1939
1939
|
font-size: 12px;
|
|
1940
1940
|
margin-top: 5px;
|
|
1941
1941
|
padding: 0 20px;
|
|
1942
|
-
`,Xd=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Kd({themeColor:e,id:n,showPrice:r,detail:o,errorText:a,customText:i,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,f]=un(Hd),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(null),{setLoading:w}=kn();l(()=>{o?.availableForSale&&y(!0),o?.variants?.nodes&&o?.variants?.nodes.length>0&&x(o?.variants?.nodes[0])},[o]);const C=g?.price?.amount,k=g?.image?.url||o?.featuredImage?.url;return h?t.createElement(Ud,null,t.createElement(Qd,null,t.createElement(Yd,null,d&&k?t.createElement(qd,{src:k,alt:"Gift wrap",className:"yt-cart-gift-wrap-product-image"}):s?t.createElement(pt,{size:24,color:e,style:{height:"24px",width:"24px"}}):null,i||"+ Gift-Wrap",r?t.createElement("span",{style:{color:e}},"₹",Number(C).toFixed(0)):""),t.createElement(Gd,{type:"checkbox",checked:m,onChange:async()=>{try{w(!0,!0),v(null),f(!m),!m&&p&&g?await p(Xd(g?.id),1):m&&u&&g&&await u(Xd(g?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),f(m),console.error("Error updating gift wrap:",e)}},$themeColor:e,disabled:!h})),b&&t.createElement(Zd,null,b)):null}const Jd=h.div`
|
|
1942
|
+
`,Xd=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Kd({themeColor:e,id:n,showPrice:r,detail:o,errorText:a,customText:i,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,f]=un(Hd),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(null),{setLoading:w}=kn();l(()=>{o?.availableForSale&&y(!0),o?.variants?.nodes&&o?.variants?.nodes.length>0&&x(o?.variants?.nodes[0])},[o]);const C=g?.price?.amount,k=g?.image?.url||o?.featuredImage?.url;return console.log("yt::kit gift wrap imageUrl:",k),h?t.createElement(Ud,null,t.createElement(Qd,null,t.createElement(Yd,null,d&&k?t.createElement(qd,{src:k,alt:"Gift wrap",className:"yt-cart-gift-wrap-product-image"}):s?t.createElement(pt,{size:24,color:e,style:{height:"24px",width:"24px"}}):null,i||"+ Gift-Wrap",r?t.createElement("span",{style:{color:e}},"₹",Number(C).toFixed(0)):""),t.createElement(Gd,{type:"checkbox",checked:m,onChange:async()=>{try{w(!0,!0),v(null),f(!m),!m&&p&&g?await p(Xd(g?.id),1):m&&u&&g&&await u(Xd(g?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),f(m),console.error("Error updating gift wrap:",e)}},$themeColor:e,disabled:!h})),b&&t.createElement(Zd,null,b)):null}const Jd=h.div`
|
|
1943
1943
|
margin-top: 10px;
|
|
1944
1944
|
margin-bottom: 5px;
|
|
1945
1945
|
margin-left: 1rem;
|