Skip to content

Commit 9ca5ecd

Browse files
committed
fix: lineItem options style refactored
1 parent 508acbe commit 9ca5ecd

2 files changed

Lines changed: 24 additions & 19 deletions

File tree

components/composite/OrderSummary/LineItemTypes/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
LineItemImage,
44
LineItemName,
55
LineItemAmount,
6-
LineItemOptions,
6+
LineItemOption,
77
LineItemType,
88
} from "@commercelayer/react-components"
99
import React from "react"
@@ -14,8 +14,8 @@ import {
1414
LineItemQty,
1515
LineItemTitle,
1616
LineItemWrapper,
17-
StyledLineItemOption,
1817
StyledLineItemSkuCode,
18+
StyledLineItemOptions,
1919
} from "./styled"
2020

2121
interface Props {
@@ -41,9 +41,9 @@ export const LineItemTypes: React.FC<Props> = ({ type }) => {
4141
<LineItemName className="font-bold" />
4242
<LineItemAmount className="pl-2 text-lg font-extrabold" />
4343
</LineItemTitle>
44-
<LineItemOptions showAll showName={false}>
45-
<StyledLineItemOption />
46-
</LineItemOptions>
44+
<StyledLineItemOptions showAll showName={true} className="options">
45+
<LineItemOption />
46+
</StyledLineItemOptions>
4747
<LineItemQty>
4848
<QuantityWithPrice />
4949
</LineItemQty>
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LineItemCode, LineItemOption } from "@commercelayer/react-components"
1+
import { LineItemCode, LineItemOptions } from "@commercelayer/react-components"
22
import styled from "styled-components"
33
import tw from "twin.macro"
44

@@ -12,24 +12,29 @@ export const LineItemTitle = styled.div`
1212
${tw`flex justify-between text-black`}
1313
`
1414
export const LineItemQty = styled.div`
15-
${tw`text-xs mt-1 bg-gray-200 max-w-max py-1 px-2.5 rounded-full tracking-wider text-gray-400 font-bold`}
15+
${tw`text-xs mt-2 bg-gray-200 max-w-max py-1 px-2.5 rounded-full tracking-wider text-gray-400 font-bold`}
1616
`
1717
export const StyledLineItemSkuCode = styled(LineItemCode)`
18-
${tw`text-xxs uppercase text-gray-400 font-bold`}
18+
${tw`text-xxs uppercase text-gray-400 font-bold mb-1`}
1919
`
20-
export const StyledLineItemOption = styled(LineItemOption)`
21-
${tw`text-gray-400 text-xs flex font-medium capitalize pl-5 mt-1.5 bg-no-repeat bg-16`}
22-
span {
23-
${tw`font-bold text-gray-500 ml-1 line-clamp-3 md:line-clamp-6`}
20+
export const StyledLineItemOptions = styled(LineItemOptions)`
21+
h6 {
22+
${tw`font-bold text-xs text-gray-600 mt-2 bg-no-repeat bg-16 pl-5`}
23+
background-image: url("data:image/svg+xml;utf8;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNsYXNzPSJoLTUgdy01IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9ImN1cnJlbnRDb2xvciI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjkzIDUuMjkzYTEgMSAwIDAxMS40MTQgMGw0IDRhMSAxIDAgMDEwIDEuNDE0bC00IDRhMSAxIDAgMDEtMS40MTQtMS40MTRMMTIuNTg2IDExSDVhMSAxIDAgMTEwLTJoNy41ODZsLTIuMjkzLTIuMjkzYTEgMSAwIDAxMC0xLjQxNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIgLz4KPC9zdmc+");
2424
}
2525
26-
&:not(span) {
27-
${tw`font-medium`}
28-
}
26+
li {
27+
${tw`text-gray-400 text-xs flex font-medium capitalize pl-5 pt-1 bg-no-repeat bg-16`}
28+
span {
29+
${tw`font-bold text-gray-500 ml-1 line-clamp-3 md:line-clamp-6`}
30+
}
2931
30-
&:last-of-type {
31-
${tw`mb-1.5`}
32-
}
32+
&:not(span) {
33+
${tw`font-medium`}
34+
}
3335
34-
background-image: url("data:image/svg+xml;utf8;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNsYXNzPSJoLTUgdy01IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9ImN1cnJlbnRDb2xvciI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjkzIDUuMjkzYTEgMSAwIDAxMS40MTQgMGw0IDRhMSAxIDAgMDEwIDEuNDE0bC00IDRhMSAxIDAgMDEtMS40MTQtMS40MTRMMTIuNTg2IDExSDVhMSAxIDAgMTEwLTJoNy41ODZsLTIuMjkzLTIuMjkzYTEgMSAwIDAxMC0xLjQxNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIgLz4KPC9zdmc+");
36+
&:last-of-type {
37+
${tw`mb-2`}
38+
}
39+
}
3540
`

0 commit comments

Comments
 (0)