use reflow to migrate from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-19 16:38:07 +02:00
parent f7b8050dfa
commit 6e7a08a3bb
495 changed files with 14239 additions and 13766 deletions

View File

@@ -1,22 +1,23 @@
//@flow
import React from "react";
import type { Me } from "@scm-manager/ui-types";
import {Link} from "react-router-dom";
import React from 'react';
import { Me } from '@scm-manager/ui-types';
import { Link } from 'react-router-dom';
type Props = {
me?: Me
me?: Me;
};
class Footer extends React.Component<Props> {
render() {
const { me } = this.props;
if (!me) {
return "";
return '';
}
return (
<footer className="footer">
<div className="container is-centered">
<p className="has-text-centered"><Link to={"/me"}>{me.displayName}</Link></p>
<p className="has-text-centered">
<Link to={'/me'}>{me.displayName}</Link>
</p>
</div>
</footer>
);

View File

@@ -1,31 +1,30 @@
//@flow
import * as React from "react";
import Logo from "./../Logo";
type Props = {
children?: React.Node
};
class Header extends React.Component<Props> {
render() {
const { children } = this.props;
return (
<section className="hero is-dark is-small">
<div className="hero-body">
<div className="container">
<div className="columns is-vcentered">
<div className="column">
<Logo />
</div>
</div>
</div>
</div>
<div className="hero-foot">
<div className="container">{children}</div>
</div>
</section>
);
}
}
export default Header;
import * as React from 'react';
import Logo from './../Logo';
type Props = {
children?: React.Node;
};
class Header extends React.Component<Props> {
render() {
const { children } = this.props;
return (
<section className="hero is-dark is-small">
<div className="hero-body">
<div className="container">
<div className="columns is-vcentered">
<div className="column">
<Logo />
</div>
</div>
</div>
</div>
<div className="hero-foot">
<div className="container">{children}</div>
</div>
</section>
);
}
}
export default Header;

View File

@@ -1,18 +1,17 @@
//@flow
import * as React from "react";
import classNames from "classnames";
import * as React from 'react';
import classNames from 'classnames';
type Props = {
className?: string,
left?: React.Node,
right?: React.Node
className?: string;
left?: React.Node;
right?: React.Node;
};
export default class Level extends React.Component<Props> {
render() {
const { className, left, right } = this.props;
return (
<div className={classNames("level", className)}>
<div className={classNames('level', className)}>
<div className="level-left">{left}</div>
<div className="level-right">{right}</div>
</div>

View File

@@ -1,21 +1,20 @@
//@flow
import * as React from "react";
import classNames from "classnames";
import styled from "styled-components";
import Loading from "./../Loading";
import ErrorNotification from "./../ErrorNotification";
import Title from "./Title";
import Subtitle from "./Subtitle";
import PageActions from "./PageActions";
import ErrorBoundary from "../ErrorBoundary";
import * as React from 'react';
import classNames from 'classnames';
import styled from 'styled-components';
import Loading from './../Loading';
import ErrorNotification from './../ErrorNotification';
import Title from './Title';
import Subtitle from './Subtitle';
import PageActions from './PageActions';
import ErrorBoundary from '../ErrorBoundary';
type Props = {
title?: string,
subtitle?: string,
loading?: boolean,
error?: Error,
showContentOnError?: boolean,
children: React.Node
title?: string;
subtitle?: string;
loading?: boolean;
error?: Error;
showContentOnError?: boolean;
children: React.Node;
};
const PageActionContainer = styled.div`
@@ -62,10 +61,10 @@ export default class Page extends React.Component<Props> {
pageActions = (
<PageActionContainer
className={classNames(
"column",
"is-three-fifths",
"is-mobile-action-spacing",
"is-flex"
'column',
'is-three-fifths',
'is-mobile-action-spacing',
'is-flex',
)}
>
{child}

View File

@@ -1,15 +1,14 @@
//@flow
import * as React from "react";
import Loading from "./../Loading";
import * as React from 'react';
import Loading from './../Loading';
type Props = {
loading?: boolean,
error?: Error,
children: React.Node
loading?: boolean;
error?: Error;
children: React.Node;
};
export default class PageActions extends React.Component<Props> {
static displayName = "PageActions";
static displayName = 'PageActions';
render() {
return <>{this.renderContent()}</>;

View File

@@ -1,8 +1,7 @@
// @flow
import React from "react";
import React from 'react';
type Props = {
subtitle?: string
subtitle?: string;
};
class Subtitle extends React.Component<Props> {

View File

@@ -1,8 +1,7 @@
// @flow
import React from "react";
import React from 'react';
type Props = {
title?: string
title?: string;
};
class Title extends React.Component<Props> {

View File

@@ -1,10 +0,0 @@
// @create-index
export { default as Footer } from "./Footer.js";
export { default as Header } from "./Header.js";
export { default as Level } from "./Level.js";
export { default as Page } from "./Page.js";
export { default as PageActions } from "./PageActions.js";
export { default as Subtitle } from "./Subtitle.js";
export { default as Title } from "./Title.js";

View File

@@ -0,0 +1,9 @@
// @create-index
export { default as Footer } from './Footer';
export { default as Header } from './Header';
export { default as Level } from './Level';
export { default as Page } from './Page';
export { default as PageActions } from './PageActions';
export { default as Subtitle } from './Subtitle';
export { default as Title } from './Title';