Unverified Commit 2c6c8590 authored by Marcos Iglesias's avatar Marcos Iglesias Committed by GitHub

Swaps React.SFC for React.FC types (#536)

parent 8f0cf22c
...@@ -10,7 +10,7 @@ type CodeBlockProps = { ...@@ -10,7 +10,7 @@ type CodeBlockProps = {
text: string; text: string;
}; };
const CodeBlock: React.SFC<CodeBlockProps> = ({ text }: CodeBlockProps) => { const CodeBlock: React.FC<CodeBlockProps> = ({ text }: CodeBlockProps) => {
return ( return (
<CopyBlock <CopyBlock
text={text} text={text}
......
...@@ -14,12 +14,12 @@ import * as Constants from './constants'; ...@@ -14,12 +14,12 @@ import * as Constants from './constants';
import './styles.scss'; import './styles.scss';
export interface FeedbackProps { export interface FeedbackProps {
content?: React.SFC<any>; content?: React.FC<any>;
title?: string; title?: string;
} }
interface FeedbackState { interface FeedbackState {
content: React.SFC<any>; content: React.FC<any>;
feedbackType: FeedbackType; feedbackType: FeedbackType;
isOpen: boolean; isOpen: boolean;
} }
......
...@@ -9,7 +9,7 @@ import './styles.scss'; ...@@ -9,7 +9,7 @@ import './styles.scss';
import Breadcrumb from 'components/common/Breadcrumb'; import Breadcrumb from 'components/common/Breadcrumb';
const NotFoundPage: React.SFC<any> = () => { const NotFoundPage: React.FC<any> = () => {
return ( return (
<DocumentTitle title="404 Page Not Found - Amundsen"> <DocumentTitle title="404 Page Not Found - Amundsen">
<div className="container not-found-page"> <div className="container not-found-page">
......
...@@ -9,7 +9,7 @@ type SearchPanelProps = { ...@@ -9,7 +9,7 @@ type SearchPanelProps = {
children: React.ReactNode; children: React.ReactNode;
}; };
const SearchPanel: React.SFC = ({ children }: SearchPanelProps) => { const SearchPanel: React.FC = ({ children }: SearchPanelProps) => {
return ( return (
<aside className="search-control-panel"> <aside className="search-control-panel">
{React.Children.map(children, (child, index) => { {React.Children.map(children, (child, index) => {
......
...@@ -13,7 +13,7 @@ interface ColumnListProps { ...@@ -13,7 +13,7 @@ interface ColumnListProps {
editUrl?: string; editUrl?: string;
} }
const ColumnList: React.SFC<ColumnListProps> = ({ const ColumnList: React.FC<ColumnListProps> = ({
columns, columns,
editText, editText,
editUrl, editUrl,
......
...@@ -56,7 +56,7 @@ export function renderReader( ...@@ -56,7 +56,7 @@ export function renderReader(
); );
} }
const FrequentUsers: React.SFC<FrequentUsersProps> = ({ const FrequentUsers: React.FC<FrequentUsersProps> = ({
readers, readers,
}: FrequentUsersProps) => { }: FrequentUsersProps) => {
if (readers.length === 0) { if (readers.length === 0) {
......
...@@ -12,7 +12,7 @@ export interface LineageLinkProps { ...@@ -12,7 +12,7 @@ export interface LineageLinkProps {
tableData: TableMetadata; tableData: TableMetadata;
} }
const LineageLink: React.SFC<LineageLinkProps> = ({ const LineageLink: React.FC<LineageLinkProps> = ({
tableData, tableData,
}: LineageLinkProps) => { }: LineageLinkProps) => {
const config = AppConfig.tableLineage; const config = AppConfig.tableLineage;
......
...@@ -7,7 +7,7 @@ export interface ResourceReportProps { ...@@ -7,7 +7,7 @@ export interface ResourceReportProps {
resourceReports: ResourceReport[]; resourceReports: ResourceReport[];
} }
const TableReportsDropdown: React.SFC<ResourceReportProps> = ({ const TableReportsDropdown: React.FC<ResourceReportProps> = ({
resourceReports, resourceReports,
}: ResourceReportProps) => { }: ResourceReportProps) => {
if (resourceReports === null || resourceReports.length < 1) return null; if (resourceReports === null || resourceReports.length < 1) return null;
......
...@@ -11,7 +11,7 @@ export interface SourceLinkProps { ...@@ -11,7 +11,7 @@ export interface SourceLinkProps {
tableSource: TableSource; tableSource: TableSource;
} }
const SourceLink: React.SFC<SourceLinkProps> = ({ const SourceLink: React.FC<SourceLinkProps> = ({
tableSource, tableSource,
}: SourceLinkProps) => { }: SourceLinkProps) => {
if (tableSource === null || tableSource.source === null) return null; if (tableSource === null || tableSource.source === null) return null;
......
...@@ -15,7 +15,7 @@ export interface TableHeaderBulletsProps { ...@@ -15,7 +15,7 @@ export interface TableHeaderBulletsProps {
database: string; database: string;
} }
const TableHeaderBullets: React.SFC<TableHeaderBulletsProps> = ({ const TableHeaderBullets: React.FC<TableHeaderBulletsProps> = ({
cluster, cluster,
database, database,
}: TableHeaderBulletsProps) => { }: TableHeaderBulletsProps) => {
......
...@@ -12,7 +12,7 @@ export interface WriterLinkProps { ...@@ -12,7 +12,7 @@ export interface WriterLinkProps {
tableWriter: TableWriter; tableWriter: TableWriter;
} }
const WriterLink: React.SFC<WriterLinkProps> = ({ const WriterLink: React.FC<WriterLinkProps> = ({
tableWriter, tableWriter,
}: WriterLinkProps) => { }: WriterLinkProps) => {
if (tableWriter === null || tableWriter.application_url === null) { if (tableWriter === null || tableWriter.application_url === null) {
......
...@@ -14,7 +14,7 @@ export interface AvatarLabelProps { ...@@ -14,7 +14,7 @@ export interface AvatarLabelProps {
src?: string; src?: string;
} }
const AvatarLabel: React.SFC<AvatarLabelProps> = ({ const AvatarLabel: React.FC<AvatarLabelProps> = ({
avatarClass, avatarClass,
labelClass, labelClass,
label, label,
......
...@@ -11,7 +11,7 @@ export interface BadgeListProps { ...@@ -11,7 +11,7 @@ export interface BadgeListProps {
badges: Badge[]; badges: Badge[];
} }
const BadgeList: React.SFC<BadgeListProps> = ({ badges }: BadgeListProps) => { const BadgeList: React.FC<BadgeListProps> = ({ badges }: BadgeListProps) => {
return ( return (
<span className="badge-list"> <span className="badge-list">
{badges.map((badge, index) => { {badges.map((badge, index) => {
......
...@@ -24,7 +24,7 @@ type BreadcrumbDirection = 'left' | 'right'; ...@@ -24,7 +24,7 @@ type BreadcrumbDirection = 'left' | 'right';
export type BreadcrumbProps = OwnProps & MapDispatchToProps; export type BreadcrumbProps = OwnProps & MapDispatchToProps;
export const Breadcrumb: React.SFC<BreadcrumbProps> = ( export const Breadcrumb: React.FC<BreadcrumbProps> = (
props: BreadcrumbProps props: BreadcrumbProps
) => { ) => {
const { direction = 'left', path, text } = props; const { direction = 'left', path, text } = props;
......
...@@ -11,7 +11,7 @@ export interface EntityCardProps { ...@@ -11,7 +11,7 @@ export interface EntityCardProps {
sections: EntityCardSectionProps[]; sections: EntityCardSectionProps[];
} }
const EntityCard: React.SFC<EntityCardProps> = ({ const EntityCard: React.FC<EntityCardProps> = ({
sections, sections,
}: EntityCardProps) => { }: EntityCardProps) => {
const cardItems = sections.map((entry, index) => { const cardItems = sections.map((entry, index) => {
......
...@@ -33,7 +33,7 @@ export function convertText(str: string, caseType: string): string { ...@@ -33,7 +33,7 @@ export function convertText(str: string, caseType: string): string {
} }
} }
const Flag: React.SFC<FlagProps> = ({ const Flag: React.FC<FlagProps> = ({
caseType, caseType,
text, text,
labelStyle, labelStyle,
......
...@@ -12,7 +12,7 @@ export interface FlashMessageProps { ...@@ -12,7 +12,7 @@ export interface FlashMessageProps {
onClose: (event: React.MouseEvent<HTMLButtonElement>) => void; onClose: (event: React.MouseEvent<HTMLButtonElement>) => void;
} }
const FlashMessage: React.SFC<FlashMessageProps> = ({ const FlashMessage: React.FC<FlashMessageProps> = ({
iconClass, iconClass,
message, message,
onClose, onClose,
......
...@@ -19,7 +19,7 @@ export interface InfoButtonProps { ...@@ -19,7 +19,7 @@ export interface InfoButtonProps {
size?: string; size?: string;
} }
const InfoButton: React.SFC<InfoButtonProps> = ({ const InfoButton: React.FC<InfoButtonProps> = ({
title, title,
infoText, infoText,
placement, placement,
......
...@@ -15,7 +15,7 @@ export interface CheckBoxItemProps { ...@@ -15,7 +15,7 @@ export interface CheckBoxItemProps {
children: React.ReactNode; children: React.ReactNode;
} }
const CheckBoxItem: React.SFC<CheckBoxItemProps> = ({ const CheckBoxItem: React.FC<CheckBoxItemProps> = ({
checked = false, checked = false,
disabled = false, disabled = false,
name, name,
......
...@@ -12,7 +12,7 @@ export interface SchemaInfoProps { ...@@ -12,7 +12,7 @@ export interface SchemaInfoProps {
placement?: string; placement?: string;
} }
const SchemaInfo: React.SFC<SchemaInfoProps> = ({ const SchemaInfo: React.FC<SchemaInfoProps> = ({
schema, schema,
table, table,
desc, desc,
......
...@@ -14,7 +14,7 @@ export interface ResultItemProps { ...@@ -14,7 +14,7 @@ export interface ResultItemProps {
type: string; type: string;
} }
const ResultItem: React.SFC<ResultItemProps> = ({ const ResultItem: React.FC<ResultItemProps> = ({
href, href,
iconClass, iconClass,
id, id,
......
...@@ -8,7 +8,7 @@ import './styles.scss'; ...@@ -8,7 +8,7 @@ import './styles.scss';
const DEFAULT_REPETITION = 3; const DEFAULT_REPETITION = 3;
export const ShimmeringResourceItem: React.SFC = () => { export const ShimmeringResourceItem: React.FC = () => {
return ( return (
<div className="shimmer-resource-loader-item media"> <div className="shimmer-resource-loader-item media">
<div className="media-left media-middle"> <div className="media-left media-middle">
...@@ -26,7 +26,7 @@ export interface ShimmeringResourceLoaderProps { ...@@ -26,7 +26,7 @@ export interface ShimmeringResourceLoaderProps {
numItems?: number; numItems?: number;
} }
const ShimmeringResourceLoader: React.SFC<ShimmeringResourceLoaderProps> = ({ const ShimmeringResourceLoader: React.FC<ShimmeringResourceLoaderProps> = ({
numItems = DEFAULT_REPETITION, numItems = DEFAULT_REPETITION,
}: ShimmeringResourceLoaderProps) => { }: ShimmeringResourceLoaderProps) => {
return ( return (
......
...@@ -12,7 +12,7 @@ type ShimmeringTagItemProps = { ...@@ -12,7 +12,7 @@ type ShimmeringTagItemProps = {
index: number; index: number;
}; };
export const ShimmeringTagItem: React.SFC<ShimmeringTagItemProps> = ({ export const ShimmeringTagItem: React.FC<ShimmeringTagItemProps> = ({
index, index,
}: ShimmeringTagItemProps) => { }: ShimmeringTagItemProps) => {
return ( return (
...@@ -26,7 +26,7 @@ export interface ShimmeringTagListLoaderProps { ...@@ -26,7 +26,7 @@ export interface ShimmeringTagListLoaderProps {
numItems?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; numItems?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
} }
const ShimmeringTagListLoader: React.SFC<ShimmeringTagListLoaderProps> = ({ const ShimmeringTagListLoader: React.FC<ShimmeringTagListLoaderProps> = ({
numItems = DEFAULT_REPETITION, numItems = DEFAULT_REPETITION,
}: ShimmeringTagListLoaderProps) => { }: ShimmeringTagListLoaderProps) => {
return ( return (
......
...@@ -19,7 +19,7 @@ interface TabInfo { ...@@ -19,7 +19,7 @@ interface TabInfo {
title: string; title: string;
} }
const TabsComponent: React.SFC<TabsProps> = ({ const TabsComponent: React.FC<TabsProps> = ({
tabs, tabs,
activeKey, activeKey,
defaultTab, defaultTab,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment