Added static form to mailgun settings

refs. https://github.com/TryGhost/Team/issues/3151
This commit is contained in:
Peter Zimon 2023-05-19 17:03:44 +02:00
parent 2cbae2ec6d
commit eee65f82d5
3 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,18 @@
import type {Meta, StoryObj} from '@storybook/react';
import Hint from './Hint';
const meta = {
title: 'Global / Hint',
component: Hint,
tags: ['autodocs']
} satisfies Meta<typeof Hint>;
export default meta;
type Story = StoryObj<typeof Hint>;
export const Default: Story = {
args: {
children: 'This is a hint'
}
};

View File

@ -18,7 +18,7 @@ const Hint: React.FC<HintProps> = ({children, color, ...props}) => {
if (React.isValidElement(children)) { if (React.isValidElement(children)) {
return ( return (
<>{children}</> <span className={`mt-2 inline-block text-xs ${color ? `text-${color}` : `text-grey-700`}`} {...props}>{children}</span>
); );
} }

View File

@ -1,7 +1,9 @@
import Dropdown from '../../../admin-x-ds/global/Dropdown';
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 SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent'; import SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent';
import TextField from '../../../admin-x-ds/global/TextField';
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup'; import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
const MailGun: React.FC = () => { const MailGun: React.FC = () => {
@ -26,7 +28,26 @@ const MailGun: React.FC = () => {
const inputs = ( const inputs = (
<SettingGroupContent> <SettingGroupContent>
<div className='grid grid-cols-2 gap-6'>
<Dropdown
defaultSelectedOption='option-1'
options={[
{value: 'option-1', label: 'US'},
{value: 'option-2', label: 'EU'}
]}
title="Mailgun region"
onSelect={() => {}}
/>
<TextField
title='Mailgun domain'
/>
<div className='col-span-2'>
<TextField
hint={<>Find your Mailgun API keys<Link href="https://app.mailgun.com/app/account/security/api_keys" target="_blank">here</Link></>}
title='Mailgun private API key'
/>
</div>
</div>
</SettingGroupContent> </SettingGroupContent>
); );