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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
import React from 'react';
import {
ScrollView,
View,
TouchableOpacity,
StyleSheet,
} from 'react-native';
import {
RkText,
RkStyleSheet,
RkTheme,
} from 'react-native-ui-kitten';
import {
RkSwitch,
FindFriends,
} from '../../components';
import { FontAwesome } from '../../assets/icons';
export class Settings extends React.Component {
static navigationOptions = {
title: 'Settings'.toUpperCase(),
};
state = {
sendPush: true,
shouldRefresh: false,
twitterEnabled: true,
googleEnabled: false,
facebookEnabled: true,
};
onPushNotificationsSettingChanged = (value) => {
this.setState({ sendPush: value });
};
onRefreshAutomaticallySettingChanged = (value) => {
this.setState({ shouldRefresh: value });
};
onFindFriendsTwitterButtonPressed = () => {
this.setState({ twitterEnabled: !this.state.twitterEnabled });
};
onFindFriendsGoogleButtonPressed = () => {
this.setState({ googleEnabled: !this.state.googleEnabled });
};
onFindFriendsFacebookButtonPressed = () => {
this.setState({ facebookEnabled: !this.state.facebookEnabled });
};
render = () => (
<ScrollView style={styles.container}>
<View style={styles.section}>
<View style={[styles.row, styles.heading]}>
<RkText rkType='primary header6'>PROFILE SETTINGS</RkText>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Edit Profile</RkText>
</TouchableOpacity>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Change Password</RkText>
</TouchableOpacity>
</View>
<View style={styles.row}>
<RkText rkType='header6'>Send Push Notifications</RkText>
<RkSwitch
style={styles.switch}
value={this.state.sendPush}
name="Push"
onValueChange={this.onPushNotificationsSettingChanged}
/>
</View>
<View style={styles.row}>
<RkText rkType='header6'>Refresh Automatically</RkText>
<RkSwitch
style={styles.switch}
value={this.state.shouldRefresh}
name="Refresh"
onValueChange={this.onRefreshAutomaticallySettingChanged}
/>
</View>
</View>
<View style={styles.section}>
<View style={[styles.row, styles.heading]}>
<RkText rkType='primary header6'>FIND FRIENDS</RkText>
</View>
<View style={styles.row}>
<FindFriends
color={RkTheme.current.colors.twitter}
text='Twitter'
icon={FontAwesome.twitter}
selected={this.state.twitterEnabled}
onPress={this.onFindFriendsTwitterButtonPressed}
/>
</View>
<View style={styles.row}>
<FindFriends
color={RkTheme.current.colors.google}
text='Google'
icon={FontAwesome.google}
selected={this.state.googleEnabled}
onPress={this.onFindFriendsGoogleButtonPressed}
/>
</View>
<View style={styles.row}>
<FindFriends
color={RkTheme.current.colors.facebook}
text='Facebook'
icon={FontAwesome.facebook}
selected={this.state.facebookEnabled}
onPress={this.onFindFriendsFacebookButtonPressed}
/>
</View>
</View>
<View style={styles.section}>
<View style={[styles.row, styles.heading]}>
<RkText rkType='primary header6'>SUPPORT</RkText>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Help</RkText>
</TouchableOpacity>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Privacy Policy</RkText>
</TouchableOpacity>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Terms & Conditions</RkText>
</TouchableOpacity>
</View>
<View style={styles.row}>
<TouchableOpacity style={styles.rowButton}>
<RkText rkType='header6'>Logout</RkText>
</TouchableOpacity>
</View>
</View>
</ScrollView>
)
}
const styles = RkStyleSheet.create(theme => ({
container: {
backgroundColor: theme.colors.screen.base,
},
header: {
paddingVertical: 25,
},
section: {
marginVertical: 25,
},
heading: {
paddingBottom: 12.5,
},
row: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingHorizontal: 17.5,
borderBottomWidth: StyleSheet.hairlineWidth,
borderColor: theme.colors.border.base,
alignItems: 'center',
},
rowButton: {
flex: 1,
paddingVertical: 24,
},
switch: {
marginVertical: 14,
},
}));
|