|
@@ -24,15 +24,12 @@ class ProfileScreen extends React.Component<Props, State> {
|
24
|
24
|
dialogVisible: false,
|
25
|
25
|
};
|
26
|
26
|
|
27
|
|
- colors: Object;
|
28
|
|
-
|
29
|
27
|
data: Object;
|
30
|
28
|
|
31
|
29
|
flatListData: Array<Object>;
|
32
|
30
|
|
33
|
|
- constructor(props) {
|
34
|
|
- super(props);
|
35
|
|
- this.colors = props.theme.colors;
|
|
31
|
+ constructor() {
|
|
32
|
+ super();
|
36
|
33
|
this.flatListData = [
|
37
|
34
|
{id: '0'},
|
38
|
35
|
{id: '1'},
|
|
@@ -105,18 +102,6 @@ class ProfileScreen extends React.Component<Props, State> {
|
105
|
102
|
}
|
106
|
103
|
|
107
|
104
|
/**
|
108
|
|
- * Gets the color depending on the value.
|
109
|
|
- *
|
110
|
|
- * @param field The field to get the color for
|
111
|
|
- * @return {*}
|
112
|
|
- */
|
113
|
|
- getFieldColor(field: ?string) {
|
114
|
|
- return this.isFieldAvailable(field)
|
115
|
|
- ? this.colors.text
|
116
|
|
- : this.colors.textDisabled;
|
117
|
|
- }
|
118
|
|
-
|
119
|
|
- /**
|
120
|
105
|
* Gets a list item showing personal information
|
121
|
106
|
*
|
122
|
107
|
* @param field The field to display
|
|
@@ -124,15 +109,17 @@ class ProfileScreen extends React.Component<Props, State> {
|
124
|
109
|
* @return {*}
|
125
|
110
|
*/
|
126
|
111
|
getPersonalListItem(field: ?string, icon: string) {
|
|
112
|
+ let title = this.isFieldAvailable(field) ? this.getFieldValue(field) : ':(';
|
|
113
|
+ let subtitle = this.isFieldAvailable(field) ? '' : this.getFieldValue(field);
|
127
|
114
|
return (
|
128
|
115
|
<List.Item
|
129
|
|
- title={this.getFieldValue(field)}
|
|
116
|
+ title={title}
|
|
117
|
+ description={subtitle}
|
130
|
118
|
left={props => <List.Icon
|
131
|
119
|
{...props}
|
132
|
120
|
icon={icon}
|
133
|
|
- color={this.getFieldColor(field)}
|
|
121
|
+ color={this.isFieldAvailable(field) ? undefined : this.props.theme.colors.textDisabled}
|
134
|
122
|
/>}
|
135
|
|
- titleStyle={{color: this.getFieldColor(field)}}
|
136
|
123
|
/>
|
137
|
124
|
);
|
138
|
125
|
}
|
|
@@ -151,7 +138,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
151
|
138
|
left={(props) => <Avatar.Icon
|
152
|
139
|
{...props}
|
153
|
140
|
icon="account"
|
154
|
|
- color={this.colors.primary}
|
|
141
|
+ color={this.props.theme.colors.primary}
|
155
|
142
|
style={styles.icon}
|
156
|
143
|
/>}
|
157
|
144
|
/>
|
|
@@ -169,7 +156,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
169
|
156
|
<Button
|
170
|
157
|
icon="account-edit"
|
171
|
158
|
mode="contained"
|
172
|
|
- onPress={() => openBrowser(this.data.link, this.colors.primary)}
|
|
159
|
+ onPress={() => openBrowser(this.data.link, this.props.theme.colors.primary)}
|
173
|
160
|
style={styles.editButton}>
|
174
|
161
|
{i18n.t("profileScreen.editInformation")}
|
175
|
162
|
</Button>
|
|
@@ -193,7 +180,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
193
|
180
|
left={(props) => <Avatar.Icon
|
194
|
181
|
{...props}
|
195
|
182
|
icon="account-group"
|
196
|
|
- color={this.colors.primary}
|
|
183
|
+ color={this.props.theme.colors.primary}
|
197
|
184
|
style={styles.icon}
|
198
|
185
|
/>}
|
199
|
186
|
/>
|
|
@@ -219,7 +206,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
219
|
206
|
left={(props) => <Avatar.Icon
|
220
|
207
|
{...props}
|
221
|
208
|
icon="credit-card"
|
222
|
|
- color={this.colors.primary}
|
|
209
|
+ color={this.props.theme.colors.primary}
|
223
|
210
|
style={styles.icon}
|
224
|
211
|
/>}
|
225
|
212
|
/>
|
|
@@ -243,7 +230,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
243
|
230
|
title={state ? i18n.t("profileScreen.membershipPayed") : i18n.t("profileScreen.membershipNotPayed")}
|
244
|
231
|
left={props => <List.Icon
|
245
|
232
|
{...props}
|
246
|
|
- color={state ? this.colors.success : this.colors.danger}
|
|
233
|
+ color={state ? this.props.theme.colors.success : this.props.theme.colors.danger}
|
247
|
234
|
icon={state ? 'check' : 'close'}
|
248
|
235
|
/>}
|
249
|
236
|
/>
|
|
@@ -270,7 +257,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
270
|
257
|
let icon = (props) => <List.Icon {...props} icon="chevron-right"/>;
|
271
|
258
|
if (item.is_manager) {
|
272
|
259
|
description = i18n.t("profileScreen.isManager");
|
273
|
|
- icon = (props) => <List.Icon {...props} icon="star" color={this.colors.primary}/>;
|
|
260
|
+ icon = (props) => <List.Icon {...props} icon="star" color={this.props.theme.colors.primary}/>;
|
274
|
261
|
}
|
275
|
262
|
return <List.Item
|
276
|
263
|
title={item.name}
|