typography component integrated, fixed envelop icon, fixed wrong default message for configuration subtitle (#11567)

This commit is contained in:
ronronscelestes 2021-11-15 15:56:32 +01:00 committed by GitHub
parent 70da516801
commit df7ed74804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 29 deletions

View File

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { Stack } from '@strapi/design-system/Stack'; import { Stack } from '@strapi/design-system/Stack';
import { Grid, GridItem } from '@strapi/design-system/Grid'; import { Grid, GridItem } from '@strapi/design-system/Grid';
import { H3, Text } from '@strapi/design-system/Text'; import { Typography } from '@strapi/design-system/Typography';
import { TextInput } from '@strapi/design-system/TextInput'; import { TextInput } from '@strapi/design-system/TextInput';
import { Select, Option } from '@strapi/design-system/Select'; import { Select, Option } from '@strapi/design-system/Select';
import getTrad from '../../../utils/getTrad'; import getTrad from '../../../utils/getTrad';
@ -16,17 +16,18 @@ const Configuration = ({ config }) => {
return ( return (
<Stack size={4}> <Stack size={4}>
<Stack size={1}> <Stack size={1}>
<H3 as="h2"> <Typography variant="delta" as="h2">
{formatMessage({ {formatMessage({
id: getTrad('Settings.email.plugin.title.config'), id: getTrad('Settings.email.plugin.title.config'),
defaultMessage: 'Configuration', defaultMessage: 'Configuration',
})} })}
</H3> </Typography>
<Text> <Typography>
{formatMessage( {formatMessage(
{ {
id: getTrad('Settings.email.plugin.text.configuration'), id: getTrad('Settings.email.plugin.text.configuration'),
defaultMessage: 'Configuration', defaultMessage:
'The plugin is configured through the {file} file, checkout this {link} for the documentation.',
}, },
{ {
file: './config/plugins.js', file: './config/plugins.js',
@ -41,7 +42,7 @@ const Configuration = ({ config }) => {
), ),
} }
)} )}
</Text> </Typography>
</Stack> </Stack>
<Grid gap={5}> <Grid gap={5}>
<GridItem col={6} s={12}> <GridItem col={6} s={12}>

View File

@ -14,11 +14,11 @@ import { ContentLayout } from '@strapi/design-system/Layout';
import { Stack } from '@strapi/design-system/Stack'; import { Stack } from '@strapi/design-system/Stack';
import { Box } from '@strapi/design-system/Box'; import { Box } from '@strapi/design-system/Box';
import { Grid, GridItem } from '@strapi/design-system/Grid'; import { Grid, GridItem } from '@strapi/design-system/Grid';
import { H3 } from '@strapi/design-system/Text'; import { Typography } from '@strapi/design-system/Typography';
import { TextInput } from '@strapi/design-system/TextInput'; import { TextInput } from '@strapi/design-system/TextInput';
import { Button } from '@strapi/design-system/Button'; import { Button } from '@strapi/design-system/Button';
import { useNotifyAT } from '@strapi/design-system/LiveRegions'; import { useNotifyAT } from '@strapi/design-system/LiveRegions';
import Check from '@strapi/icons/Check'; import Envelop from '@strapi/icons/Envelop';
import Configuration from './components/Configuration'; import Configuration from './components/Configuration';
import schema from '../../utils/schema'; import schema from '../../utils/schema';
import pluginPermissions from '../../permissions'; import pluginPermissions from '../../permissions';
@ -172,12 +172,12 @@ const SettingsPage = () => {
paddingRight={7} paddingRight={7}
> >
<Stack size={4}> <Stack size={4}>
<H3 as="h2"> <Typography variant="delta" as="h2">
{formatMessage({ {formatMessage({
id: getTrad('Settings.email.plugin.title.test'), id: getTrad('Settings.email.plugin.title.test'),
defaultMessage: 'Send a test mail', defaultMessage: 'Send a test mail',
})} })}
</H3> </Typography>
<Grid gap={5} alignItems="end"> <Grid gap={5} alignItems="end">
<GridItem col={6} s={12}> <GridItem col={6} s={12}>
<TextInput <TextInput
@ -203,8 +203,7 @@ const SettingsPage = () => {
/> />
</GridItem> </GridItem>
<GridItem col={7} s={12}> <GridItem col={7} s={12}>
{/* to replace with envelope icon */} <Button loading={isSubmitting} type="submit" startIcon={<Envelop />}>
<Button loading={isSubmitting} type="submit" startIcon={<Check />}>
Test email Test email
</Button> </Button>
</GridItem> </GridItem>

View File

@ -541,6 +541,19 @@ describe('Email | Pages | Settings', () => {
margin-top: 4px; margin-top: 4px;
} }
.c11 {
color: #32324d;
font-weight: 500;
font-size: 1rem;
line-height: 1.25;
}
.c12 {
color: #32324d;
font-size: 0.875rem;
line-height: 1.43;
}
.c0 { .c0 {
outline: none; outline: none;
} }
@ -617,20 +630,6 @@ describe('Email | Pages | Settings', () => {
grid-column: span 7; grid-column: span 7;
} }
.c11 {
font-weight: 500;
font-size: 1rem;
line-height: 1.25;
color: #32324d;
}
.c12 {
font-weight: 400;
font-size: 0.875rem;
line-height: 1.43;
color: #32324d;
}
@media (max-width:68.75rem) { @media (max-width:68.75rem) {
.c14 { .c14 {
grid-column: span 12; grid-column: span 12;
@ -714,7 +713,15 @@ describe('Email | Pages | Settings', () => {
<span <span
class="c12" class="c12"
> >
Configuration The plugin is configured through the ./config/plugins.js file, checkout this
<a
href="https://strapi.io/documentation/developer-docs/latest/development/plugins/email.html#configure-the-plugin"
rel="noopener noreferrer"
target="_blank"
>
link
</a>
for the documentation.
</span> </span>
</div> </div>
<div <div
@ -959,8 +966,16 @@ describe('Email | Pages | Settings', () => {
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
> >
<path <path
d="M20.727 2.97a.2.2 0 01.286 0l2.85 2.89a.2.2 0 010 .28L9.554 20.854a.2.2 0 01-.285 0l-9.13-9.243a.2.2 0 010-.281l2.85-2.892a.2.2 0 01.284 0l6.14 6.209L20.726 2.97z" d="M0 2.8A.8.8 0 01.8 2h22.4a.8.8 0 01.8.8v2.71a1 1 0 01-1 1H1a1 1 0 01-1-1V2.8z"
fill="#212134" fill="#32324D"
/>
<path
d="M1.922 7.991C.197 6.675 0 6.252 0 5.289h23.953c.305 1.363-1.594 2.506-2.297 3.125-1.953 1.363-6.253 4.36-7.828 5.45-1.575 1.09-3.031.455-3.562 0-2.063-1.41-6.62-4.557-8.344-5.873zM22.8 18H1.2c-.663 0-1.2.471-1.2 1.053v1.894C0 21.529.537 22 1.2 22h21.6c.663 0 1.2-.471 1.2-1.053v-1.894c0-.582-.537-1.053-1.2-1.053z"
fill="#32324D"
/>
<path
d="M0 9.555v10.972h24V9.554c-2.633 1.95-8.367 6.113-9.96 7.166-1.595 1.052-3.352.438-4.032 0L0 9.555z"
fill="#32324D"
/> />
</svg> </svg>
</div> </div>