forked from atef-najar/react-native-shop-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Newsletter.js
52 lines (47 loc) · 1.62 KB
/
Newsletter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* This is the newsletter page
**/
// React native and others libraries imports
import React, { Component } from 'react';
import { Container, View, Icon, Left, Button, Item, Input } from 'native-base';
import { Actions } from 'react-native-router-flux';
// Our custom files and classes import
import Text from '../component/Text';
import Navbar from '../component/Navbar';
import Colors from '../Colors';
export default class Newsletter extends Component {
constructor(props) {
super(props);
this.state = {
email: ''
}
}
render() {
var left = (
<Left style={{flex:1}}>
<Button transparent onPress={() => Actions.pop()}>
<Icon name="ios-close" size={38} style={{fontSize: 38}} />
</Button>
</Left>
);
return(
<Container style={{backgroundColor: '#fdfdfd'}}>
<Navbar left={left} title="NEWSLETTER" />
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center', paddingLeft: 50, paddingRight: 50}}>
<Item>
<Icon active name='ios-mail-outline' />
<Input placeholder='Your email address' onChangeText={(text) => this.setState({email: text})}/>
</Item>
<View style={{alignItems: 'center'}}>
<Button onPress={() => this.subscribe()} style={{backgroundColor: Colors.navbarBackgroundColor, marginTop: 20}}>
<Text style={{color: '#fdfdfd'}}>Subscribe</Text>
</Button>
</View>
</View>
</Container>
);
}
subscribe() {
alert('Subscribe address: '+this.state.email);
}
}