@@ -3,38 +3,36 @@ import * as React from 'react'
33import { Alert } from 'react-native'
44import { Section } from 'react-native-tableview-simple'
55import type { TopLevelViewPropsType } from '../../types'
6- import { email } from 'react-native-communications '
6+ import { sendEmail } from '../../components/send-email '
77import DeviceInfo from 'react-native-device-info'
88import { version } from '../../../../package.json'
99import { PushButtonCell } from '../../components/cells/push-button'
1010import { refreshApp } from '../../../lib/refresh'
1111
1212type Props = TopLevelViewPropsType
1313
14+ const getDeviceInfo = ( ) => `
15+
16+ ----- Please do not edit below here -----
17+ ${ DeviceInfo . getBrand ( ) } ${ DeviceInfo . getModel ( ) }
18+ ${ DeviceInfo . getDeviceId ( ) }
19+ ${ DeviceInfo . getSystemName ( ) } ${ version }
20+ ${ DeviceInfo . getReadableVersion ( ) }
21+ `
22+
23+ const openEmail = ( ) => {
24+ sendEmail ( {
25+ 26+ subject : 'Support: All About Olaf' ,
27+ body : getDeviceInfo ( ) ,
28+ } )
29+ }
30+
1431export default class SupportSection extends React . PureComponent < Props > {
1532 onPressButton = ( id : string ) => {
1633 this . props . navigation . navigate ( id )
1734 }
1835
19- getDeviceInfo = ( ) => `
20-
21- ----- Please do not edit below here -----
22- ${ DeviceInfo . getBrand ( ) } ${ DeviceInfo . getModel ( ) }
23- ${ DeviceInfo . getDeviceId ( ) }
24- ${ DeviceInfo . getSystemName ( ) } ${ version }
25- ${ DeviceInfo . getReadableVersion ( ) }
26- `
27-
28- openEmail = ( ) = > {
29- email (
30- 31- null,
32- null,
33- 'Support: All About Olaf' ,
34- this . getDeviceInfo( ) ,
35- )
36- }
37-
3836 onFaqButton = ( ) => this . onPressButton ( 'FaqView' )
3937
4038 onResetButton = ( ) => {
@@ -55,7 +53,7 @@ export default class SupportSection extends React.PureComponent<Props> {
5553 render ( ) {
5654 return (
5755 < Section header = "SUPPORT" >
58- < PushButtonCell onPress = { this . openEmail } title = "Contact Us" />
56+ < PushButtonCell onPress = { openEmail } title = "Contact Us" />
5957 < PushButtonCell onPress = { this . onFaqButton } title = "FAQs" />
6058 < PushButtonCell onPress = { this . onResetButton } title = "Reset Everything" />
6159 </ Section >
0 commit comments