Skip to content

Commit

Permalink
Update cost terminology to price
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Sep 5, 2023
1 parent e405814 commit fe2ed2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ type StorageAddOnDropdownProps = {
label?: string;
planSlug: PlanSlug;
storageOptions: StorageOption[];
showCost?: boolean;
showPrice?: boolean;
};

type StorageAddOnOptionProps = {
title: string;
cost: string | undefined;
showCost: boolean;
price: string | undefined;
showPrice: boolean;
};

const getStorageOptionPrice = (
Expand All @@ -28,15 +28,15 @@ const getStorageOptionPrice = (
} )?.prices?.formattedMonthlyPrice;
};

const StorageAddOnOption = ( { title, cost, showCost }: StorageAddOnOptionProps ) => {
const StorageAddOnOption = ( { title, price, showPrice }: StorageAddOnOptionProps ) => {
const translate = useTranslate();
return (
<>
{ cost && showCost ? (
{ price && showPrice ? (
<div>
<span className="storage-add-on-dropdown-option__title">{ title }</span>
<span className="storage-add-on-dropdown-option__cost">
{ ` + ${ cost }/${ translate( 'month' ) }` }
<span className="storage-add-on-dropdown-option__price">
{ ` + ${ price }/${ translate( 'month' ) }` }
</span>
</div>
) : (
Expand All @@ -50,7 +50,7 @@ export const StorageAddOnDropdown = ( {
label = '',
planSlug,
storageOptions,
showCost = false,
showPrice = false,
}: StorageAddOnDropdownProps ) => {
const { gridPlansIndex } = usePlansGridContext();
const { storageAddOnsForPlan } = gridPlansIndex[ planSlug ];
Expand All @@ -65,10 +65,10 @@ export const StorageAddOnDropdown = ( {
// TODO: Consider transforming storageOptions outside of this component
const selectControlOptions = storageOptions.map( ( storageOption ) => {
const title = getStorageStringFromFeature( storageOption.slug ) || '';
const cost = getStorageOptionPrice( storageAddOnsForPlan, storageOption.slug );
const price = getStorageOptionPrice( storageAddOnsForPlan, storageOption.slug );
return {
key: storageOption?.slug,
name: <StorageAddOnOption title={ title } cost={ cost } showCost={ showCost } />,
name: <StorageAddOnOption title={ title } price={ price } showPrice={ showPrice } />,
};
} );

Expand All @@ -81,8 +81,8 @@ export const StorageAddOnDropdown = ( {
name: (
<StorageAddOnOption
title={ selectedOptionTitle }
cost={ selectedOptionPrice }
showCost={ showCost }
price={ selectedOptionPrice }
showPrice={ showPrice }
/>
),
};
Expand Down
2 changes: 1 addition & 1 deletion client/my-sites/plan-features-2023-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ export class PlanFeatures2023Grid extends Component< PlanFeatures2023GridType >
label={ translate( 'Storage' ) }
planSlug={ planSlug }
storageOptions={ storageOptions }
showCost
showPrice
/>
) : (
storageOptions.map( ( storageOption ) => {
Expand Down
2 changes: 1 addition & 1 deletion client/my-sites/plan-features-2023-grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ $mobile-card-max-width: 440px;
font-size: 0.75rem;
}

.storage-add-on-dropdown-option__cost {
.storage-add-on-dropdown-option__price {
color: var(--studio-green-40);

// Non standard rem allows us to match font size of other storage labels
Expand Down

0 comments on commit fe2ed2a

Please sign in to comment.