From 11ac820d0c7b20251dea84d5089cf0e706f91888 Mon Sep 17 00:00:00 2001 From: hanjiahu Date: Wed, 15 Mar 2017 11:59:03 +0800 Subject: [PATCH] fix text bug on Android --- index.android.js | 75 +++++++++++++++++++++--------------------------- src/TourDates.js | 15 +++++----- 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/index.android.js b/index.android.js index 7c1d180..9f6aaad 100644 --- a/index.android.js +++ b/index.android.js @@ -1,52 +1,41 @@ /** - * Sample React Native App + * Flume * https://github.com/facebook/react-native */ 'use strict'; -var React = require('react-native'); -var { - AppRegistry, - StyleSheet, - Text, - View, -} = React; +// global static data for ease-of-use (dsl'y) +global.React = require('react') +global.Native = require('react-native') +const { + Animated, + AppRegistry, + StyleSheet, + Text, + ListView, + Navigator, + NavigatorIOS, + View, + TouchableHighlight, + StatusBarIOS + } = Native +global.Component = React.Component +global.StyleSheet = StyleSheet +global.Animated = Animated -var flume = React.createClass({ +// "stylesheet" theme variables +global.grid = 10, + global.textColor = '#fff' +global.themeColor = 'rgba(122,87,153,.7)' +global.darkThemeColor = '#484093' +global.fontFamily = 'Swiss721BT-Light' + +const IntroScene = require('./src/IntroScene') + +const app = React.createClass({ render: function() { - return ( - - - Welcome to React Native! - - - To get started, edit index.android.js - - - Shake or press menu button for dev menu - - - ); + return } -}); - -var styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - welcome: { - fontSize: 20, - textAlign: 'center', - margin: 10, - }, - instructions: { - textAlign: 'center', - color: '#333333', - marginBottom: 5, - }, -}); +}) -AppRegistry.registerComponent('flume', () => flume); +AppRegistry.registerComponent('flume', () => app) diff --git a/src/TourDates.js b/src/TourDates.js index e22fced..bbb21a7 100644 --- a/src/TourDates.js +++ b/src/TourDates.js @@ -57,16 +57,17 @@ class TourDates extends Component { TOUR {this.state.tourEvents.map((tour, i) => { return (i < 10) // latest N shows - ? - {tour.start.date} - {tour.displayName} - {tour.location.city} - { + ? { + console.log('http://www.songkick.com/artists/3645486'); Linking.openURL('http://www.songkick.com/artists/3645486') }}> - TICKETS - + + {tour.start.date} + {tour.displayName} + {tour.location.city} + TICKETS + : })}