basic layout of main page
- consists of the navbar, chat, and adspace components
This commit is contained in:
+2
-4
@@ -17,7 +17,7 @@ import {
|
|||||||
// Imported screens to route through
|
// Imported screens to route through
|
||||||
import Home from './screens/home.js';
|
import Home from './screens/home.js';
|
||||||
import Loading from './screens/loading.js';
|
import Loading from './screens/loading.js';
|
||||||
|
import Main from './screens/main.js'
|
||||||
type Props = {};
|
type Props = {};
|
||||||
export default class App extends Component<Props> {
|
export default class App extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
@@ -26,9 +26,7 @@ export default class App extends Component<Props> {
|
|||||||
<Stack key='root' style={{paddingTop: 54}}>
|
<Stack key='root' style={{paddingTop: 54}}>
|
||||||
<Scene key='home' component={Home} title="Home" hideNavBar={true} />
|
<Scene key='home' component={Home} title="Home" hideNavBar={true} />
|
||||||
<Scene key='loading' component={Loading} title='Loading' />
|
<Scene key='loading' component={Loading} title='Loading' />
|
||||||
{/*
|
<Scene key='main' component={Main} title='Main' hideNavBar={true} />
|
||||||
<Scene key='chat' component={Chat} title='Chat' hideNavBar={false} />
|
|
||||||
*/}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-11
@@ -3,9 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {
|
import {
|
||||||
|
Dimensions,
|
||||||
View,
|
View,
|
||||||
ImageBackground,
|
ImageBackground,
|
||||||
Dimensions,
|
|
||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Permissions,
|
Permissions,
|
||||||
@@ -21,16 +21,6 @@ const backgroundLink = 'https://cdn.shopify.com/s/files/1/2567/6484/products/Pol
|
|||||||
|
|
||||||
type Props = {};
|
type Props = {};
|
||||||
export default class Home extends Component<Props> {
|
export default class Home extends Component<Props> {
|
||||||
componentDidMount() {
|
|
||||||
console.log('mounted');
|
|
||||||
AsyncStorage.getItem('longitude').then((lon) => {
|
|
||||||
console.log(lon);
|
|
||||||
});
|
|
||||||
AsyncStorage.getItem('latitude').then((lat) => {
|
|
||||||
console.log(lat);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
Actions.loading();
|
Actions.loading();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {
|
import {
|
||||||
View,
|
|
||||||
Dimensions,
|
Dimensions,
|
||||||
|
View,
|
||||||
Image,
|
Image,
|
||||||
Text,
|
Text,
|
||||||
AsyncStorage
|
AsyncStorage
|
||||||
@@ -26,9 +26,9 @@ export default class Loading extends Component<Props> {
|
|||||||
this.latitude = parseFloat(position.coords.latitude);
|
this.latitude = parseFloat(position.coords.latitude);
|
||||||
this.longitude = parseFloat(position.coords.longitude);
|
this.longitude = parseFloat(position.coords.longitude);
|
||||||
console.log(String(this.latitude) + ' ' + String(this.longitude));
|
console.log(String(this.latitude) + ' ' + String(this.longitude));
|
||||||
AsyncStorage.setItem('longitude', this.longitude);
|
//AsyncStorage.setItem('longitude', this.longitude);
|
||||||
AsyncStorage.setItem('latitude', this.latitude);
|
//AsyncStorage.setItem('latitude', this.latitude);
|
||||||
Actions.home();
|
Actions.main();
|
||||||
},
|
},
|
||||||
(error) => console.log(error),
|
(error) => console.log(error),
|
||||||
// high accuracy might need slight adjusting with its values
|
// high accuracy might need slight adjusting with its values
|
||||||
@@ -41,7 +41,7 @@ export default class Loading extends Component<Props> {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={loadingStyles.container}>
|
<View style={loadingStyles.container}>
|
||||||
<Image style={loadingStyles.gif} source={{ uri: 'http://www.playrosy.com/ourgames/vampiregirlmakeover/images/_preloader.gif' }} />
|
<Image style={loadingStyles.gif} source={{ uri: null }} />
|
||||||
<Text style={loadingStyles.waitTxt}>Please wait to be connected...</Text>
|
<Text style={loadingStyles.waitTxt}>Please wait to be connected...</Text>
|
||||||
<View style={loadingStyles.copyright}>
|
<View style={loadingStyles.copyright}>
|
||||||
<Text style={loadingStyles.copyTxt}>© Nexto</Text>
|
<Text style={loadingStyles.copyTxt}>© Nexto</Text>
|
||||||
|
|||||||
@@ -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<Props> {
|
||||||
|
render() {
|
||||||
|
console.log('in Main');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={styles.navbar}>
|
||||||
|
<Navbar />
|
||||||
|
</View>
|
||||||
|
<View style={styles.chat}>
|
||||||
|
<Chat />
|
||||||
|
</View>
|
||||||
|
<View style={styles.adspace}>
|
||||||
|
<AdSpace />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
container: {
|
||||||
|
flex: 18,
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'space-between'
|
||||||
|
},
|
||||||
|
navbar: {
|
||||||
|
flex: 2
|
||||||
|
},
|
||||||
|
chat: {
|
||||||
|
flex: 15,
|
||||||
|
backgroundColor: 'white'
|
||||||
|
},
|
||||||
|
adspace: {
|
||||||
|
flex: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* AdSpace component within Main
|
||||||
|
*/
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import {
|
||||||
|
Dimensions,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
} from 'react-native';
|
||||||
|
import {
|
||||||
|
Actions
|
||||||
|
} from 'react-native-router-flux';
|
||||||
|
|
||||||
|
const windowWidth = Dimensions.get('window').width;
|
||||||
|
const windowHeight = Dimensions.get('window').height;
|
||||||
|
|
||||||
|
type Props = {};
|
||||||
|
export default class AdSpace extends Component<Props> {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text>adspace</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Chat component within Main
|
||||||
|
*/
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import {
|
||||||
|
Dimensions,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
} from 'react-native';
|
||||||
|
import {
|
||||||
|
Actions
|
||||||
|
} from 'react-native-router-flux';
|
||||||
|
|
||||||
|
const windowWidth = Dimensions.get('window').width;
|
||||||
|
const windowHeight = Dimensions.get('window').height;
|
||||||
|
|
||||||
|
type Props = {};
|
||||||
|
export default class Chat extends Component<Props> {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text>chat</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Navbar component within Main
|
||||||
|
*/
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import {
|
||||||
|
Dimensions,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
} from 'react-native';
|
||||||
|
import {
|
||||||
|
Actions
|
||||||
|
} from 'react-native-router-flux';
|
||||||
|
|
||||||
|
const windowWidth = Dimensions.get('window').width;
|
||||||
|
const windowHeight = Dimensions.get('window').height;
|
||||||
|
|
||||||
|
type Props = {};
|
||||||
|
export default class Navbar extends Component<Props> {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text>navbar</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user