Skip to content

Commit

Permalink
Fixed some flow errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Brown committed Mar 10, 2017
1 parent fcbcc70 commit 9ee399f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

; Ignore generated files from the android build
.*/android/app/build/.*

[include]

[libs]
Expand Down
2 changes: 1 addition & 1 deletion app/components/Avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import theme from '../../theme';
type Props = {
size?: number,
source: string,
style: Object | null | Array<Object | null>,
style?: mixed,
};

export default function Avatar({ size = 44, source, style, ...props }: Props) {
Expand Down
2 changes: 2 additions & 0 deletions app/components/Navbar/components/NavbarAndroid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import theme from '../../../../theme';

type Props = {
backgroundColor?: string,
buttonColor?: string,
leftButtonDisabled?: boolean,
leftButtonIconName?: string,
leftButtonOnPress?: () => mixed,
Expand All @@ -23,6 +24,7 @@ type Props = {
rightButtonIconName?: string,
rightButtonOnPress?: () => mixed,
rightButtonText?: string,
textColor?: string,
title: string,
titleRenderer?: () => mixed,
};
Expand Down
4 changes: 2 additions & 2 deletions app/scenes/Schedule/components/Talk/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function KeynoteSubtitle({ text, ...props }) {
// ==============================

type Props = {
keynote: boolean,
lightning: boolean,
keynote?: boolean,
lightning?: boolean,
onPress: () => mixed,
speaker: Object,
startTime: string,
Expand Down
31 changes: 16 additions & 15 deletions app/scenes/Talk/components/Pane/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from 'react-native';
import moment from 'moment';

import type { ScheduleTalk } from '../../../../types';
import type { ScheduleTalk, SpeakerType } from '../../../../types';

import { TIME_FORMAT } from '../../../../constants';
import { darken } from '../../../../utils/color';
Expand Down Expand Up @@ -44,20 +44,21 @@ function Speaker({ data, onPress }) {
);
}

export default class TalkPane extends Component {
props: {
nextTalk?: ScheduleTalk | null,
nextTalkPreviewIsEngaged?: boolean,
onHeroLayout?: (Object) => mixed,
onPressNext?: (Object) => mixed,
onScroll?: (Object) => mixed,
onScrollEndDrag?: () => mixed,
prevTalk?: ScheduleTalk | null,
prevTalkPreviewIsEngaged?: boolean,
showSpeakerModal?: () => mixed,
visibleTalk: ScheduleTalk,
};
type Props = {
nextTalk?: ScheduleTalk | null,
nextTalkPreviewIsEngaged?: boolean,
onHeroLayout?: (Object) => mixed,
onPressNext?: (Object) => mixed,
onScroll?: (Object) => mixed,
onScrollEndDrag?: () => mixed,
prevTalk?: ScheduleTalk | null,
prevTalkPreviewIsEngaged?: boolean,
showSpeakerModal: (SpeakerType | Array<SpeakerType>) => mixed,
visibleTalk: ScheduleTalk,
};

export default class TalkPane extends Component {
props: Props;
state = {
animValue: new Animated.Value(0),
};
Expand All @@ -67,7 +68,7 @@ export default class TalkPane extends Component {
this.fadeInAdroidNextButton();
}
}
componentWillReceiveProps(nextProps) {
componentWillReceiveProps(nextProps: Props) {
const isAndroid = Platform.OS === 'android';
const isNewTalk = (this.props.nextTalk && this.props.nextTalk.id) !==
(nextProps.nextTalk && nextProps.nextTalk.id);
Expand Down
16 changes: 8 additions & 8 deletions app/scenes/Talk/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import TalkPane from './components/Pane';

type Props = {
navigator: Object,
nextTalk: ScheduleTalk | null,
prevTalk: ScheduleTalk | null,
nextTalk?: ScheduleTalk,
prevTalk?: ScheduleTalk,
talk: ScheduleTalk,
introduceUI: boolean,
};
Expand All @@ -35,19 +35,19 @@ type TransitionDirection = 'prev' | 'next';
type State = {
animValue: Animated.Value,
modalIsOpen: boolean,
modalSpeaker: SpeakerType | null,
nextTalk: ScheduleTalk | null,
prevTalk: ScheduleTalk | null,
modalSpeaker?: SpeakerType,
nextTalk?: ScheduleTalk,
prevTalk?: ScheduleTalk,
showIntro: boolean,
talk: ScheduleTalk,
incomingTalk?: ScheduleTalk | null,
incomingTalk?: ScheduleTalk,
transitionDirection?: TransitionDirection,
};

type SetTalksState = {
talk: ScheduleTalk,
nextTalk: ScheduleTalk | null,
prevTalk: ScheduleTalk | null,
nextTalk?: ScheduleTalk,
prevTalk?: ScheduleTalk,
};

class Talk extends Component {
Expand Down
26 changes: 11 additions & 15 deletions app/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@ export type ScheduleTimeRange = {
end: Date,
};

export type SpeakerType = {
avatar: string,
github?: string,
name: string,
twitter?: string,
summary: string,
};

export type ScheduleTalk = {
id: string,
keynote: boolean,
lightning: boolean,
summary: string,
title: string,
speaker: {
avatar: string,
github?: string,
name: string,
twitter?: string,
summary: string,
},
speaker: SpeakerType | Array<SpeakerType>,
time: ScheduleTimeRange,
};

export type SpeakerType = {
avatar: string,
github: string,
name: string,
summary: string,
twitter: string,
};

export type ScheduleBreak = {
break: true,
time: ScheduleTimeRange,
Expand Down

0 comments on commit 9ee399f

Please sign in to comment.