chore: Replace the deprecated SFC with FC

This commit is contained in:
Johannes Schill
2019-01-17 09:27:43 +01:00
parent 71121e1dbe
commit 1dfabf498a
24 changed files with 48 additions and 48 deletions

View File

@@ -1,4 +1,4 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
import Transition from 'react-transition-group/Transition';
interface Props {
@@ -8,7 +8,7 @@ interface Props {
unmountOnExit?: boolean;
}
export const FadeIn: SFC<Props> = props => {
export const FadeIn: FC<Props> = props => {
const defaultStyle = {
transition: `opacity ${props.duration}ms linear`,
opacity: 0,

View File

@@ -1,4 +1,4 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
import { Tooltip } from '@grafana/ui';
interface Props {
@@ -9,7 +9,7 @@ interface Props {
newGrafanaVersion: string;
}
export const Footer: SFC<Props> = React.memo(({appName, buildVersion, buildCommit, newGrafanaVersionExists, newGrafanaVersion}) => {
export const Footer: FC<Props> = React.memo(({appName, buildVersion, buildCommit, newGrafanaVersionExists, newGrafanaVersion}) => {
return (
<footer className="footer">
<div className="text-center">

View File

@@ -1,4 +1,4 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
export type LayoutMode = LayoutModes.Grid | LayoutModes.List;
@@ -12,7 +12,7 @@ interface Props {
onLayoutModeChanged: (mode: LayoutMode) => {};
}
const LayoutSelector: SFC<Props> = props => {
const LayoutSelector: FC<Props> = props => {
const { mode, onLayoutModeChanged } = props;
return (
<div className="layout-selector">

View File

@@ -1,10 +1,10 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
interface Props {
pageName?: string;
}
const PageLoader: SFC<Props> = ({ pageName }) => {
const PageLoader: FC<Props> = ({ pageName }) => {
const loadingText = `Loading ${pageName}...`;
return (
<div className="page-loader-wrapper">

View File

@@ -1,4 +1,4 @@
import React, { SFC, ReactNode, PureComponent } from 'react';
import React, { FC, ReactNode, PureComponent } from 'react';
import { Tooltip } from '@grafana/ui';
interface ToggleButtonGroupProps {
@@ -29,7 +29,7 @@ interface ToggleButtonProps {
tooltip?: string;
}
export const ToggleButton: SFC<ToggleButtonProps> = ({
export const ToggleButton: FC<ToggleButtonProps> = ({
children,
selected,
className = '',

View File

@@ -1,10 +1,10 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
export interface Props {
child: any;
}
const DropDownChild: SFC<Props> = props => {
const DropDownChild: FC<Props> = props => {
const { child } = props;
const listItemClassName = child.divider ? 'divider' : '';

View File

@@ -1,11 +1,11 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
import DropDownChild from './DropDownChild';
interface Props {
link: any;
}
const SideMenuDropDown: SFC<Props> = props => {
const SideMenuDropDown: FC<Props> = props => {
const { link } = props;
return (
<ul className="dropdown-menu dropdown-menu--sidemenu" role="menu">

View File

@@ -1,6 +1,6 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
const SignIn: SFC<any> = () => {
const SignIn: FC<any> = () => {
const loginUrl = `login?redirect=${encodeURIComponent(window.location.pathname)}`;
return (
<div className="sidemenu-item">

View File

@@ -1,9 +1,9 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
import _ from 'lodash';
import TopSectionItem from './TopSectionItem';
import config from '../../config';
const TopSection: SFC<any> = () => {
const TopSection: FC<any> = () => {
const navTree = _.cloneDeep(config.bootData.navTree);
const mainLinks = _.filter(navTree, item => !item.hideFromMenu);

View File

@@ -1,11 +1,11 @@
import React, { SFC } from 'react';
import React, { FC } from 'react';
import SideMenuDropDown from './SideMenuDropDown';
export interface Props {
link: any;
}
const TopSectionItem: SFC<Props> = props => {
const TopSectionItem: FC<Props> = props => {
const { link } = props;
return (
<div className="sidemenu-item dropdown">