Skip to content

Commit

Permalink
use correct naming for accelerometer permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
southerneer committed Mar 12, 2020
1 parent 4b751c1 commit ebdb26e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/components/Onboarding/OnboardingAccelerometer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {RText, GradientButton} from '../common'
import {WHITE} from 'src/constants/colors'
import {s} from '../Global'
import {onboardingSlideStyle as styles} from '../styles'
import {accelerometerSettingsName} from '../modals/MotionWarning'

type Props = {
onPress: () => void // the function that gets called when the user presses "Allow Accelerometer"
Expand All @@ -19,13 +20,13 @@ const OnboardingAccelerometer = ({onPress}: Props) => (
}}
>
<View style={{width: '80%', marginBottom: 33 * s}}>
<RText style={styles.onboardingH1}>Allow{'\r\n'} Accelerometer</RText>
<RText style={styles.onboardingH1}>{`Allow\r\n${accelerometerSettingsName}`}</RText>
</View>

<View style={{width: '70%', marginBottom: 42 * s}}>
<RText style={styles.onboardingSubtext}>
Using the accelerometer increases battery-efficiency by intelligently toggling
location-tracking while moving.
{`Using ${accelerometerSettingsName} increases battery-efficiency by intelligently toggling
location-tracking while moving.`}
</RText>
</View>

Expand Down
9 changes: 5 additions & 4 deletions src/components/modals/MotionWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {useAppState} from 'react-native-hooks'
import {Actions} from 'react-native-router-flux'
import {usePermissionStore} from '../../utils/injectors'

export const accelerometerSettingsName =
Platform.OS === 'ios' ? 'Motion & Fitness' : 'Physical Activity'

const MotionWarning = observer(() => {
const currentAppState = useAppState()
const permissionStore = usePermissionStore()
Expand All @@ -21,8 +24,6 @@ const MotionWarning = observer(() => {
}
}, [currentAppState])

const settingsName = Platform.OS === 'ios' ? 'Motion & Fitness' : 'Physical Activity'

return (
<View
style={[
Expand All @@ -35,10 +36,10 @@ const MotionWarning = observer(() => {
]}
>
<BlurView blurType="xlight" blurAmount={10} style={StyleSheet.absoluteFill as any} />
<RText style={styles.title}>{`Allow\r\n${settingsName}`}</RText>
<RText style={styles.title}>{`Allow\r\n${accelerometerSettingsName}`}</RText>

<RText style={styles.subtext}>
{`Using "${settingsName}" increases battery efficiency by intelligently toggling location tracking while moving.`}
{`Using "${accelerometerSettingsName}" increases battery efficiency by intelligently toggling location tracking while moving.`}
</RText>

<Image
Expand Down

0 comments on commit ebdb26e

Please sign in to comment.