tee3apps-cms-sdk-react 0.0.27 → 0.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tee3apps-cms-sdk-react",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "Uses JSON to dynamically generate and render UI pages in a website",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/Page.tsx CHANGED
@@ -63,7 +63,7 @@ const Page = ({data}:any) => {
63
63
  key={boxIndex}
64
64
  props={box.props}
65
65
  deviceMode={deviceMode}
66
- autoAdjustForImages={false}
66
+ autoAdjustForImages={true}
67
67
  >
68
68
  {box.components.map((component: { name: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; props: TextProps | LinkProps | ImageComponentProps | GroupProductComponentProps | VideoComponentProps | GroupBrandComponentProps | LottieComponentProps | CarouselProps | NavigationProps | GroupVideoListProps | GroupCategoryComponentProps | GroupImageListProps | TabComponentProps | RichTextComponentProps; }, compIndex: React.Key | null | undefined) => {
69
69
  const getCurrentBoxHeight = () => {
@@ -335,6 +335,11 @@ const GroupProductComponent: React.FC<GroupProductComponentMainProps> = ({
335
335
  e.currentTarget.style.transform = 'translateY(0)';
336
336
  e.currentTarget.style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
337
337
  }}
338
+ onClick={() => {
339
+ if (product.code) {
340
+ window.location.href = `/${product.code}`;
341
+ }
342
+ }}
338
343
  >
339
344
  <div style={{
340
345
  height: imageHeight,
@@ -548,8 +548,8 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
548
548
  {/* Product Image */}
549
549
  <div className="product-image-container">
550
550
  <img
551
- src={getImageUrl(product.image?.url || '')}
552
- alt={getDisplayText(product.name) || getDisplayText(product.image?.alt) || ''}
551
+ src={getImageUrl(product.image?.url || product?.image?.all?.url || '')}
552
+ alt={getDisplayText(product.name) || getDisplayText(product.image?.alt) || getDisplayText(product.image?.all?.alt) || getDisplayText(product.image?.alt) || ''}
553
553
  className="product-image"
554
554
  />
555
555
  </div>
@@ -627,10 +627,11 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
627
627
  </>
628
628
  );
629
629
 
630
+ const productCode = typeof product.code === 'string' ? product.code : getDisplayText(product.code) || product.sku || '';
630
631
  return (
631
- <div className={`product-card ${cardMode}`}>
632
+ <a href={productCode ? `/${productCode}` : '#'} className={`product-card ${cardMode}`} style={{ textDecoration: 'none', color: 'inherit' }}>
632
633
  {cardContent}
633
- </div>
634
+ </a>
634
635
  );
635
636
  };
636
637