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 38b22c0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
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 38b22c0

Please sign in to comment.