Преглед изворни кода

feat module 6, 7 : reduce the size of product info label and details inside - web, mobile view

master
nadia пре 1 дан
родитељ
комит
fb430c7944
1 измењених фајлова са 20 додато и 38 уклоњено
  1. 20
    38
      src/components/ProductDetails/ProductDetails.jsx

+ 20
- 38
src/components/ProductDetails/ProductDetails.jsx Прегледај датотеку

386
     borderBottom: "1px solid #DDD"
386
     borderBottom: "1px solid #DDD"
387
   }
387
   }
388
 
388
 
389
+  // Styles for the content inside each information panel (e.g., Material, Care Instruction)
389
   const infoPanelContentSx = {
390
   const infoPanelContentSx = {
390
     color: "text.secondary",
391
     color: "text.secondary",
391
     fontSize: {
392
     fontSize: {
392
-      xs: "0.875rem",
393
-      md: "1rem"
393
+      xs: "0.8rem",
394
+      md: "0.90rem"
394
     },
395
     },
395
     lineHeight: 1.6,
396
     lineHeight: 1.6,
396
     pb: 2.5
397
     pb: 2.5
397
   }
398
   }
398
 
399
 
400
+  // Styles for the label of each information row (e.g., Material, Care Instruction)
401
+  const infoRowLabelSx = {
402
+    textTransform: "uppercase",
403
+    fontWeight: "400",
404
+    fontSize: {
405
+      xs: "0.8rem",
406
+      md: "0.90rem"
407
+    }
408
+  }
409
+
399
   const materialMetafield = product?.metafields?.material
410
   const materialMetafield = product?.metafields?.material
400
   const careInstructionMetafield = product?.metafields?.care_instruction
411
   const careInstructionMetafield = product?.metafields?.care_instruction
401
   const shippingInformationMetafield = product?.metafields?.shipping_information
412
   const shippingInformationMetafield = product?.metafields?.shipping_information
826
           </Alert>
837
           </Alert>
827
         )}
838
         )}
828
 
839
 
829
-        {/*
830
-        {/*
831
-        <Box sx={{ mb: 5 }}>
832
-          <Typography variant="body1" sx={{ fontWeight: "400", color: "#000" }}>
833
-            Description
834
-          </Typography>
835
-          <Typography variant="body1" color="text.secondary" sx={{ fontWeight: "400" }}>
836
-            <div dangerouslySetInnerHTML={{ __html: product?.descriptionHtml }}></div>
837
-          </Typography>
838
-        </Box>
839
-        */}
840
-
841
-        {/* <Box sx={{ mb: 5 }}>
842
-          <Typography variant="body1" sx={{ fontWeight: "400", color: "#000" }}>
843
-            Description
844
-          </Typography>
845
-          <Typography variant="body1" color="text.secondary" sx={{ fontWeight: "400" }}>
846
-            <div dangerouslySetInnerHTML={{ __html: product?.descriptionHtml }}></div>
847
-          </Typography>
848
-        </Box> */}
849
-
850
         {/* Product information rows: store availability, details, material, care, shipping, and returns */}
840
         {/* Product information rows: store availability, details, material, care, shipping, and returns */}
851
         <Box sx={{ mt: 4, borderTop: "1px solid #DDD" }}>
841
         <Box sx={{ mt: 4, borderTop: "1px solid #DDD" }}>
852
           {/* Store Availability */}
842
           {/* Store Availability */}
853
-          {/*
854
-          <Box sx={{ display: "flex", alignItems: "center", py: 2, borderBottom: "1px solid #DDD" }}>
855
-            <StorefrontIcon sx={{ mr: 1, fontSize: 20 }} />
856
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
857
-              Store Availability
858
-            </Typography>
859
-          </Box>
860
-          */}
861
           <Box
843
           <Box
862
             onClick={() => setStoreAvailabilityOpen(true)}
844
             onClick={() => setStoreAvailabilityOpen(true)}
863
             sx={{
845
             sx={{
869
             }}
851
             }}
870
           >
852
           >
871
             <StorefrontIcon sx={{ mr: 1, fontSize: 20 }} />
853
             <StorefrontIcon sx={{ mr: 1, fontSize: 20 }} />
872
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
854
+            <Typography variant="body2" sx={infoRowLabelSx}>
873
               Store Availability
855
               Store Availability
874
             </Typography>
856
             </Typography>
875
           </Box>
857
           </Box>
883
               borderBottom: "none"
865
               borderBottom: "none"
884
             }}
866
             }}
885
           >
867
           >
886
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
868
+            <Typography variant="body2" sx={infoRowLabelSx}>
887
               Product Details
869
               Product Details
888
             </Typography>
870
             </Typography>
889
             {expandedInfoRows.productDetails ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
871
             {expandedInfoRows.productDetails ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
899
               borderBottom: "none"
881
               borderBottom: "none"
900
             }}
882
             }}
901
           >
883
           >
902
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
884
+            <Typography variant="body2" sx={infoRowLabelSx}>
903
               Material
885
               Material
904
             </Typography>
886
             </Typography>
905
             {expandedInfoRows.material ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
887
             {expandedInfoRows.material ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
915
               borderBottom: "none"
897
               borderBottom: "none"
916
             }}
898
             }}
917
           >
899
           >
918
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
900
+            <Typography variant="body2" sx={infoRowLabelSx}>
919
               Care Instruction
901
               Care Instruction
920
             </Typography>
902
             </Typography>
921
             {expandedInfoRows.careInstruction ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
903
             {expandedInfoRows.careInstruction ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
931
               borderBottom: "none"
913
               borderBottom: "none"
932
             }}
914
             }}
933
           >
915
           >
934
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
916
+            <Typography variant="body2" sx={infoRowLabelSx}>
935
               Shipping Information
917
               Shipping Information
936
             </Typography>
918
             </Typography>
937
             {expandedInfoRows.shippingInformation ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
919
             {expandedInfoRows.shippingInformation ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
947
               borderBottom: "none"
929
               borderBottom: "none"
948
             }}
930
             }}
949
           >
931
           >
950
-            <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
932
+            <Typography variant="body2" sx={infoRowLabelSx}>
951
               Return & Exchanges
933
               Return & Exchanges
952
             </Typography>
934
             </Typography>
953
             {expandedInfoRows.returnExchanges ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
935
             {expandedInfoRows.returnExchanges ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
964
                 borderBottom: "none"
946
                 borderBottom: "none"
965
               }}
947
               }}
966
             >
948
             >
967
-              <Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
949
+              <Typography variant="body2" sx={infoRowLabelSx}>
968
                 Note
950
                 Note
969
               </Typography>
951
               </Typography>
970
               {expandedInfoRows.note ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
952
               {expandedInfoRows.note ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}

Loading…
Откажи
Сачувај