From ab9614848a5464bd5416d8300b8b5e43ee86a850 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Wed, 25 Apr 2018 16:07:40 -0700 Subject: [PATCH] more changes --- app/screens/home.js | 80 ++++++++++++++++++++++++++++++++++++++++++ app/screens/loading.js | 80 ++++++++++++++++++++++++++++++++++++++++++ app/screens/main.js | 60 +++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 app/screens/home.js create mode 100644 app/screens/loading.js create mode 100644 app/screens/main.js diff --git a/app/screens/home.js b/app/screens/home.js new file mode 100644 index 0000000..6b31191 --- /dev/null +++ b/app/screens/home.js @@ -0,0 +1,80 @@ +/* + * Home screen with logo and connect button + */ +import React, { Component } from 'react'; +import { + Dimensions, + View, + ImageBackground, + Text, + TouchableOpacity, + Permissions, + AsyncStorage +} from 'react-native'; +import { + Actions +} from 'react-native-router-flux'; + +const windowWidth = Dimensions.get('window').width; +const windowHeight = Dimensions.get('window').height; +const backgroundLink = 'https://cdn.shopify.com/s/files/1/2567/6484/products/Polygon_Esprit_geometric_white_and_gold_5.jpg?v=1517325402'; + +type Props = {}; +export default class Home extends Component { + connect() { + Actions.loading(); + } + + render() { + return ( + + + + Nexto + spontaneous connection + + + + Connect + + + + ); + } +} + +const homeStyles = { + container: { + flex: 1, + backgroundColor: '#0e8f9e', + }, + bg: { + flex: 1, + flexDirection: 'column', + justifyContent: 'space-around', + alignItems: 'center', + width: windowWidth, + height: windowHeight + }, + logo: { + color: 'grey', + fontSize: 50, + textAlign: 'center', + zIndex: 100 + }, + motto: { + color: '#0e8f9e', + fontSize: 18 + }, + connect: { + backgroundColor: '#0e8f9e', + padding: 15, + width: windowWidth - 100, + justifyContent: 'flex-end', + }, + connectTxt: { + textAlign: 'center', + color: 'white', + fontSize: 25 + } +} diff --git a/app/screens/loading.js b/app/screens/loading.js new file mode 100644 index 0000000..5685539 --- /dev/null +++ b/app/screens/loading.js @@ -0,0 +1,80 @@ +/* + * Universal Loading screen that can be used for any situations + */ +import React, { Component } from 'react'; +import { + Dimensions, + View, + Image, + Text, + AsyncStorage +} from 'react-native'; +import { + Actions +} from 'react-native-router-flux'; + +const windowWidth = Dimensions.get('window').width; +const windowHeight = Dimensions.get('window').height; +const loadingGIF = 'http://www.playrosy.com/ourgames/vampiregirlmakeover/images/_preloader.gif'; + +type Props = {}; +export default class Loading extends Component { + componentWillMount() { + // Getting the location of the user + navigator.geolocation.getCurrentPosition((position) => { + console.log('Getting User Location:'); + this.latitude = parseFloat(position.coords.latitude); + this.longitude = parseFloat(position.coords.longitude); + console.log(String(this.latitude) + ' ' + String(this.longitude)); + //AsyncStorage.setItem('longitude', this.longitude); + //AsyncStorage.setItem('latitude', this.latitude); + Actions.main(); + }, + (error) => console.log(error), + // high accuracy might need slight adjusting with its values + // or perhaps do high accuracy and if it times out then do + // regular getPosition + //{ enableHighAccuracy: false, timeout: 2000, maximumAge: 1000 } + ); + } + + render() { + return ( + + + Please wait to be connected... + + © Nexto + + + ); + } +} + +const loadingStyles = { + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + flexDirection: 'column', + backgroundColor: '#0e8f9e', + }, + gif: { + height: 50, + width: 50 + }, + waitTxt: { + color: 'white', + fontSize: 15 + }, + copyright: { + position: 'absolute', + bottom: 30, + zIndex: 10 + }, + copyTxt: { + fontSize: 15, + color: 'white', + fontFamily: 'TitilliumWeb-Regular' + } +} diff --git a/app/screens/main.js b/app/screens/main.js new file mode 100644 index 0000000..f4d92f6 --- /dev/null +++ b/app/screens/main.js @@ -0,0 +1,60 @@ +/* + * Main screen with top Navbar, chat scroll view, + * and Ad space components + */ +import React, { Component } from 'react'; +import { + Dimensions, + View, + Text +} from 'react-native'; +import { + Actions +} from 'react-native-router-flux'; + +// imported components for different sections in main component +import Navbar from './main/navbar.js'; +import Chat from './main/chat.js'; +import AdSpace from './main/adspace.js'; + +const windowWidth = Dimensions.get('window').width; +const windowHeight = Dimensions.get('window').height; + +type Props = {}; +export default class Main extends Component { + render() { + console.log('in Main'); + + return ( + + + + + + + + + + + + ); + } +} + +const styles = { + container: { + flex: 18, + flexDirection: 'column', + justifyContent: 'space-between' + }, + navbar: { + flex: 2 + }, + chat: { + flex: 15, + backgroundColor: 'white' + }, + adspace: { + flex: 1 + } +}