mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
Added static values to Admin X Settings
refs. https://github.com/TryGhost/Team/issues/3150
This commit is contained in:
parent
25ac93e7ca
commit
5800b63221
6 changed files with 115 additions and 8 deletions
|
@ -13,7 +13,7 @@ const SettingGroupHeader: React.FC<Props> = ({title, description, children}) =>
|
||||||
{(title || description) &&
|
{(title || description) &&
|
||||||
<div>
|
<div>
|
||||||
<Heading level={5}>{title}</Heading>
|
<Heading level={5}>{title}</Heading>
|
||||||
{description && <p className="max-w-lg text-sm">{description}</p>}
|
{description && <p className="mt-0.5 max-w-lg text-sm">{description}</p>}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
import SettingGroupInputs from '../../../admin-x-ds/settings/SettingGroupInputs';
|
||||||
|
import SettingGroupValues from '../../../admin-x-ds/settings/SettingGroupValues';
|
||||||
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
|
||||||
const DefaultRecipients: React.FC = () => {
|
const DefaultRecipients: React.FC = () => {
|
||||||
|
@ -9,14 +11,32 @@ const DefaultRecipients: React.FC = () => {
|
||||||
setCurrentState(newState);
|
setCurrentState(newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const values = (
|
||||||
|
<SettingGroupValues
|
||||||
|
values={[
|
||||||
|
{
|
||||||
|
heading: 'Default Newsletter recipients',
|
||||||
|
key: 'default-recipients',
|
||||||
|
value: 'Whoever has access to the post'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const inputs = (
|
||||||
|
<SettingGroupInputs>
|
||||||
|
|
||||||
|
</SettingGroupInputs>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup
|
<SettingGroup
|
||||||
description='When you publish new content, who do you usually want to send it to?'
|
description='When you publish new content, who do you usually want to send it to?'
|
||||||
state={currentState}
|
state={currentState}
|
||||||
title='Make site private'
|
title='Default recipients'
|
||||||
onStateChange={handleStateChange}
|
onStateChange={handleStateChange}
|
||||||
>
|
>
|
||||||
Values and inputs
|
{currentState === 'view' ? values : inputs}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import Link from '../../../admin-x-ds/global/Link';
|
import Link from '../../../admin-x-ds/global/Link';
|
||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
import SettingGroupInputs from '../../../admin-x-ds/settings/SettingGroupInputs';
|
||||||
|
import SettingGroupValues from '../../../admin-x-ds/settings/SettingGroupValues';
|
||||||
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
|
||||||
const MailGun: React.FC = () => {
|
const MailGun: React.FC = () => {
|
||||||
|
@ -10,14 +12,33 @@ const MailGun: React.FC = () => {
|
||||||
setCurrentState(newState);
|
setCurrentState(newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const values = (
|
||||||
|
<SettingGroupValues
|
||||||
|
columns={2}
|
||||||
|
values={[
|
||||||
|
{
|
||||||
|
heading: 'Status',
|
||||||
|
key: 'status',
|
||||||
|
value: 'Mailgun is not set up'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const inputs = (
|
||||||
|
<SettingGroupInputs>
|
||||||
|
|
||||||
|
</SettingGroupInputs>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup
|
<SettingGroup
|
||||||
description={<>The Mailgun API is used for bulk email newsletter delivery. <Link href='https://ghost.org/docs/faq/mailgun-newsletters/' target='_blank'>Why is this required?</Link></>}
|
description={<>The Mailgun API is used for bulk email newsletter delivery. <Link href='https://ghost.org/docs/faq/mailgun-newsletters/' target='_blank'>Why is this required?</Link></>}
|
||||||
state={currentState}
|
state={currentState}
|
||||||
title='Make site private'
|
title='Mailgun'
|
||||||
onStateChange={handleStateChange}
|
onStateChange={handleStateChange}
|
||||||
>
|
>
|
||||||
Values and inputs
|
{currentState === 'view' ? values : inputs}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ const SocialAccounts: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
placeholder="https://twitter.com/ghost"
|
placeholder="https://twitter.com/ghost"
|
||||||
title="URL of your TWITTER PROFILE"
|
title="URL of your Twitter profile"
|
||||||
value="https://twitter.com/ghost"
|
value="https://twitter.com/ghost"
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
import SettingGroupInputs from '../../../admin-x-ds/settings/SettingGroupInputs';
|
||||||
|
import SettingGroupValues from '../../../admin-x-ds/settings/SettingGroupValues';
|
||||||
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
|
||||||
const Access: React.FC = () => {
|
const Access: React.FC = () => {
|
||||||
|
@ -9,6 +11,34 @@ const Access: React.FC = () => {
|
||||||
setCurrentState(newState);
|
setCurrentState(newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const values = (
|
||||||
|
<SettingGroupValues
|
||||||
|
values={[
|
||||||
|
{
|
||||||
|
heading: 'Subscription access',
|
||||||
|
key: 'subscription-access',
|
||||||
|
value: 'Anyone'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: 'Default post access',
|
||||||
|
key: 'default-post-access',
|
||||||
|
value: 'Public'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: 'Commenting',
|
||||||
|
key: 'commenting',
|
||||||
|
value: 'Nobody'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const inputs = (
|
||||||
|
<SettingGroupInputs>
|
||||||
|
|
||||||
|
</SettingGroupInputs>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup
|
<SettingGroup
|
||||||
description='Set up default access options for subscription and posts'
|
description='Set up default access options for subscription and posts'
|
||||||
|
@ -16,7 +46,7 @@ const Access: React.FC = () => {
|
||||||
title='Access'
|
title='Access'
|
||||||
onStateChange={handleStateChange}
|
onStateChange={handleStateChange}
|
||||||
>
|
>
|
||||||
Values and inputs
|
{currentState === 'view' ? values : inputs}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
import SettingGroupInputs from '../../../admin-x-ds/settings/SettingGroupInputs';
|
||||||
|
import SettingGroupValues from '../../../admin-x-ds/settings/SettingGroupValues';
|
||||||
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
||||||
|
|
||||||
const Analytics: React.FC = () => {
|
const Analytics: React.FC = () => {
|
||||||
|
@ -9,6 +11,40 @@ const Analytics: React.FC = () => {
|
||||||
setCurrentState(newState);
|
setCurrentState(newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const values = (
|
||||||
|
<SettingGroupValues
|
||||||
|
columns={2}
|
||||||
|
values={[
|
||||||
|
{
|
||||||
|
heading: 'Newsletter opens',
|
||||||
|
key: 'opens',
|
||||||
|
value: 'Enabled'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: 'Newsletter clicks',
|
||||||
|
key: 'clicks',
|
||||||
|
value: 'Enabled'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: 'Member sources',
|
||||||
|
key: 'sources',
|
||||||
|
value: 'Disabled'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: 'Outbound link tagging',
|
||||||
|
key: 'taggin',
|
||||||
|
value: 'Enabled'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const inputs = (
|
||||||
|
<SettingGroupInputs>
|
||||||
|
|
||||||
|
</SettingGroupInputs>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup
|
<SettingGroup
|
||||||
description='Decide what data you collect from your members'
|
description='Decide what data you collect from your members'
|
||||||
|
@ -16,7 +52,7 @@ const Analytics: React.FC = () => {
|
||||||
title='Analytics'
|
title='Analytics'
|
||||||
onStateChange={handleStateChange}
|
onStateChange={handleStateChange}
|
||||||
>
|
>
|
||||||
Values and inputs
|
{currentState === 'view' ? values : inputs}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue