|
|
@@ -399,7 +399,9 @@ const ProductDetails = () => {
|
|
399
|
399
|
)
|
|
400
|
400
|
|
|
401
|
401
|
const materialMetafield = product?.metafields?.material
|
|
|
402
|
+ const careInstructionMetafield = product?.metafields?.care_instruction
|
|
402
|
403
|
|
|
|
404
|
+ // Renders Shopify product metafield custom.material inside the Material row.
|
|
403
|
405
|
const materialPanel = (
|
|
404
|
406
|
<Box
|
|
405
|
407
|
sx={{
|
|
|
@@ -425,6 +427,32 @@ const ProductDetails = () => {
|
|
425
|
427
|
</Box>
|
|
426
|
428
|
)
|
|
427
|
429
|
|
|
|
430
|
+ // Renders Shopify product metafield custom.care_instruction inside the Care Instruction row.
|
|
|
431
|
+ const careInstructionPanel = (
|
|
|
432
|
+ <Box
|
|
|
433
|
+ sx={{
|
|
|
434
|
+ maxHeight: expandedInfoRows.careInstruction ? 600 : 0,
|
|
|
435
|
+ overflow: "hidden",
|
|
|
436
|
+ borderBottom: "1px solid #DDD",
|
|
|
437
|
+ transition: "max-height 0.25s ease-in-out"
|
|
|
438
|
+ }}
|
|
|
439
|
+ >
|
|
|
440
|
+ <Box
|
|
|
441
|
+ sx={{
|
|
|
442
|
+ color: "text.secondary",
|
|
|
443
|
+ minHeight: careInstructionMetafield?.value ? 0 : 28,
|
|
|
444
|
+ fontSize: {
|
|
|
445
|
+ xs: "0.875rem",
|
|
|
446
|
+ md: "1rem"
|
|
|
447
|
+ },
|
|
|
448
|
+ lineHeight: 1.6
|
|
|
449
|
+ }}
|
|
|
450
|
+ >
|
|
|
451
|
+ {renderShopifyRichText(careInstructionMetafield?.value)}
|
|
|
452
|
+ </Box>
|
|
|
453
|
+ </Box>
|
|
|
454
|
+ )
|
|
|
455
|
+
|
|
428
|
456
|
const productDetailsPanel = (
|
|
429
|
457
|
<Box
|
|
430
|
458
|
sx={{
|
|
|
@@ -834,7 +862,6 @@ const ProductDetails = () => {
|
|
834
|
862
|
onClick={() => toggleInfoRow("material")}
|
|
835
|
863
|
sx={{
|
|
836
|
864
|
...infoRowSx(expandedInfoRows.material),
|
|
837
|
|
- pb: expandedInfoRows.material ? 5 : 2,
|
|
838
|
865
|
pb: 2,
|
|
839
|
866
|
borderBottom: "none"
|
|
840
|
867
|
}}
|
|
|
@@ -849,14 +876,19 @@ const ProductDetails = () => {
|
|
849
|
876
|
{/* Care Instruction */}
|
|
850
|
877
|
<Box
|
|
851
|
878
|
onClick={() => toggleInfoRow("careInstruction")}
|
|
852
|
|
- sx={infoRowSx(expandedInfoRows.careInstruction)}
|
|
|
879
|
+ sx={{
|
|
|
880
|
+ ...infoRowSx(expandedInfoRows.careInstruction),
|
|
|
881
|
+ pb: 2,
|
|
|
882
|
+ borderBottom: "none"
|
|
|
883
|
+ }}
|
|
853
|
884
|
>
|
|
854
|
885
|
<Typography variant="body2" sx={{ textTransform: "uppercase", fontWeight: "400", fontSize: { xs: "0.875rem", md: "1.1rem" } }}>
|
|
855
|
886
|
Care Instruction
|
|
856
|
887
|
</Typography>
|
|
857
|
888
|
{expandedInfoRows.careInstruction ? <RemoveIcon sx={{ fontSize: 18 }} /> : <AddIcon sx={{ fontSize: 18 }} />}
|
|
858
|
889
|
</Box>
|
|
859
|
|
- {emptyInfoPanel("careInstruction")}
|
|
|
890
|
+ {careInstructionPanel}
|
|
|
891
|
+
|
|
860
|
892
|
{/* Shipping Information */}
|
|
861
|
893
|
<Box
|
|
862
|
894
|
onClick={() => toggleInfoRow("shippingInformation")}
|