-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract separate components from FeaturesGrid (#86825)
- Loading branch information
Showing
15 changed files
with
760 additions
and
659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/plans-grid-next/src/components/features-grid/billing-timeframes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import classNames from 'classnames'; | ||
import { GridPlan } from '../../types'; | ||
import PlanDivOrTdContainer from '../plan-div-td-container'; | ||
import BillingTimeframe from '../shared/billing-timeframe'; | ||
|
||
type BillingTimeframesProps = { | ||
renderedGridPlans: GridPlan[]; | ||
showRefundPeriod?: boolean; | ||
options?: { | ||
isTableCell?: boolean; | ||
}; | ||
}; | ||
|
||
const BillingTimeframes = ( { | ||
options, | ||
renderedGridPlans, | ||
showRefundPeriod, | ||
}: BillingTimeframesProps ) => { | ||
return renderedGridPlans.map( ( { planSlug } ) => { | ||
const classes = classNames( | ||
'plan-features-2023-grid__table-item', | ||
'plan-features-2023-grid__header-billing-info' | ||
); | ||
|
||
return ( | ||
<PlanDivOrTdContainer | ||
className={ classes } | ||
isTableCell={ options?.isTableCell } | ||
key={ planSlug } | ||
> | ||
<BillingTimeframe planSlug={ planSlug } showRefundPeriod={ showRefundPeriod } /> | ||
</PlanDivOrTdContainer> | ||
); | ||
} ); | ||
}; | ||
|
||
export default BillingTimeframes; |
Oops, something went wrong.