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