|
@@ -172,6 +172,19 @@ class SettingsScreen extends React.Component<Props, State> {
|
172
|
172
|
);
|
173
|
173
|
}
|
174
|
174
|
|
|
175
|
+ getNavigateItem(route: string, icon: string, title: string, subtitle: string, onLongPress?: () => void) {
|
|
176
|
+ return (
|
|
177
|
+ <List.Item
|
|
178
|
+ title={title}
|
|
179
|
+ description={subtitle}
|
|
180
|
+ onPress={() => this.props.navigation.navigate(route)}
|
|
181
|
+ left={props => <List.Icon {...props} icon={icon}/>}
|
|
182
|
+ right={props => <List.Icon {...props} icon={"chevron-right"}/>}
|
|
183
|
+ onLongPress={onLongPress}
|
|
184
|
+ />
|
|
185
|
+ );
|
|
186
|
+ }
|
|
187
|
+
|
175
|
188
|
render() {
|
176
|
189
|
return (
|
177
|
190
|
<ScrollView>
|
|
@@ -203,12 +216,12 @@ class SettingsScreen extends React.Component<Props, State> {
|
203
|
216
|
left={props => <List.Icon {...props} icon="power"/>}
|
204
|
217
|
/>
|
205
|
218
|
{this.getStartScreenPicker()}
|
206
|
|
- <List.Item
|
207
|
|
- title={i18n.t('screens.settings.dashboard')}
|
208
|
|
- description={i18n.t('screens.settings.dashboardSub')}
|
209
|
|
- onPress={() => this.props.navigation.navigate("dashboard-edit")}
|
210
|
|
- left={props => <List.Icon {...props} icon="view-dashboard"/>}
|
211
|
|
- />
|
|
219
|
+ {this.getNavigateItem(
|
|
220
|
+ "dashboard-edit",
|
|
221
|
+ "view-dashboard",
|
|
222
|
+ i18n.t('screens.settings.dashboard'),
|
|
223
|
+ i18n.t('screens.settings.dashboardSub')
|
|
224
|
+ )}
|
212
|
225
|
</List.Section>
|
213
|
226
|
</Card>
|
214
|
227
|
<Card style={{margin: 5}}>
|
|
@@ -229,25 +242,26 @@ class SettingsScreen extends React.Component<Props, State> {
|
229
|
242
|
<Card.Title title={i18n.t('screens.settings.information')}/>
|
230
|
243
|
<List.Section>
|
231
|
244
|
{this.state.isDebugUnlocked
|
232
|
|
- ? <List.Item
|
233
|
|
- title={i18n.t('screens.debug.title')}
|
234
|
|
- left={props => <List.Icon {...props} icon="bug-check"/>}
|
235
|
|
- onPress={() => this.props.navigation.navigate("debug")}
|
236
|
|
- />
|
|
245
|
+ ? this.getNavigateItem(
|
|
246
|
+ "debug",
|
|
247
|
+ "bug-check",
|
|
248
|
+ i18n.t('screens.debug.title'),
|
|
249
|
+ ""
|
|
250
|
+ )
|
237
|
251
|
: null}
|
238
|
|
- <List.Item
|
239
|
|
- title={i18n.t('screens.about.title')}
|
240
|
|
- description={i18n.t('screens.about.buttonDesc')}
|
241
|
|
- left={props => <List.Icon {...props} icon="information"/>}
|
242
|
|
- onPress={() => this.props.navigation.navigate("about")}
|
243
|
|
- onLongPress={this.unlockDebugMode}
|
244
|
|
- />
|
245
|
|
- <List.Item
|
246
|
|
- title={i18n.t('screens.feedback.homeButtonTitle')}
|
247
|
|
- description={i18n.t('screens.feedback.homeButtonSubtitle')}
|
248
|
|
- left={props => <List.Icon {...props} icon="bug"/>}
|
249
|
|
- onPress={() => this.props.navigation.navigate("feedback")}
|
250
|
|
- />
|
|
252
|
+ {this.getNavigateItem(
|
|
253
|
+ "about",
|
|
254
|
+ "information",
|
|
255
|
+ i18n.t('screens.about.title'),
|
|
256
|
+ i18n.t('screens.about.buttonDesc'),
|
|
257
|
+ this.unlockDebugMode,
|
|
258
|
+ )}
|
|
259
|
+ {this.getNavigateItem(
|
|
260
|
+ "feedback",
|
|
261
|
+ "comment-quote",
|
|
262
|
+ i18n.t('screens.feedback.homeButtonTitle'),
|
|
263
|
+ i18n.t('screens.feedback.homeButtonSubtitle'),
|
|
264
|
+ )}
|
251
|
265
|
</List.Section>
|
252
|
266
|
</Card>
|
253
|
267
|
</ScrollView>
|