Skip to content

Commit e23ace2

Browse files
authored
Merge branch 'master' into feature/tjc-dateInputErrorBehaviour
2 parents 5fdd3fa + 2e713da commit e23ace2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/components/header/components/NHSLogo.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import React, { useContext, HTMLProps } from 'react';
1+
import React, { useContext, HTMLProps, SVGProps } from 'react';
22
import classNames from 'classnames';
33
import HeaderContext, { IHeaderContext } from '../HeaderContext';
44

5+
interface SVGImageWithSrc extends SVGProps<SVGImageElement> {
6+
src: string;
7+
}
8+
9+
const SVGImageWithSrc: React.FC<SVGImageWithSrc> = props => <image {...props} />;
10+
511
const NHSLogo: React.FC<HTMLProps<HTMLAnchorElement>> = ({ className, alt, ...rest }) => {
612
const { serviceName, hasMenuToggle, hasSearch } = useContext<IHeaderContext>(HeaderContext);
713
return (
@@ -21,7 +27,7 @@ const NHSLogo: React.FC<HTMLProps<HTMLAnchorElement>> = ({ className, alt, ...re
2127
<svg
2228
className="nhsuk-logo"
2329
xmlns="http://www.w3.org/2000/svg"
24-
role="presentation"
30+
role="img"
2531
focusable="false"
2632
viewBox="0 0 40 16"
2733
aria-labelledby="nhsuk-logo_title"
@@ -32,7 +38,7 @@ const NHSLogo: React.FC<HTMLProps<HTMLAnchorElement>> = ({ className, alt, ...re
3238
className="nhsuk-logo__text"
3339
d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"
3440
/>
35-
<img src="https://assets.nhs.uk/images/nhs-logo.png" alt={alt} />
41+
<SVGImageWithSrc src="https://assets.nhs.uk/images/nhs-logo.png" xlinkHref="" />
3642
</svg>
3743
{serviceName ? <span className="nhsuk-header__service-name">{serviceName}</span> : null}
3844
</a>

src/components/header/components/OrganisationalLogo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ const OrganisationalLogo: React.FC<OrganisationalLogoProps> = ({ logoUrl, alt, .
1717
<svg
1818
className="nhsuk-logo"
1919
xmlns="http://www.w3.org/2000/svg"
20-
role="presentation"
20+
role="img"
2121
focusable="false"
2222
viewBox="0 0 40 16"
23+
aria-labelledby="nhsuk-logo_title"
2324
>
25+
<title id="nhsuk-logo_title">{alt}</title>
2426
<path className="nhsuk-logo__background" d="M0 0h40v16H0z"></path>
2527
<path
2628
className="nhsuk-logo__text"

0 commit comments

Comments
 (0)