Skip to content

Commit 081b895

Browse files
committed
Address further review comments
1 parent 6ebc628 commit 081b895

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ export interface NotificationBannerProps extends ComponentPropsWithoutRef<'div'>
2424
}
2525

2626
const NotificationBannerComponent = forwardRef<HTMLDivElement, NotificationBannerProps>(
27-
(
28-
{ children, className, title, titleId, success, role, disableAutoFocus, ...rest },
29-
forwardedRef,
30-
) => {
27+
(props, forwardedRef) => {
28+
const { children, className, title, titleId, success, role, disableAutoFocus, ...rest } = props;
3129
const [moduleRef] = useState(() => forwardedRef || createRef<HTMLDivElement>());
3230
const [instanceError, setInstanceError] = useState<Error>();
3331
const [instance, setInstance] = useState<NotificationBannerModule>();
@@ -68,6 +66,7 @@ const NotificationBannerComponent = forwardRef<HTMLDivElement, NotificationBanne
6866
data-disable-auto-focus={disableAutoFocus}
6967
ref={moduleRef}
7068
role={role || (success ? 'alert' : 'region')}
69+
{...rest}
7170
>
7271
<div className="nhsuk-notification-banner__header">
7372
{titleElement ? (
@@ -78,9 +77,7 @@ const NotificationBannerComponent = forwardRef<HTMLDivElement, NotificationBanne
7877
</NotificationBannerTitle>
7978
)}
8079
</div>
81-
<div className={'nhsuk-notification-banner__content'} {...rest}>
82-
{contentItems}
83-
</div>
80+
<div className={'nhsuk-notification-banner__content'}>{contentItems}</div>
8481
</div>
8582
);
8683
},

0 commit comments

Comments
 (0)