mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added product name and description to title
This commit is contained in:
parent
d52f054410
commit
811067b7a7
3 changed files with 29 additions and 10 deletions
|
@ -4,7 +4,7 @@ import AppContext from '../../AppContext';
|
|||
import PlansSection from '../common/PlansSection';
|
||||
import InputForm from '../common/InputForm';
|
||||
import {ValidateInputForm} from '../../utils/form';
|
||||
import {getSitePrices, hasOnlyFreePlan, isInviteOnlySite} from '../../utils/helpers';
|
||||
import {getProductDetails, getSitePrices, hasOnlyFreePlan, isInviteOnlySite} from '../../utils/helpers';
|
||||
import {ReactComponent as InvitationIcon} from '../../images/icons/invitation.svg';
|
||||
|
||||
const React = require('react');
|
||||
|
@ -421,12 +421,12 @@ class SignupPage extends React.Component {
|
|||
renderFormHeader() {
|
||||
const {site} = this.context;
|
||||
const siteTitle = site.title || '';
|
||||
|
||||
const {name, description} = getProductDetails({site});
|
||||
return (
|
||||
<header className='gh-portal-signup-header'>
|
||||
{this.renderSiteLogo()}
|
||||
<h2 className="gh-portal-main-title">{siteTitle}</h2>
|
||||
<p className="gh-portal-main-subtitle">Your primary news source on woodworking</p>
|
||||
<h2 className="gh-portal-main-title">{name || siteTitle}</h2>
|
||||
<p className="gh-portal-main-subtitle">{description}</p>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
@ -474,4 +474,4 @@ class SignupPage extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default SignupPage;
|
||||
export default SignupPage;
|
||||
|
|
|
@ -103,6 +103,10 @@ export const site = {
|
|||
yearly: 150000,
|
||||
currency: 'USD'
|
||||
},
|
||||
product: {
|
||||
name: 'Main Product',
|
||||
description: 'The default product'
|
||||
},
|
||||
prices: prices,
|
||||
allow_self_signup: false,
|
||||
members_signup_access: 'all',
|
||||
|
@ -149,8 +153,8 @@ export const member = {
|
|||
currency: 'USD'
|
||||
},
|
||||
price: {
|
||||
id: '6086ead8070218227791fe4f',
|
||||
stripe_price_id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||
id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||
price_id: '6086ead8070218227791fe4f',
|
||||
nickname: 'Yearly',
|
||||
currency: 'usd',
|
||||
amount: 1500,
|
||||
|
@ -192,7 +196,7 @@ export const member = {
|
|||
currency: 'USD'
|
||||
},
|
||||
price: {
|
||||
id: '6086eff0823dd7240afc8083',
|
||||
price_id: '6086eff0823dd7240afc8083',
|
||||
nickname: 'Complimentary',
|
||||
amount: 0,
|
||||
interval: 'year',
|
||||
|
@ -234,8 +238,8 @@ export const member = {
|
|||
currency: 'USD'
|
||||
},
|
||||
price: {
|
||||
id: '6086ead8070218227791fe4f',
|
||||
stripe_price_id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||
price_id: '6086ead8070218227791fe4f',
|
||||
id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||
nickname: 'Yearly',
|
||||
currency: 'usd',
|
||||
amount: 1500,
|
||||
|
|
|
@ -65,6 +65,8 @@ export function getPriceFromSubscription({subscription}) {
|
|||
if (subscription && subscription.price) {
|
||||
return {
|
||||
...subscription.price,
|
||||
stripe_price_id: subscription.price.id,
|
||||
id: subscription.price.price_id,
|
||||
price: subscription.price.amount / 100,
|
||||
name: subscription.price.nickname,
|
||||
currency_symbol: getCurrencySymbol(subscription.price.currency)
|
||||
|
@ -103,6 +105,19 @@ export function hasPrice({site = {}, plan}) {
|
|||
return false;
|
||||
}
|
||||
|
||||
export function getProductDetails({site}) {
|
||||
if (site && site.product) {
|
||||
return {
|
||||
name: site.product.name || '',
|
||||
description: site.product.description || ''
|
||||
};
|
||||
}
|
||||
return {
|
||||
name: '',
|
||||
description: ''
|
||||
};
|
||||
}
|
||||
|
||||
export function capitalize(str) {
|
||||
if (typeof str !== 'string' || !str) {
|
||||
return '';
|
||||
|
|
Loading…
Add table
Reference in a new issue