mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Removed the feature flag and the related logic
refs https://github.com/TryGhost/Team/issues/1724
This commit is contained in:
parent
2c636d16eb
commit
427a5b1057
1 changed files with 25 additions and 74 deletions
|
@ -224,18 +224,6 @@ export const ProductsSectionStyles = ({site}) => {
|
|||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.gh-portal-product-card-pricecontainer-old {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
row-gap: 10px;
|
||||
column-gap: 4px;
|
||||
width: 100%;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.gh-portal-product-price {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -514,7 +502,6 @@ export const ProductsSectionStyles = ({site}) => {
|
|||
`;
|
||||
};
|
||||
|
||||
const freeTrialFlag = 1;
|
||||
const ProductsContext = React.createContext({
|
||||
selectedInterval: 'month',
|
||||
selectedProduct: 'free',
|
||||
|
@ -589,6 +576,7 @@ function ProductCardTrialDays({trialDays, discount, selectedInterval}) {
|
|||
|
||||
function ProductCardPrice({product}) {
|
||||
const {selectedInterval} = useContext(ProductsContext);
|
||||
const {site} = useContext(AppContext);
|
||||
const monthlyPrice = product.monthlyPrice;
|
||||
const yearlyPrice = product.yearlyPrice;
|
||||
const trialDays = product.trial_days;
|
||||
|
@ -601,7 +589,7 @@ function ProductCardPrice({product}) {
|
|||
const yearlyDiscount = calculateDiscount(product.monthlyPrice.amount, product.yearlyPrice.amount);
|
||||
const currencySymbol = getCurrencySymbol(activePrice.currency);
|
||||
|
||||
if (freeTrialFlag) {
|
||||
if (hasFreeTrialTier({site})) {
|
||||
return (
|
||||
<>
|
||||
<div className="gh-portal-product-card-pricecontainer">
|
||||
|
@ -622,13 +610,15 @@ function ProductCardPrice({product}) {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="gh-portal-product-card-pricecontainer-old">
|
||||
<div className="gh-portal-product-card-pricecontainer">
|
||||
<div className="gh-portal-product-card-price-trial">
|
||||
<div className="gh-portal-product-price">
|
||||
<span className={'currency-sign' + (currencySymbol.length > 1 ? ' long' : '')}>{currencySymbol}</span>
|
||||
<span className="amount">{formatNumber(getStripeAmount(activePrice.amount))}</span>
|
||||
<span className="billing-period">/{activePrice.interval}</span>
|
||||
</div>
|
||||
{(selectedInterval === 'year' ? <YearlyDiscount discount={yearlyDiscount} /> : '')}
|
||||
</div>
|
||||
<ProductCardAlternatePrice price={alternatePrice} />
|
||||
</div>
|
||||
);
|
||||
|
@ -747,7 +737,6 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup})
|
|||
productDescription = 'Full access';
|
||||
}
|
||||
|
||||
if (freeTrialFlag) {
|
||||
return (
|
||||
<>
|
||||
<div className={cardClass} key={product.id} onClick={(e) => {
|
||||
|
@ -782,40 +771,6 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup})
|
|||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={cardClass} key={product.id} onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setSelectedProduct(product.id);
|
||||
}}>
|
||||
<div className='gh-portal-product-card-header'>
|
||||
<h4 className="gh-portal-product-name">{product.name}</h4>
|
||||
<ProductCardPrice product={product} />
|
||||
</div>
|
||||
<div className='gh-portal-product-card-details'>
|
||||
<div className='gh-portal-product-card-detaildata'>
|
||||
<div className="gh-portal-product-description">
|
||||
{productDescription}
|
||||
</div>
|
||||
<ProductBenefitsContainer product={product} />
|
||||
</div>
|
||||
<div className='gh-portal-btn-product'>
|
||||
<button
|
||||
disabled={disabled}
|
||||
className='gh-portal-btn'
|
||||
onClick={(e) => {
|
||||
const selectedPrice = getSelectedPrice({products, selectedInterval, selectedProduct: product.id});
|
||||
handleChooseSignup(e, selectedPrice.id);
|
||||
}}>
|
||||
{((selectedProduct === product.id && disabled) ? <LoaderIcon className='gh-portal-loadingicon' /> : (noOfProducts > 1 ? 'Choose' : 'Continue'))}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ProductCards({products, selectedInterval, handleChooseSignup}) {
|
||||
|
@ -839,7 +794,6 @@ function YearlyDiscount({discount, trialDays}) {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (freeTrialFlag) {
|
||||
if (hasFreeTrialTier({site})) {
|
||||
return (
|
||||
<>
|
||||
|
@ -847,15 +801,12 @@ function YearlyDiscount({discount, trialDays}) {
|
|||
</>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className="gh-portal-discount-label">{discount}% discount</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function ProductPriceSwitch({products, selectedInterval, setSelectedInterval}) {
|
||||
|
|
Loading…
Add table
Reference in a new issue