Skip to content
Merged
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
2 changes: 2 additions & 0 deletions core/app/[locale]/(default)/compare/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export default async function Compare(props: Props) {
previousLabel={t('previous')}
products={streamableProducts}
ratingLabel={t('rating')}
showLessLabel={t('showLess')}
showMoreLabel={t('showMore')}
title={t('title')}
viewOptionsLabel={t('viewOptions')}
/>
Expand Down
2 changes: 2 additions & 0 deletions core/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@
"otherDetails": "Other details",
"noOtherDetails": "There are no other details.",
"viewOptions": "View options",
"showMore": "Show more",
"showLess": "Show less",
"successMessage": "{cartItems, plural, =1 {1 item} other {# items}} added to <cartLink> your cart</cartLink>",
"missingCart": "Cart not found. Please try again later.",
"unknownError": "Unknown error. Please try again later."
Expand Down
8 changes: 6 additions & 2 deletions core/vibes/soul/primitives/compare-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export interface CompareCardProps {
noOtherDetailsLabel?: string;
viewOptionsLabel?: string;
preorderLabel?: string;
showMoreLabel?: string;
showLessLabel?: string;
addToCartAction?: CompareAddToCartAction;
imageSizes?: string;
}
Expand Down Expand Up @@ -66,6 +68,8 @@ export function CompareCard({
noOtherDetailsLabel = 'There are no other details.',
viewOptionsLabel = 'View options',
preorderLabel = 'Preorder',
showMoreLabel = 'Show more',
showLessLabel = 'Show less',
Comment on lines +71 to +72

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've moved away from prop drilling, and instead we can simply call the t helper within this component. BUT merging as is, is also fine. 🍹

imageSizes,
}: CompareCardProps) {
return (
Expand Down Expand Up @@ -110,7 +114,7 @@ export function CompareCard({
{descriptionLabel}
</div>
{product.description != null && product.description !== '' ? (
<Reveal>
<Reveal hideLabel={showLessLabel} showLabel={showMoreLabel}>
<div className="prose prose-sm [&>div>*:first-child]:mt-0">{product.description}</div>
</Reveal>
) : (
Expand All @@ -124,7 +128,7 @@ export function CompareCard({
<div className="font-[family-name:var(--compare-card-font-family-secondary,var(--font-family-mono))] text-xs font-normal uppercase text-[var(--compare-card-label,hsl(var(--foreground)))]">
{otherDetailsLabel}
</div>
<Reveal>
<Reveal hideLabel={showLessLabel} showLabel={showMoreLabel}>
<dl className="grid grid-cols-2 gap-1 text-xs font-normal text-[var(--compare-card-field,hsl(var(--foreground)))]">
{product.customFields.map((field, index) => (
<Fragment key={index}>
Expand Down
6 changes: 6 additions & 0 deletions core/vibes/soul/sections/compare-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ interface CompareSectionProps {
noOtherDetailsLabel?: string;
viewOptionsLabel?: string;
preorderLabel?: string;
showMoreLabel?: string;
showLessLabel?: string;
placeholderCount?: number;
addToCartAction?: CompareAddToCartAction;
}
Expand Down Expand Up @@ -72,6 +74,8 @@ export function CompareSection({
noOtherDetailsLabel,
viewOptionsLabel,
preorderLabel,
showMoreLabel,
showLessLabel,
placeholderCount,
}: CompareSectionProps) {
return (
Expand Down Expand Up @@ -129,6 +133,8 @@ export function CompareSection({
preorderLabel={preorderLabel}
product={product}
ratingLabel={ratingLabel}
showLessLabel={showLessLabel}
showMoreLabel={showMoreLabel}
viewOptionsLabel={viewOptionsLabel}
/>
</CarouselItem>
Expand Down
Loading