Просмотр исходного кода

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

master
nadia 1 день назад
Родитель
Сommit
fb430c7944
1 измененных файлов: 20 добавлений и 38 удалений
  1. 20
    38
      src/components/ProductDetails/ProductDetails.jsx

+ 20
- 38
src/components/ProductDetails/ProductDetails.jsx Просмотреть файл

@@ -386,16 +386,27 @@ const ProductDetails = () => {
386 386
     borderBottom: "1px solid #DDD"
387 387
   }
388 388
 
389
+  // Styles for the content inside each information panel (e.g., Material, Care Instruction)
389 390
   const infoPanelContentSx = {
390 391
     color: "text.secondary",
391 392
     fontSize: {
392
-      xs: "0.875rem",
393
-      md: "1rem"
393
+      xs: "0.8rem",
394
+      md: "0.90rem"
394 395
     },
395 396
     lineHeight: 1.6,
396 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 410
   const materialMetafield = product?.metafields?.material
400 411
   const careInstructionMetafield = product?.metafields?.care_instruction
401 412
   const shippingInformationMetafield = product?.metafields?.shipping_information
@@ -826,38 +837,9 @@ const ProductDetails = () => {
826 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 840
         {/* Product information rows: store availability, details, material, care, shipping, and returns */}
851 841
         <Box sx={{ mt: 4, borderTop: "1px solid #DDD" }}>
852 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 843
           <Box
862 844
             onClick={() => setStoreAvailabilityOpen(true)}
863 845
             sx={{
@@ -869,7 +851,7 @@ const ProductDetails = () => {
869 851
             }}
870 852
           >
871 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 855
               Store Availability
874 856
             </Typography>
875 857
           </Box>
@@ -883,7 +865,7 @@ const ProductDetails = () => {
883 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 869
               Product Details
888 870
             </Typography>
889 871
             {expandedInfoRows.productDetails ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
@@ -899,7 +881,7 @@ const ProductDetails = () => {
899 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 885
               Material
904 886
             </Typography>
905 887
             {expandedInfoRows.material ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
@@ -915,7 +897,7 @@ const ProductDetails = () => {
915 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 901
               Care Instruction
920 902
             </Typography>
921 903
             {expandedInfoRows.careInstruction ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
@@ -931,7 +913,7 @@ const ProductDetails = () => {
931 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 917
               Shipping Information
936 918
             </Typography>
937 919
             {expandedInfoRows.shippingInformation ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
@@ -947,7 +929,7 @@ const ProductDetails = () => {
947 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 933
               Return & Exchanges
952 934
             </Typography>
953 935
             {expandedInfoRows.returnExchanges ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
@@ -964,7 +946,7 @@ const ProductDetails = () => {
964 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 950
                 Note
969 951
               </Typography>
970 952
               {expandedInfoRows.note ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}

Загрузка…
Отмена
Сохранить