nicer menu and other touches
This commit is contained in:
+12
-3
@@ -58,8 +58,13 @@ export default class Main extends Component<Props> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openDrawer = () => {
|
||||||
|
this.refs['menu'].openDrawer();
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
console.log('in Main');
|
console.log('in Main');
|
||||||
|
|
||||||
const { position, avatar } = this.state;
|
const { position, avatar } = this.state;
|
||||||
const avatarLink = allAvatarLinks[avatar];
|
const avatarLink = allAvatarLinks[avatar];
|
||||||
|
|
||||||
@@ -67,18 +72,22 @@ export default class Main extends Component<Props> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DrawerLayoutAndroid
|
<DrawerLayoutAndroid
|
||||||
|
ref="menu"
|
||||||
drawerWidth={300}
|
drawerWidth={300}
|
||||||
drawerPosition={DrawerLayoutAndroid.positions.Left}
|
drawerPosition={DrawerLayoutAndroid.positions.Left}
|
||||||
renderNavigationView={() => <Menu refreshConnection={this.refreshConnection}
|
renderNavigationView={() => <Menu refreshConnection={this.refreshConnection}
|
||||||
refreshAvatar={this.refreshAvatar}
|
refreshAvatar={this.refreshAvatar}
|
||||||
disconnect={this.disconnect} />}>
|
disconnect={this.disconnect}
|
||||||
|
avatar={avatarLink} />}>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View style={styles.navbar}>
|
<View style={styles.navbar}>
|
||||||
<Navbar avatar={avatarLink} />
|
<Navbar openDrawer={this.openDrawer} avatar={avatarLink} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.chat}>
|
<View style={styles.chat}>
|
||||||
<Chat position={position} avatar={avatarLink} />
|
<Chat position={position} avatar={avatarLink} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.adspace}>
|
<View style={styles.adspace}>
|
||||||
<AdSpace />
|
<AdSpace />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
+25
-16
@@ -180,6 +180,7 @@ export default class Chat extends Component<Props> {
|
|||||||
multiline = {true}
|
multiline = {true}
|
||||||
numberOfLines = {4}
|
numberOfLines = {4}
|
||||||
maxLength = {220}
|
maxLength = {220}
|
||||||
|
underlineColorAndroid='rgba(0,0,0,0)'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.iconCont}>
|
<View style={styles.iconCont}>
|
||||||
@@ -242,14 +243,14 @@ const styles = {
|
|||||||
padding: 10,
|
padding: 10,
|
||||||
borderBottomRightRadius: 10,
|
borderBottomRightRadius: 10,
|
||||||
borderBottomLeftRadius: 10,
|
borderBottomLeftRadius: 10,
|
||||||
shadowColor:'black',
|
shadowColor: 'black',
|
||||||
shadowOffset: {
|
shadowOffset: {
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 3
|
height: 3
|
||||||
},
|
},
|
||||||
shadowRadius: 5,
|
shadowRadius: 5,
|
||||||
shadowOpacity: 1.0,
|
shadowOpacity: 1.0,
|
||||||
elevation: 5
|
elevation: 3
|
||||||
},
|
},
|
||||||
userMsgBox: {
|
userMsgBox: {
|
||||||
backgroundColor: '#0e8f9e',
|
backgroundColor: '#0e8f9e',
|
||||||
@@ -273,29 +274,37 @@ const styles = {
|
|||||||
inputMsgField: {
|
inputMsgField: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'stretch',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'center',
|
||||||
height: 50,
|
margin: 12,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
marginTop: 10
|
shadowColor: '#0e8f9e',
|
||||||
},
|
shadowOffset: {
|
||||||
iconCont: {
|
width: 0,
|
||||||
flex: 1,
|
height: 3
|
||||||
alignItems: 'center',
|
},
|
||||||
justifyContent: 'center'
|
shadowRadius: 5,
|
||||||
|
shadowOpacity: 1.0,
|
||||||
|
elevation: 5,
|
||||||
|
padding: 2
|
||||||
},
|
},
|
||||||
inputCont: {
|
inputCont: {
|
||||||
flex: 6,
|
flex: 6
|
||||||
alignSelf: 'flex-end',
|
|
||||||
marginLeft: 10
|
|
||||||
},
|
},
|
||||||
inputField : {
|
inputField : {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontFamily: Fonts.SunflowerLight
|
fontFamily: Fonts.SunflowerLight
|
||||||
},
|
},
|
||||||
sendIcon: {
|
iconCont: {
|
||||||
fontSize: 25
|
flex: 1,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
borderLeftColor: '#0e8f9e',
|
||||||
|
borderLeftWidth: 1
|
||||||
},
|
},
|
||||||
|
sendIcon: {
|
||||||
|
fontSize: 15
|
||||||
|
},
|
||||||
sendIconColor: {
|
sendIconColor: {
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
color: '#0e8f9e'
|
color: '#0e8f9e'
|
||||||
|
|||||||
+65
-23
@@ -7,7 +7,8 @@ import {
|
|||||||
View,
|
View,
|
||||||
Text,
|
Text,
|
||||||
ImageBackground,
|
ImageBackground,
|
||||||
TouchableOpacity
|
TouchableOpacity,
|
||||||
|
StyleSheet
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {
|
import {
|
||||||
Actions
|
Actions
|
||||||
@@ -22,41 +23,55 @@ const backgroundLink = '../../assets/images/homeBg.jpg';
|
|||||||
type Props = {};
|
type Props = {};
|
||||||
export default class Menu extends Component<Props> {
|
export default class Menu extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { refreshConnection, refreshAvatar, disconnect } = this.props;
|
const { refreshConnection, refreshAvatar, disconnect, avatar } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<ImageBackground style={styles.header} source={require(backgroundLink)} >
|
<ImageBackground
|
||||||
<Text style={styles.hdrTxt}>Menu</Text>
|
style={styles.header}
|
||||||
|
source={{uri: avatar}}>
|
||||||
|
<View style={styles.overlay}>
|
||||||
|
<Text style={styles.hdrTxt}>Menu</Text>
|
||||||
|
</View>
|
||||||
</ImageBackground>
|
</ImageBackground>
|
||||||
|
|
||||||
<View style={styles.main}>
|
<View style={styles.main}>
|
||||||
<TouchableOpacity onPress={refreshConnection}>
|
<TouchableOpacity onPress={refreshConnection}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Refresh Connection</Text>
|
|
||||||
<Icon
|
<Icon
|
||||||
name='track-changes'
|
name='track-changes'
|
||||||
style={styles.icons}
|
style={styles.icons}
|
||||||
/>
|
/>
|
||||||
|
<Text style={styles.optTxt}>Refresh Connection</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity onPress={refreshAvatar}>
|
<TouchableOpacity onPress={refreshAvatar}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Change Avatar</Text>
|
|
||||||
<Icon
|
<Icon
|
||||||
name='refresh'
|
name='refresh'
|
||||||
style={styles.icons}
|
style={[styles.icons, styles.refresh]}
|
||||||
/>
|
/>
|
||||||
|
<Text style={styles.optTxt}>Change Avatar</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity onPress={disconnect}>
|
<TouchableOpacity onPress={disconnect}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Disconnect</Text>
|
|
||||||
<Icon
|
<Icon
|
||||||
name='exit-to-app'
|
name='exit-to-app'
|
||||||
style={styles.icons}
|
style={[styles.icons, styles.disconnect]}
|
||||||
/>
|
/>
|
||||||
|
<Text style={styles.optTxt}>Disconnect</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.copyrightCont}>
|
||||||
|
<Text style={styles.copyrightTxt}>© Nexto</Text>
|
||||||
|
<Text style={styles.copyrightTxtExtra}>2018.</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -64,17 +79,21 @@ export default class Menu extends Component<Props> {
|
|||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
container: {
|
container: {
|
||||||
flex: 13,
|
flex: 14,
|
||||||
backgroundColor: 'white'
|
backgroundColor: 'white'
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
flex: 3,
|
flex: 3
|
||||||
backgroundColor: 'grey',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center'
|
|
||||||
},
|
},
|
||||||
|
overlay: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor:'rgba(0,0,0,0.5)'
|
||||||
|
},
|
||||||
hdrTxt: {
|
hdrTxt: {
|
||||||
color: '#0e8f9e',
|
color: 'white',
|
||||||
fontSize: 30
|
fontSize: 30
|
||||||
},
|
},
|
||||||
main: {
|
main: {
|
||||||
@@ -86,18 +105,41 @@ const styles = {
|
|||||||
flex: 0,
|
flex: 0,
|
||||||
flexBasis: 3,
|
flexBasis: 3,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'flex-start',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
padding: 30,
|
paddingTop: 25,
|
||||||
borderWidth: 2,
|
paddingBottom: 25
|
||||||
borderStyle: 'solid',
|
|
||||||
borderColor: '#d7d9dd'
|
|
||||||
},
|
},
|
||||||
icons: {
|
icons: {
|
||||||
fontSize: 30,
|
fontSize: 20,
|
||||||
|
color: '#0e8f9e',
|
||||||
|
padding: 10
|
||||||
|
},
|
||||||
|
refresh: {
|
||||||
|
color: 'green'
|
||||||
|
},
|
||||||
|
disconnect: {
|
||||||
|
color: 'red'
|
||||||
|
},
|
||||||
|
optTxt: {
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: 'black',
|
||||||
|
textAlign: 'left',
|
||||||
|
padding: 10
|
||||||
|
},
|
||||||
|
copyrightCont: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: '#202021',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
padding: 10
|
||||||
|
},
|
||||||
|
copyrightTxt: {
|
||||||
color: '#0e8f9e'
|
color: '#0e8f9e'
|
||||||
},
|
},
|
||||||
optTxt: {
|
copyrightTxtExtra: {
|
||||||
fontSize: 20
|
fontSize: 10,
|
||||||
|
color: '#0e8f9e'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import {
|
|||||||
Dimensions,
|
Dimensions,
|
||||||
View,
|
View,
|
||||||
Text,
|
Text,
|
||||||
Image
|
Image,
|
||||||
|
TouchableOpacity
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {
|
import {
|
||||||
Actions
|
Actions
|
||||||
@@ -24,20 +25,24 @@ export default class Navbar extends Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { avatar } = this.props;
|
const { openDrawer, avatar } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View style={styles.iconCont}>
|
<View style={styles.iconCont}>
|
||||||
<Icon
|
<TouchableOpacity onPress={openDrawer}>
|
||||||
name='menu'
|
<Icon
|
||||||
style={styles.menuIcon}
|
name='menu'
|
||||||
/>
|
style={styles.menuIcon}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.headerTxt}>
|
<View style={styles.headerTxt}>
|
||||||
<Text style={styles.head}>Chat</Text>
|
<Text style={styles.head}>Chat</Text>
|
||||||
<Text style={styles.status}>online</Text>
|
<Text style={styles.status}>online</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.iconCont}>
|
<View style={styles.iconCont}>
|
||||||
<Image style={styles.avatar} source={{uri: avatar}} />
|
<Image style={styles.avatar} source={{uri: avatar}} />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user