Skip to content

Commit f8cc65e

Browse files
committed
reverted react.fc changes
1 parent a358bf7 commit f8cc65e

File tree

26 files changed

+66
-65
lines changed

26 files changed

+66
-65
lines changed

src/components/content-presentation/details/Details.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
1-
import React from 'react';
2-
import { HTMLProps } from 'react'
1+
import React, { HTMLProps, FC } from 'react';
32
import classNames from 'classnames';
43

54
interface DetailsProps extends HTMLProps<HTMLDetailsElement> {
65
expander?: boolean;
76
}
87

9-
interface Details extends React.FC<DetailsProps> {
10-
Summary: React.FC<HTMLProps<HTMLDivElement>>;
11-
Text: React.FC<HTMLProps<HTMLDivElement>>;
12-
ExpanderGroup: React.FC<HTMLProps<HTMLDivElement>>;
8+
interface Details extends FC<DetailsProps> {
9+
Summary: FC<HTMLProps<HTMLDivElement>>;
10+
Text: FC<HTMLProps<HTMLDivElement>>;
11+
ExpanderGroup: FC<HTMLProps<HTMLDivElement>>;
1312
}
1413

1514
// TODO: Check if standard NHS.UK polyfill "details.polyfill.js" is required
16-
const Details: Details = ({ className, expander, ...rest }: any) => (
15+
const Details: Details = ({ className, expander, ...rest }) => (
1716
<details
1817
className={classNames('nhsuk-details', { 'nhsuk-expander': expander }, className)}
1918
{...rest}
2019
/>
2120
);
2221

23-
const DetailsSummary: React.FC<HTMLProps<HTMLDivElement>> = ({ className, children, ...rest }) => (
22+
const DetailsSummary: FC<HTMLProps<HTMLDivElement>> = ({ className, children, ...rest }) => (
2423
<summary className={classNames('nhsuk-details__summary', className)} {...rest}>
2524
<span className="nhsuk-details__summary-text">{children}</span>
2625
</summary>
2726
);
2827

29-
const DetailsText: React.FC<HTMLProps<HTMLDivElement>> = ({ className, ...rest }) => (
28+
const DetailsText: FC<HTMLProps<HTMLDivElement>> = ({ className, ...rest }) => (
3029
<div className={classNames('nhsuk-details__text', className)} {...rest} />
3130
);
3231

33-
const ExpanderGroup: React.FC<HTMLProps<HTMLDivElement>> = ({ className, ...rest }) => (
32+
const ExpanderGroup: FC<HTMLProps<HTMLDivElement>> = ({ className, ...rest }) => (
3433
<div className={classNames('nhsuk-expander-group', className)} {...rest} />
3534
);
3635

src/components/content-presentation/do-and-dont-list/DoAndDontList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use client';
2-
import React, { createContext, useContext, HTMLProps } from 'react';
2+
import React, { createContext, useContext, HTMLProps, FC } from 'react';
33
import classNames from 'classnames';
44
import { Tick, Cross } from '@components/content-presentation/icons';
55
import HeadingLevel, { HeadingLevelType } from '@components/utils/HeadingLevel';
@@ -12,8 +12,8 @@ interface DoAndDontListProps extends HTMLProps<HTMLDivElement> {
1212
headingLevel?: HeadingLevelType;
1313
}
1414

15-
interface DoAndDontList extends React.FC<DoAndDontListProps> {
16-
Item: React.FC<DoAndDontItemProps>;
15+
interface DoAndDontList extends FC<DoAndDontListProps> {
16+
Item: FC<DoAndDontItemProps>;
1717
}
1818

1919
const DoAndDontListContext = createContext<ListType>('do');
@@ -49,7 +49,7 @@ interface DoAndDontItemProps extends HTMLProps<HTMLLIElement> {
4949
prefixText?: React.ReactNode;
5050
}
5151

52-
const DoAndDontItem: React.FC<DoAndDontItemProps> = ({ prefixText, listItemType, children, ...rest }) => {
52+
const DoAndDontItem: FC<DoAndDontItemProps> = ({ prefixText, listItemType, children, ...rest }) => {
5353
const listItem = useContext(DoAndDontListContext);
5454
const defaultPrefix = (listItemType || listItem) === 'do' ? null : 'do not ';
5555
const actualPrefix = prefixText === undefined ? defaultPrefix : prefixText;

src/components/content-presentation/hero/Hero.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { HTMLProps } from 'react';
1+
import React, { HTMLProps, FC } from 'react';
22
import classNames from 'classnames';
33
import { Container, Row, Col } from '../../layout';
44
import HeadingLevel, { HeadingLevelType } from '@components/utils/HeadingLevel';
@@ -7,7 +7,7 @@ interface HeroContentProps extends HTMLProps<HTMLDivElement> {
77
hasImage: boolean;
88
}
99

10-
const HeroContent: React.FC<HeroContentProps> = ({ children, hasImage }) => {
10+
const HeroContent: FC<HeroContentProps> = ({ children, hasImage }) => {
1111
if (!children) {
1212
return null;
1313
}
@@ -33,25 +33,25 @@ interface HeroHeadingProps extends HTMLProps<HTMLHeadingElement> {
3333
headingLevel?: HeadingLevelType;
3434
}
3535

36-
const HeroHeading: React.FC<HeroHeadingProps> = ({ className, headingLevel = 'h1', ...rest }) => (
36+
const HeroHeading: FC<HeroHeadingProps> = ({ className, headingLevel = 'h1', ...rest }) => (
3737
<HeadingLevel
3838
className={classNames('nhsuk-u-margin-bottom-3', className)}
3939
headingLevel={headingLevel}
4040
{...rest}
4141
/>
4242
);
4343

44-
const HeroText: React.FC<HTMLProps<HTMLParagraphElement>> = ({ className, ...rest }) => (
44+
const HeroText: FC<HTMLProps<HTMLParagraphElement>> = ({ className, ...rest }) => (
4545
<p className={classNames('nhsuk-body-l nhsuk-u-margin-bottom-0', className)} {...rest} />
4646
);
4747

4848
interface HeroProps extends HTMLProps<HTMLDivElement> {
4949
imageSrc?: string;
5050
}
5151

52-
interface Hero extends React.FC<HeroProps> {
53-
Heading: React.FC<HeroHeadingProps>;
54-
Text: React.FC<HTMLProps<HTMLParagraphElement>>;
52+
interface Hero extends FC<HeroProps> {
53+
Heading: FC<HeroHeadingProps>;
54+
Text: FC<HTMLProps<HTMLParagraphElement>>;
5555
}
5656

5757
const Hero: Hero = ({ className, children, imageSrc, ...rest }) => (

src/components/content-presentation/icons/individual/ArrowLeft.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ArrowLeft: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ArrowLeft: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__arrow-left" {...props}>
66
<path d="M4.1 12.3l2.7 3c.2.2.5.2.7 0 .1-.1.1-.2.1-.3v-2h11c.6 0 1-.4 1-1s-.4-1-1-1h-11V9c0-.2-.1-.4-.3-.5h-.2c-.1 0-.3.1-.4.2l-2.7 3c0 .2 0 .4.1.6z" />
77
</BaseIconSVG>

src/components/content-presentation/icons/individual/ArrowRight.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ArrowRight: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ArrowRight: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__arrow-right" {...props}>
66
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z" />
77
</BaseIconSVG>

src/components/content-presentation/icons/individual/ArrowRightCircle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ArrowRightCircle: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ArrowRightCircle: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__arrow-right-circle" {...props}>
66
<path d="M0 0h24v24H0z" fill="none" />
77
<path d="M12 2a10 10 0 0 0-9.95 9h11.64L9.74 7.05a1 1 0 0 1 1.41-1.41l5.66 5.65a1 1 0 0 1 0 1.42l-5.66 5.65a1 1 0 0 1-1.41 0 1 1 0 0 1 0-1.41L13.69 13H2.05A10 10 0 1 0 12 2z" />

src/components/content-presentation/icons/individual/ChevronDown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ChevronDown: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ChevronDown: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__chevron-down" {...props}>
66
<path d="M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z"></path>
77
</BaseIconSVG>

src/components/content-presentation/icons/individual/ChevronLeft.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ChevronLeft: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ChevronLeft: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__chevron-left" {...props}>
66
<path d="M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z" />
77
</BaseIconSVG>

src/components/content-presentation/icons/individual/ChevronRight.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22
import { BaseIconSVGProps, BaseIconSVG } from '../BaseIcon';
33

4-
export const ChevronRight: React.FC<BaseIconSVGProps> = (props) => (
4+
export const ChevronRight: FC<BaseIconSVGProps> = (props) => (
55
<BaseIconSVG iconType="nhsuk-icon__chevron-right" {...props}>
66
<path d="M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z" />
77
</BaseIconSVG>

src/components/content-presentation/icons/individual/ChevronRightCircle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
1+
import { FC } from 'react';
22

3-
export const ChevronRightCircle: React.FC = () => (
3+
export const ChevronRightCircle: FC = () => (
44
<svg
55
className="nhsuk-icon nhsuk-icon nhsuk-icon__chevron-right-circle"
66
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)