Skip to content

Commit

Permalink
Added flow
Browse files Browse the repository at this point in the history
  • Loading branch information
souhe committed Feb 1, 2018
1 parent b36d553 commit 2aeb211
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 13 deletions.
32 changes: 32 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[ignore]
./dist/.*

[include]

[libs]

[options]
emoji=true

module.system=haste

munge_underscores=true

module.name_mapper='^expo$' -> 'emptyObject'
module.name_mapper='^react-navigation$' -> 'emptyObject'

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.64.0
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"cross-env": "^5.1.3",
"eslint": "^4.16.0",
"eslint-config-callstack-io": "^1.1.1",
"flow-bin": "^0.64.0",
"prettier": "^1.7.4",
"react": "^16.0.0",
"rollup": "^0.55.2",
Expand Down
13 changes: 1 addition & 12 deletions src/ThemeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { PureComponent, Children } from 'react';
import PropTypes from 'prop-types';
// import DefaultTheme from '../styles/DefaultTheme';
import type { Theme } from '../types/Theme';
import type { Theme } from './types/Theme';

type Props = {
children?: any,
Expand Down Expand Up @@ -62,14 +62,3 @@ export default class ThemeProvider extends PureComponent<Props> {
return Children.only(this.props.children);
}
}




withAuth = (method: Promise<*>) => (params) => {
method(params).then(data => {
if(error) {
api.refreshToken()
}
})
}
15 changes: 15 additions & 0 deletions src/types/Theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* @flow */

export type Theme = {
primaryColor: string,
primaryLightColor: string,
disabledColor: string,
backgroundColor: string,
barColor: string,
dividerColor: string,
textColor: string,
placeholderColor: string,
footnoteColor: string,
footnoteBackgroundColor: string,
positiveColor: string,
};
2 changes: 1 addition & 1 deletion src/withTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { channel } from './ThemeProvider';
import type { Theme } from '../types/Theme';
import type { Theme } from './types/Theme';

type State = {
theme: Theme,
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,10 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flow-bin@^0.64.0:
version "0.64.0"
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.64.0.tgz#ddd3fb3b183ab1ab35a5d5dec9caf5ebbcded167"

for-in@^1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
Expand Down

0 comments on commit 2aeb211

Please sign in to comment.