Skip to content

Commit 23382a6

Browse files
committed
CCM-11496: refactor content
1 parent bdb7f2b commit 23382a6

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

frontend/src/components/forms/MessagePlan/MessagePlan.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useTextInput } from '@hooks/use-text-input.hook';
1515
import { NHSNotifyFormWrapper } from '@molecules/NHSNotifyFormWrapper/NHSNotifyFormWrapper';
1616
import content from '@content/content';
1717
import { useNHSNotifyForm } from '@providers/form-provider';
18+
import { ContentRenderer } from '@molecules/ContentRenderer/ContentRenderer';
1819

1920
const formContent = content.components.messagePlanForm;
2021

@@ -53,16 +54,7 @@ export function MessagePlanForm({
5354
{formContent.fields.name.details.summary}
5455
</Details.Summary>
5556
<Details.Text>
56-
<p>{formContent.fields.name.details.text.main}</p>
57-
<p>{formContent.fields.name.details.text.commonNames.main}</p>
58-
<ul className='nhsuk-list nhsuk-list--bullet'>
59-
{formContent.fields.name.details.text.commonNames.list.map(
60-
(item) => (
61-
<li key={item}>{item}</li>
62-
)
63-
)}
64-
</ul>
65-
<p>{formContent.fields.name.details.text.commonNames.example}</p>
57+
<ContentRenderer content={formContent.fields.name.details.text} />
6658
</Details.Text>
6759
</Details>
6860
<TextInput

frontend/src/content/content.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,20 +1276,32 @@ const messagePlanForm = {
12761276
hint: 'This will not be visible to recipients.',
12771277
details: {
12781278
summary: 'Naming your message plans',
1279-
text: {
1280-
main: 'You should name your message plans in a way that works best for your service or organisation.',
1281-
commonNames: {
1282-
main: 'Common message plan names include the:',
1283-
list: [
1279+
text: [
1280+
{
1281+
type: 'text',
1282+
text: 'You should name your message plans in a way that works best for your service or organisation.',
1283+
},
1284+
{
1285+
type: 'text',
1286+
text: 'Common message plan names include the:',
1287+
},
1288+
{
1289+
type: 'text',
1290+
text: markdownList('ul', [
12841291
'channels it uses',
12851292
'subject or reason for the message',
12861293
'intended audience for the message',
12871294
'version number',
1288-
],
1289-
example:
1290-
"For example, 'Email, SMS, letter - covid19 2023 - over 65s - version 3'",
1295+
]),
1296+
overrides: {
1297+
ul: { props: { className: 'nhsuk-list nhsuk-list--bullet' } },
1298+
},
12911299
},
1292-
},
1300+
{
1301+
type: 'text',
1302+
text: "For example, 'Email, SMS, letter - covid19 2023 - over 65s - version 3'",
1303+
},
1304+
] satisfies ContentBlock[],
12931305
},
12941306
},
12951307
campaignId: {

0 commit comments

Comments
 (0)