Skip to content

Commit 1c43ecd

Browse files
Reduce component filters
1 parent e0ae00f commit 1c43ecd

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/components/content-presentation/notification-banner/NotificationBanner.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ const NotificationBannerComponent = forwardRef<HTMLDivElement, NotificationBanne
4646
}),
4747
);
4848

49-
const headerElement = items.find((child) =>
50-
childIsOfComponentType(child, NotificationBannerHeading, {
51-
className: 'nhsuk-notification-banner__heading',
52-
}),
53-
);
54-
55-
const bodyItems = items.filter((child) => child !== titleElement && child !== headerElement);
49+
const contentItems = items.filter((child) => child !== titleElement);
5650

5751
if (instanceError) {
5852
throw instanceError;
@@ -79,8 +73,7 @@ const NotificationBannerComponent = forwardRef<HTMLDivElement, NotificationBanne
7973
)}
8074
</div>
8175
<div className={'nhsuk-notification-banner__content'} {...rest}>
82-
{headerElement}
83-
{bodyItems}
76+
{contentItems}
8477
</div>
8578
</div>
8679
);

0 commit comments

Comments
 (0)