mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
@@ -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>
|
||||
);
|
||||
@@ -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;
|
||||
@@ -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>
|
||||
@@ -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}
|
||||
@@ -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()}</>;
|
||||
@@ -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> {
|
||||
@@ -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> {
|
||||
@@ -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";
|
||||
|
||||
9
scm-ui/ui-components/src/layout/index.ts
Normal file
9
scm-ui/ui-components/src/layout/index.ts
Normal 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';
|
||||
Reference in New Issue
Block a user