Skip to content

Commit 9c077ba

Browse files
committed
provide a convenience reload button from the feature flags view
1 parent 0348f28 commit 9c077ba

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

source/views/settings/screens/feature-flags.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react'
2-
import {StyleSheet, SectionList} from 'react-native'
2+
import {StyleSheet, Text, SectionList} from 'react-native'
3+
import restart from 'react-native-restart'
34
import * as storage from '../../../lib/storage'
45
import {NativeStackNavigationOptions} from '@react-navigation/native-stack'
56
import {CellToggle} from '@frogpond/tableview/cells'
@@ -9,6 +10,8 @@ import {AppConfig, FeatureFlagType} from '@frogpond/app-config'
910
import {groupBy, orderBy} from 'lodash'
1011
import {LoadingView, NoticeView} from '@frogpond/notice'
1112
import {toLaxTitleCase} from '@frogpond/titlecase'
13+
import {Touchable} from '@frogpond/touchable'
14+
import {commonStyles} from '../../../../modules/navigation-buttons/styles'
1215

1316
export const FeatureFlagsView = (): JSX.Element => {
1417
let [loading, setLoading] = React.useState(true)
@@ -89,4 +92,20 @@ export {FeatureFlagsView as View}
8992

9093
export const NavigationOptions: NativeStackNavigationOptions = {
9194
title: 'Feature Flags',
95+
headerRight: () => (
96+
<Touchable
97+
accessibilityLabel="Apply"
98+
accessibilityRole="button"
99+
accessible={true}
100+
borderless={true}
101+
highlight={false}
102+
onPress={() => restart.Restart()}
103+
style={commonStyles.button}
104+
>
105+
{/* eslint-disable-next-line react-native/no-inline-styles */}
106+
<Text style={[commonStyles.text, {fontWeight: '600', color: c.link}]}>
107+
Reload
108+
</Text>
109+
</Touchable>
110+
),
92111
}

0 commit comments

Comments
 (0)