Skip to content

Commit f6d0524

Browse files
committed
port Support to new communication methods
also made two things non-class methods that didn't need to be
1 parent aae3de5 commit f6d0524

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

source/views/settings/sections/support.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,36 @@ import * as React from 'react'
33
import {Alert} from 'react-native'
44
import {Section} from 'react-native-tableview-simple'
55
import type {TopLevelViewPropsType} from '../../types'
6-
import {email} from 'react-native-communications'
6+
import {sendEmail} from '../../components/send-email'
77
import DeviceInfo from 'react-native-device-info'
88
import {version} from '../../../../package.json'
99
import {PushButtonCell} from '../../components/cells/push-button'
1010
import {refreshApp} from '../../../lib/refresh'
1111

1212
type 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+
1431
export 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

Comments
 (0)