Skip to content

Commit

Permalink
chore(interfaces): remove React.FC references
Browse files Browse the repository at this point in the history
  • Loading branch information
poteirard committed Jul 8, 2022
1 parent c6993cf commit 7950e81
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/atoms/List/Item/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { HTMLAttributes, ReactNode } from 'react';
import styled from 'styled-components';
import Icon from '../../Icon/Icon';

interface ItemProps extends HTMLAttributes<HTMLLIElement> {
export interface ItemProps extends HTMLAttributes<HTMLLIElement> {
children?: React.ReactNode;
icon?: typeof Icon | ReactNode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';

import { useAccordionContext } from '../context';

interface AccordionSectionProps extends React.HTMLAttributes<HTMLDivElement> {
export interface AccordionSectionProps extends React.HTMLAttributes<HTMLDivElement> {
id: string;
index: number;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Card/CardHeading/CardHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { colors } from '../../../../constants';
import Heading, { OptionalHeadingProps, HeadingTags } from '../../../atoms/Heading/Heading';

interface CardHeadingProps extends OptionalHeadingProps {
export interface CardHeadingProps extends OptionalHeadingProps {
children?: React.ReactNode;
as?: HeadingTags;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Card/CardImage/CardImage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from 'react';
import styled from 'styled-components';

interface CardImageProps {
export interface CardImageProps {
/**
* url of the background image
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Tabs/TabButtons/TabButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FlexCol from '../../../layout/FlexCol/FlexCol';
import { useTabsContext } from '../hooks/useTabsContext';
import TabButton, { TabButtonProps } from '../TabButton/TabButton';

interface TabButtonsProps extends React.HTMLAttributes<HTMLDivElement> {
export interface TabButtonsProps extends React.HTMLAttributes<HTMLDivElement> {
tabButtons: TabButtonProps[];
defaultTab?: string;
'data-automation'?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Tabs/TabContent/TabContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
import styled from 'styled-components';
import { useTabsContext } from '../hooks/useTabsContext';

interface TabContentProps extends React.HTMLAttributes<HTMLDivElement> {
export interface TabContentProps extends React.HTMLAttributes<HTMLDivElement> {
children: ReactNode;
contentFor: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { colors } from '../../../../constants';
import { ErrorTemplateProps } from '../types';
import { StyledIcon, StyledLink } from '../styles';

interface FiveHundredErrorProps extends ErrorTemplateProps {
export interface FiveHundredErrorProps extends ErrorTemplateProps {
linkUrl?: string;
linkText?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { colors } from '../../../../constants';
import { ErrorTemplateProps } from '../types';
import { StyledIcon, StyledLink } from '../styles';

interface Four0FourErrorProps extends ErrorTemplateProps {
export interface Four0FourErrorProps extends ErrorTemplateProps {
linkUrl?: string;
linkText?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { HelpLine, HelpLineDetails } from '../../../molecules/Help/Help';
import { ErrorTemplateProps } from '../types';
import { StyledIcon } from '../styles';

interface MaintenanceFiveHundredErrorProps extends ErrorTemplateProps {
export interface MaintenanceFiveHundredErrorProps extends ErrorTemplateProps {
helpLine?: HelpLine;
}

Expand Down
17 changes: 7 additions & 10 deletions src/components/templates/ErrorPages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import Four0FourTemplate from './Four0Four/Four0Four';
import FiveHundredTemplate from './FiveHundred/FiveHundred';
import MaintenanceTemplate from './Maintenance/Maintenance';

interface ErrorTemplateStatic {
interface ErrorTemplateProps {
children: React.ReactNode;
Four0Four: typeof Four0FourTemplate;
FiveHundred: typeof FiveHundredTemplate;
Maintenance: typeof MaintenanceTemplate;
}

const ErrorTemplate = ({ children }: ErrorTemplateStatic) => <ErrorPageTemplate>{children}</ErrorPageTemplate>;
const ErrorTemplate = ({ children }: ErrorTemplateProps) => <ErrorPageTemplate>{children}</ErrorPageTemplate>;

ErrorTemplate.Four0Four = Four0FourTemplate;
ErrorTemplate.FiveHundred = FiveHundredTemplate;
ErrorTemplate.Maintenance = MaintenanceTemplate;

export default ErrorTemplate;
export default Object.assign(ErrorTemplate, {
Four0Four: Four0FourTemplate,
FiveHundred: FiveHundredTemplate,
Maintenance: MaintenanceTemplate,
});
1 change: 0 additions & 1 deletion tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"incremental": true,
"assumeChangesOnlyAffectDirectDependencies": true
},

"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.test.*"]
}

0 comments on commit 7950e81

Please sign in to comment.