11import React , { Component } from 'react' ;
2- import {
3- StyleSheet ,
4- Text ,
5- View ,
6- Image ,
7- Dimensions ,
8- StatusBar ,
9- } from 'react-native' ;
2+ import { StyleSheet , Text , View , Image , Dimensions , StatusBar } from 'react-native' ;
103import * as Animatable from 'react-native-animatable' ;
11- import { NavigationBar } from '@exponent/ex-navigation' ;
12-
4+ import { Header } from 'react-navigation' ;
135
146import HeaderImageScrollView , { TriggeringView } from 'react-native-image-header-scroll-view' ;
157import tvShowContent from '../assets/tvShowContent' ;
168
17- const MIN_HEIGHT = NavigationBar . DEFAULT_HEIGHT ;
9+ const MIN_HEIGHT = Header . HEIGHT ;
1810const MAX_HEIGHT = 250 ;
1911
2012const styles = StyleSheet . create ( {
@@ -96,30 +88,32 @@ class TvShow extends Component {
9688
9789 render ( ) {
9890 return (
99- < View style = { { flex : 1 , marginTop : - MIN_HEIGHT } } >
91+ < View style = { { flex : 1 } } >
10092 < StatusBar barStyle = "light-content" />
10193 < HeaderImageScrollView
10294 maxHeight = { MAX_HEIGHT }
10395 minHeight = { MIN_HEIGHT }
10496 maxOverlayOpacity = { 0.6 }
10597 minOverlayOpacity = { 0.3 }
10698 fadeOutForeground
107- renderHeader = { ( ) => (
108- < Image source = { tvShowContent . image } style = { styles . image } />
109- ) }
110- renderFixedForeground = { ( ) => (
99+ renderHeader = { ( ) => < Image source = { tvShowContent . image } style = { styles . image } /> }
100+ renderFixedForeground = { ( ) =>
111101 < Animatable . View
112102 style = { styles . navTitleView }
113- ref = { ( navTitleView ) => { this . navTitleView = navTitleView ; } }
103+ ref = { navTitleView => {
104+ this . navTitleView = navTitleView ;
105+ } }
114106 >
115- < Text style = { styles . navTitle } > { tvShowContent . title } , ({ tvShowContent . year } )</ Text >
116- </ Animatable . View >
117- ) }
118- renderForeground = { ( ) => (
107+ < Text style = { styles . navTitle } >
108+ { tvShowContent . title } , ({ tvShowContent . year } )
109+ </ Text >
110+ </ Animatable . View > }
111+ renderForeground = { ( ) =>
119112 < View style = { styles . titleContainer } >
120- < Text style = { styles . imageTitle } > { tvShowContent . title } </ Text >
121- </ View >
122- ) }
113+ < Text style = { styles . imageTitle } >
114+ { tvShowContent . title }
115+ </ Text >
116+ </ View > }
123117 >
124118 < TriggeringView
125119 style = { styles . section }
@@ -132,16 +126,20 @@ class TvShow extends Component {
132126 </ TriggeringView >
133127 < View style = { styles . section } >
134128 < Text style = { styles . sectionTitle } > Overview</ Text >
135- < Text style = { styles . sectionContent } > { tvShowContent . overview } </ Text >
129+ < Text style = { styles . sectionContent } >
130+ { tvShowContent . overview }
131+ </ Text >
136132 </ View >
137133 < View style = { [ styles . section , styles . sectionLarge ] } >
138134 < Text style = { styles . sectionTitle } > Keywords</ Text >
139135 < View style = { styles . keywords } >
140- { tvShowContent . keywords . map ( keyword => (
136+ { tvShowContent . keywords . map ( keyword =>
141137 < View style = { styles . keywordContainer } key = { keyword } >
142- < Text style = { styles . keyword } > { keyword } </ Text >
138+ < Text style = { styles . keyword } >
139+ { keyword }
140+ </ Text >
143141 </ View >
144- ) ) }
142+ ) }
145143 </ View >
146144 </ View >
147145 </ HeaderImageScrollView >
@@ -150,14 +148,4 @@ class TvShow extends Component {
150148 }
151149}
152150
153- TvShow . route = {
154- navigationBar : {
155- tintColor : 'white' ,
156- backgroundColor : 'transparent' ,
157- borderBottomWidth : 0 ,
158- statusBarHeight : 0 ,
159- elevation : 0 ,
160- } ,
161- } ;
162-
163151export default TvShow ;
0 commit comments