99
1010'use strict' ;
1111
12- var React = require ( 'react' ) ;
13- var ReactNative = require ( 'react-native' ) ;
14- var {
12+ const React = require ( 'react' ) ;
13+ const ReactNative = require ( 'react-native' ) ;
14+ const {
1515 Image,
1616 StyleSheet,
1717 Text,
2323
2424import type { ViewPagerScrollState } from 'ViewPagerAndroid' ;
2525
26- var PAGES = 5 ;
27- var BGCOLOR = [ '#fdc08e' , '#fff6b9' , '#99d1b7' , '#dde5fe' , '#f79273' ] ;
28- var IMAGE_URIS = [
26+ const PAGES = 5 ;
27+ const BGCOLOR = [ '#fdc08e' , '#fff6b9' , '#99d1b7' , '#dde5fe' , '#f79273' ] ;
28+ const IMAGE_URIS = [
2929 'https://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg' ,
3030 'https://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg' ,
3131 'https://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg' ,
@@ -43,7 +43,7 @@ class LikeCount extends React.Component {
4343 } ;
4444
4545 render ( ) {
46- var thumbsUp = '\uD83D\uDC4D' ;
46+ const thumbsUp = '\uD83D\uDC4D' ;
4747 return (
4848 < View style = { styles . likeContainer } >
4949 < TouchableOpacity onPress = { this . onClick } style = { styles . likeButton } >
@@ -79,9 +79,10 @@ class Button extends React.Component {
7979
8080class ProgressBar extends React . Component {
8181 render ( ) {
82- var fractionalPosition =
82+ const fractionalPosition =
8383 this . props . progress . position + this . props . progress . offset ;
84- var progressBarSize = ( fractionalPosition / ( PAGES - 1 ) ) * this . props . size ;
84+ const progressBarSize =
85+ ( fractionalPosition / ( PAGES - 1 ) ) * this . props . size ;
8586 return (
8687 < View style = { [ styles . progressBarContainer , { width : this . props . size } ] } >
8788 < View style = { [ styles . progressBar , { width : progressBarSize } ] } />
@@ -118,7 +119,7 @@ class ViewPagerAndroidExample extends React.Component {
118119 } ;
119120
120121 move = delta => {
121- var page = this . state . page + delta ;
122+ const page = this . state . page + delta ;
122123 this . go ( page ) ;
123124 } ;
124125
@@ -133,9 +134,9 @@ class ViewPagerAndroidExample extends React.Component {
133134 } ;
134135
135136 render ( ) {
136- var pages = [ ] ;
137- for ( var i = 0 ; i < PAGES ; i ++ ) {
138- var pageStyle = {
137+ const pages = [ ] ;
138+ for ( let i = 0 ; i < PAGES ; i ++ ) {
139+ const pageStyle = {
139140 backgroundColor : BGCOLOR [ i % BGCOLOR . length ] ,
140141 alignItems : 'center' ,
141142 padding : 20 ,
@@ -150,7 +151,7 @@ class ViewPagerAndroidExample extends React.Component {
150151 </ View > ,
151152 ) ;
152153 }
153- var { page, animationsAreEnabled} = this . state ;
154+ const { page, animationsAreEnabled} = this . state ;
154155 return (
155156 < View style = { styles . container } >
156157 < ViewPagerAndroid
@@ -222,7 +223,7 @@ class ViewPagerAndroidExample extends React.Component {
222223 }
223224}
224225
225- var styles = StyleSheet . create ( {
226+ const styles = StyleSheet . create ( {
226227 buttons : {
227228 flexDirection : 'row' ,
228229 height : 30 ,
0 commit comments