Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 70 additions & 74 deletions apps/web/components/customer-reviews/inline-styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,91 +57,87 @@ export const component = (
{ rating: 2, count: 199 },
{ rating: 1, count: 147 },
].map(({ count, rating }) => (
<Row
align="center"
key={rating}
style={{
fontSize: '14px',
lineHeight: '20px',
}}
>
<Column align="center" valign="middle">
<dt>
<Row>
<Column width={undefined}>
<Text
style={{
color: 'rgb(107,114,128)',
fontWeight: '500',
width: '12px',
}}
>
{rating}
<span style={{ display: 'none' }}>
{' '}
star reviews
</span>
</Text>
</Column>
<Column
<>
<dt
key={`${rating}-dt`}
style={{
fontSize: '14px',
lineHeight: '20px',
}}
>
<Row align="center">
<Column width={undefined}>
<Text
style={{
color: 'rgb(107,114,128)',
fontWeight: '500',
width: '12px',
}}
>
{rating}
<span style={{ display: 'none' }}>
{' '}
star reviews
</span>
</Text>
</Column>
<Column
width="264"
height="12"
style={{
width: 264,
height: 12,
paddingLeft: 12,
}}
aria-hidden="true"
valign="middle"
>
<Row
aria-hidden="true"
width="264"
height="12"
style={{
width: 264,
height: 12,
paddingLeft: 12,
backgroundColor: 'rgb(243,244,246)',
border: '1px solid rgb(229,231,235)',
borderRadius: 6,
}}
aria-hidden="true"
valign="middle"
>
<Row
aria-hidden="true"
width="264"
<Column
height="12"
style={{
width: 264,
height: 12,
backgroundColor: 'rgb(243,244,246)',
border: '1px solid rgb(229,231,235)',
backgroundColor: 'rgb(79,70,229)',
borderRadius: 6,
height: 12,
width: `${(count / 1624) * 264}px`,
}}
>
<Column
height="12"
style={{
backgroundColor: 'rgb(79,70,229)',
borderRadius: 6,
height: 12,
width: `${(count / 1624) * 264}px`,
}}
width={(count / 1624) * 264}
/>
<Column
width={(1 - count / 1624) * 264}
style={{
width: `${(1 - count / 1624) * 264}px`,
}}
/>
</Row>
</Column>
<Column width="100%" style={{ width: '100%' }}>
<dd
width={(count / 1624) * 264}
/>
<Column
width={(1 - count / 1624) * 264}
style={{
color: 'rgb(107,114,128)',
fontSize: '12px',
fontVariantNumeric: 'tabular-nums',
fontWeight: '500',
lineHeight: '1',
marginLeft: 12,
textAlign: 'right',
width: `${(1 - count / 1624) * 264}px`,
}}
>
{Math.round((count / 1624) * 100)}%
</dd>
</Column>
</Row>
</dt>
</Column>
</Row>
/>
</Row>
</Column>
</Row>
</dt>
<dd
key={`${rating}-dd`}
style={{
color: 'rgb(107,114,128)',
fontSize: '12px',
fontVariantNumeric: 'tabular-nums',
fontWeight: '500',
lineHeight: '1',
marginLeft: 12,
textAlign: 'right',
}}
>
{Math.round((count / 1624) * 100)}%
</dd>
</>
))}
</dl>
<Text
Expand Down
91 changes: 43 additions & 48 deletions apps/web/components/customer-reviews/tailwind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,56 +39,51 @@ export const component = (
{ rating: 2, count: 199 },
{ rating: 1, count: 147 },
].map(({ count, rating }) => (
<Row
key={rating}
className="text-[14px] leading-[20px]"
align="center"
>
<Column align="center" valign="middle">
<dt>
<Row>
<Column width={undefined}>
<Text className="w-[12px] font-medium text-gray-500">
{rating}
<span className="hidden"> star reviews</span>
</Text>
</Column>
<Column
<>
<dt key={`${rating}-dt`}>
<Row className="text-[14px] leading-[20px]" align="center">
<Column width={undefined}>
<Text className="w-[12px] font-medium text-gray-500">
{rating}
<span className="hidden"> star reviews</span>
</Text>
</Column>
<Column
width="264"
height="12"
className="w-[264px] h-[12px] pl-[12px]"
aria-hidden="true"
valign="middle"
>
<Row
width="264"
height="12"
className="w-[264px] h-[12px] pl-[12px]"
aria-hidden="true"
valign="middle"
className="w-[264px] h-[12px] bg-gray-100 border-gray-200 border border-solid rounded-[6px]"
>
<Row
width="264"
className="w-[264px] h-[12px] bg-gray-100 border-gray-200 border border-solid rounded-[6px]"
>
<Column
height="12"
className="h-[12px] bg-indigo-600 rounded-[6px]"
width={(count / 1624) * 264}
style={{
width: `${(count / 1624) * 264}px`,
}}
/>
<Column
width={(1 - count / 1624) * 264}
style={{
width: `${(1 - count / 1624) * 264}px`,
}}
/>
</Row>
</Column>
<Column width="100%" className="w-full">
<dd className="ml-[12px] text-right font-medium text-gray-500 text-[12px] [font-variant-numeric:tabular-nums] leading-none">
{Math.round((count / 1624) * 100)}%
</dd>
</Column>
</Row>
</dt>
</Column>
</Row>
<Column
height="12"
className="h-[12px] bg-indigo-600 rounded-[6px]"
width={(count / 1624) * 264}
style={{
width: `${(count / 1624) * 264}px`,
}}
/>
<Column
width={(1 - count / 1624) * 264}
style={{
width: `${(1 - count / 1624) * 264}px`,
}}
/>
</Row>
</Column>
</Row>
</dt>
<dd
key={`${rating}-dd`}
className="ml-[12px] text-right font-medium text-gray-500 text-[12px] [font-variant-numeric:tabular-nums] leading-none"
>
{Math.round((count / 1624) * 100)}%
</dd>
</>
))}
</dl>
<Text className="mt-[14px] text-center text-gray-500 text-[12px] leading-[24px]">
Expand Down
Loading