mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
Swapped blog -> site
- this is our preferred wording
This commit is contained in:
parent
af543c0cc9
commit
e9a193445d
@ -12,9 +12,9 @@ export default class ParentContainer extends React.Component {
|
||||
super(props);
|
||||
console.log('Initialized script with data', props.data);
|
||||
|
||||
// Setup Members API with blog/admin URLs
|
||||
const {blogUrl, adminUrl} = props.data.site;
|
||||
this.MembersAPI = setupMembersApi({blogUrl, adminUrl});
|
||||
// Setup Members API with site/admin URLs
|
||||
const {siteUrl, adminUrl} = props.data.site;
|
||||
this.MembersAPI = setupMembersApi({siteUrl, adminUrl});
|
||||
|
||||
// Setup custom trigger button handling
|
||||
this.customTriggerButton = document.querySelector('[data-members-trigger-button]');
|
||||
|
@ -73,14 +73,14 @@ export default class PopupMenuComponent extends React.Component {
|
||||
marginBottom: '12px'
|
||||
};
|
||||
|
||||
const blogTitle = (this.props.data.site && this.props.data.site.title) || 'Site Title';
|
||||
const blogDescription = (this.props.data.site && this.props.data.site.description) || 'Site Description';
|
||||
const siteTitle = (this.props.data.site && this.props.data.site.title) || 'Site Title';
|
||||
const siteDescription = (this.props.data.site && this.props.data.site.description) || 'Site Description';
|
||||
return (
|
||||
<div style={{display: 'flex', flexDirection: 'column', color: '#313131'}}>
|
||||
<div style={{paddingLeft: '16px', paddingRight: '16px', paddingTop: '12px', cursor: 'pointer'}}>
|
||||
<div style={{display: 'flex', flexDirection: 'column', alignItems: 'center', marginBottom: '12px'}}>
|
||||
<div style={{fontSize: '18px', fontWeight: 'bold'}}> Signup/Signin to {blogTitle}</div>
|
||||
<div>{blogDescription} </div>
|
||||
<div style={{fontSize: '18px', fontWeight: 'bold'}}> Signup/Signin to {siteTitle}</div>
|
||||
<div>{siteDescription} </div>
|
||||
</div>
|
||||
<div style={{display: 'flex', flexDirection: 'column', alignItems: 'center', marginBottom: '12px'}}>
|
||||
<input
|
||||
|
@ -13,7 +13,7 @@ function initMembersJS(data) {
|
||||
}
|
||||
|
||||
// Uncomment for local UI testing
|
||||
// initMembersJS({site: {blogUrl: "", adminUrl: ""}});
|
||||
// initMembersJS({site: {siteUrl: "", adminUrl: ""}});
|
||||
|
||||
window.GhostMembers = {
|
||||
initMembersJS: initMembersJS
|
||||
|
@ -1,6 +1,6 @@
|
||||
function createSignoutApi(blogUrl) {
|
||||
function createSignoutApi(siteUrl) {
|
||||
return function () {
|
||||
fetch(`${blogUrl}/members/ssr`, {
|
||||
fetch(`${siteUrl}/members/ssr`, {
|
||||
method: 'DELETE'
|
||||
}).then(function (res) {
|
||||
if (res.ok) {
|
||||
@ -35,9 +35,9 @@ function createSendMagicLinkApi(adminUrl) {
|
||||
};
|
||||
}
|
||||
|
||||
function createCheckoutPlanApi(blogUrl) {
|
||||
function createCheckoutPlanApi(siteUrl) {
|
||||
return function ({plan, checkoutCancelUrl, checkoutSuccessUrl}) {
|
||||
fetch(`${blogUrl}/members/ssr`, {
|
||||
fetch(`${siteUrl}/members/ssr`, {
|
||||
credentials: 'same-origin'
|
||||
}).then(function (res) {
|
||||
if (!res.ok) {
|
||||
@ -77,12 +77,12 @@ function createCheckoutPlanApi(blogUrl) {
|
||||
};
|
||||
}
|
||||
|
||||
/** blogUrl and adminUrl are being passed by theme */
|
||||
function setupMembersApi({blogUrl, adminUrl}) {
|
||||
/** siteUrl and adminUrl are being passed by theme */
|
||||
function setupMembersApi({siteUrl, adminUrl}) {
|
||||
return {
|
||||
sendMagicLink: createSendMagicLinkApi(adminUrl),
|
||||
signout: createSignoutApi(blogUrl),
|
||||
checkoutPlan: createCheckoutPlanApi(blogUrl)
|
||||
signout: createSignoutApi(siteUrl),
|
||||
checkoutPlan: createCheckoutPlanApi(siteUrl)
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user