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 PlansSection from '../common/PlansSection';
|
||||||
import InputForm from '../common/InputForm';
|
import InputForm from '../common/InputForm';
|
||||||
import {ValidateInputForm} from '../../utils/form';
|
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';
|
import {ReactComponent as InvitationIcon} from '../../images/icons/invitation.svg';
|
||||||
|
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
@ -421,12 +421,12 @@ class SignupPage extends React.Component {
|
||||||
renderFormHeader() {
|
renderFormHeader() {
|
||||||
const {site} = this.context;
|
const {site} = this.context;
|
||||||
const siteTitle = site.title || '';
|
const siteTitle = site.title || '';
|
||||||
|
const {name, description} = getProductDetails({site});
|
||||||
return (
|
return (
|
||||||
<header className='gh-portal-signup-header'>
|
<header className='gh-portal-signup-header'>
|
||||||
{this.renderSiteLogo()}
|
{this.renderSiteLogo()}
|
||||||
<h2 className="gh-portal-main-title">{siteTitle}</h2>
|
<h2 className="gh-portal-main-title">{name || siteTitle}</h2>
|
||||||
<p className="gh-portal-main-subtitle">Your primary news source on woodworking</p>
|
<p className="gh-portal-main-subtitle">{description}</p>
|
||||||
</header>
|
</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,
|
yearly: 150000,
|
||||||
currency: 'USD'
|
currency: 'USD'
|
||||||
},
|
},
|
||||||
|
product: {
|
||||||
|
name: 'Main Product',
|
||||||
|
description: 'The default product'
|
||||||
|
},
|
||||||
prices: prices,
|
prices: prices,
|
||||||
allow_self_signup: false,
|
allow_self_signup: false,
|
||||||
members_signup_access: 'all',
|
members_signup_access: 'all',
|
||||||
|
@ -149,8 +153,8 @@ export const member = {
|
||||||
currency: 'USD'
|
currency: 'USD'
|
||||||
},
|
},
|
||||||
price: {
|
price: {
|
||||||
id: '6086ead8070218227791fe4f',
|
id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||||
stripe_price_id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
price_id: '6086ead8070218227791fe4f',
|
||||||
nickname: 'Yearly',
|
nickname: 'Yearly',
|
||||||
currency: 'usd',
|
currency: 'usd',
|
||||||
amount: 1500,
|
amount: 1500,
|
||||||
|
@ -192,7 +196,7 @@ export const member = {
|
||||||
currency: 'USD'
|
currency: 'USD'
|
||||||
},
|
},
|
||||||
price: {
|
price: {
|
||||||
id: '6086eff0823dd7240afc8083',
|
price_id: '6086eff0823dd7240afc8083',
|
||||||
nickname: 'Complimentary',
|
nickname: 'Complimentary',
|
||||||
amount: 0,
|
amount: 0,
|
||||||
interval: 'year',
|
interval: 'year',
|
||||||
|
@ -234,8 +238,8 @@ export const member = {
|
||||||
currency: 'USD'
|
currency: 'USD'
|
||||||
},
|
},
|
||||||
price: {
|
price: {
|
||||||
id: '6086ead8070218227791fe4f',
|
price_id: '6086ead8070218227791fe4f',
|
||||||
stripe_price_id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
id: 'price_1IkXLAFToJelIqAseQdK4WSU',
|
||||||
nickname: 'Yearly',
|
nickname: 'Yearly',
|
||||||
currency: 'usd',
|
currency: 'usd',
|
||||||
amount: 1500,
|
amount: 1500,
|
||||||
|
|
|
@ -65,6 +65,8 @@ export function getPriceFromSubscription({subscription}) {
|
||||||
if (subscription && subscription.price) {
|
if (subscription && subscription.price) {
|
||||||
return {
|
return {
|
||||||
...subscription.price,
|
...subscription.price,
|
||||||
|
stripe_price_id: subscription.price.id,
|
||||||
|
id: subscription.price.price_id,
|
||||||
price: subscription.price.amount / 100,
|
price: subscription.price.amount / 100,
|
||||||
name: subscription.price.nickname,
|
name: subscription.price.nickname,
|
||||||
currency_symbol: getCurrencySymbol(subscription.price.currency)
|
currency_symbol: getCurrencySymbol(subscription.price.currency)
|
||||||
|
@ -103,6 +105,19 @@ export function hasPrice({site = {}, plan}) {
|
||||||
return false;
|
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) {
|
export function capitalize(str) {
|
||||||
if (typeof str !== 'string' || !str) {
|
if (typeof str !== 'string' || !str) {
|
||||||
return '';
|
return '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue