diff --git a/.flowconfig b/.flowconfig index 3cf493d..7dd029c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -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] diff --git a/app/components/Avatar/index.js b/app/components/Avatar/index.js index 906caa6..93a5a54 100644 --- a/app/components/Avatar/index.js +++ b/app/components/Avatar/index.js @@ -7,7 +7,7 @@ import theme from '../../theme'; type Props = { size?: number, source: string, - style: Object | null | Array, + style?: mixed, }; export default function Avatar({ size = 44, source, style, ...props }: Props) { diff --git a/app/components/Navbar/components/NavbarAndroid/index.js b/app/components/Navbar/components/NavbarAndroid/index.js index 4657273..7e12f74 100644 --- a/app/components/Navbar/components/NavbarAndroid/index.js +++ b/app/components/Navbar/components/NavbarAndroid/index.js @@ -15,6 +15,7 @@ import theme from '../../../../theme'; type Props = { backgroundColor?: string, + buttonColor?: string, leftButtonDisabled?: boolean, leftButtonIconName?: string, leftButtonOnPress?: () => mixed, @@ -23,6 +24,7 @@ type Props = { rightButtonIconName?: string, rightButtonOnPress?: () => mixed, rightButtonText?: string, + textColor?: string, title: string, titleRenderer?: () => mixed, }; diff --git a/app/scenes/Schedule/components/Talk/index.js b/app/scenes/Schedule/components/Talk/index.js index a742c1f..fe64302 100644 --- a/app/scenes/Schedule/components/Talk/index.js +++ b/app/scenes/Schedule/components/Talk/index.js @@ -85,8 +85,8 @@ function KeynoteSubtitle({ text, ...props }) { // ============================== type Props = { - keynote: boolean, - lightning: boolean, + keynote?: boolean, + lightning?: boolean, onPress: () => mixed, speaker: Object, startTime: string, diff --git a/app/scenes/Talk/components/Pane/index.js b/app/scenes/Talk/components/Pane/index.js index 7f3ae70..358a81e 100644 --- a/app/scenes/Talk/components/Pane/index.js +++ b/app/scenes/Talk/components/Pane/index.js @@ -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'; @@ -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) => mixed, + visibleTalk: ScheduleTalk, +}; +export default class TalkPane extends Component { + props: Props; state = { animValue: new Animated.Value(0), }; @@ -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); diff --git a/app/scenes/Talk/index.js b/app/scenes/Talk/index.js index 3b00568..1b0f9aa 100644 --- a/app/scenes/Talk/index.js +++ b/app/scenes/Talk/index.js @@ -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, }; @@ -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 { diff --git a/app/types.js b/app/types.js index c61713f..22c7835 100644 --- a/app/types.js +++ b/app/types.js @@ -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, time: ScheduleTimeRange, }; -export type SpeakerType = { - avatar: string, - github: string, - name: string, - summary: string, - twitter: string, -}; - export type ScheduleBreak = { break: true, time: ScheduleTimeRange,