Converted a couple of components to flow-types
This commit is contained in:
@ -1,8 +1,13 @@
|
|||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import styles from './CenteredContent.scss';
|
import styles from './CenteredContent.scss';
|
||||||
|
|
||||||
const CenteredContent = props => {
|
type Props = {
|
||||||
|
children: any,
|
||||||
|
style: Object,
|
||||||
|
};
|
||||||
|
|
||||||
|
const CenteredContent = (props: Props) => {
|
||||||
const style = {
|
const style = {
|
||||||
maxWidth: props.maxWidth,
|
maxWidth: props.maxWidth,
|
||||||
...props.style,
|
...props.style,
|
||||||
@ -19,9 +24,4 @@ CenteredContent.defaultProps = {
|
|||||||
maxWidth: '740px',
|
maxWidth: '740px',
|
||||||
};
|
};
|
||||||
|
|
||||||
CenteredContent.propTypes = {
|
|
||||||
children: React.PropTypes.node.isRequired,
|
|
||||||
style: React.PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CenteredContent;
|
export default CenteredContent;
|
||||||
|
@ -1,27 +1,24 @@
|
|||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import type { Document } from '../../../types';
|
||||||
import DocumentPreview from 'components/DocumentPreview';
|
import DocumentPreview from 'components/DocumentPreview';
|
||||||
import Divider from 'components/Divider';
|
import Divider from 'components/Divider';
|
||||||
|
|
||||||
import styles from './DocumentList.scss';
|
|
||||||
|
|
||||||
class DocumentList extends React.Component {
|
class DocumentList extends React.Component {
|
||||||
static propTypes = {
|
props: {
|
||||||
documents: React.PropTypes.arrayOf(React.PropTypes.object),
|
documents: Array<Document>,
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{this.props.documents &&
|
{this.props.documents &&
|
||||||
this.props.documents.map(document => {
|
this.props.documents.map(document => (
|
||||||
return (
|
|
||||||
<div>
|
<div>
|
||||||
<DocumentPreview document={document} />
|
<DocumentPreview document={document} />
|
||||||
<Divider />
|
<Divider />
|
||||||
</div>
|
</div>
|
||||||
);
|
))}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { observer, inject } from 'mobx-react';
|
import { observer, inject } from 'mobx-react';
|
||||||
|
import type { User } from '../../../types';
|
||||||
|
|
||||||
@inject('user')
|
@inject('user')
|
||||||
@observer
|
@observer
|
||||||
class SlackAuthLink extends React.Component {
|
class SlackAuthLink extends React.Component {
|
||||||
static propTypes = {
|
props: {
|
||||||
children: React.PropTypes.node.isRequired,
|
children: any,
|
||||||
scopes: React.PropTypes.arrayOf(React.PropTypes.string),
|
scopes: Array<string>,
|
||||||
user: React.PropTypes.object.isRequired,
|
user: User,
|
||||||
redirectUri: React.PropTypes.string,
|
redirectUri: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
import stores from 'stores';
|
|
||||||
|
|
||||||
import constants from '../constants';
|
import constants from '../constants';
|
||||||
|
import stores from 'stores';
|
||||||
|
|
||||||
const isIterable = object =>
|
const isIterable = object =>
|
||||||
object != null && typeof object[Symbol.iterator] === 'function';
|
object != null && typeof object[Symbol.iterator] === 'function';
|
||||||
|
Reference in New Issue
Block a user