Skip to content

Commit 6afc1b8

Browse files
committed
port StudentWorkDetailView to new communication methods
1 parent da83662 commit 6afc1b8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

source/views/sis/student-work/detail.android.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// @flow
22
import * as React from 'react'
33
import {Text, View, ScrollView, StyleSheet} from 'react-native'
4-
import {email} from 'react-native-communications'
4+
import {sendEmail} from '../../components/send-email'
55
import {Card} from '../../components/card'
66
import moment from 'moment'
7-
import openUrl from '../../components/open-url'
7+
import {openUrl} from '../../components/open-url'
88
import * as c from '../../components/colors'
99
import type {JobType} from './types'
1010
import {cleanJob, getContactName, getLinksFromJob} from './clean-job'
@@ -62,7 +62,9 @@ function Contact({job}: {job: JobType}) {
6262
return job.office || contactName ? (
6363
<Card header="Contact" style={styles.card}>
6464
<Text
65-
onPress={() => email([job.contactEmail], null, null, job.title, '')}
65+
onPress={() =>
66+
sendEmail({to: [job.contactEmail], subject: job.title, body: ''})
67+
}
6668
style={styles.cardBody}
6769
>
6870
{contactName} {job.title ? `(${job.title})` : ''}

source/views/sis/student-work/detail.ios.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// @flow
22
import * as React from 'react'
33
import {Text, ScrollView, StyleSheet} from 'react-native'
4-
import {email} from 'react-native-communications'
4+
import {sendEmail} from '../../components/send-email'
55
import {Cell, Section, TableView} from 'react-native-tableview-simple'
66
import moment from 'moment'
7-
import openUrl from '../../components/open-url'
7+
import {openUrl} from '../../components/open-url'
88
import * as c from '../../components/colors'
99
import type {JobType} from './types'
1010
import {cleanJob, getContactName, getLinksFromJob} from './clean-job'
@@ -39,7 +39,9 @@ function Information({job}: {job: JobType}) {
3939
accessory="DisclosureIndicator"
4040
cellStyle="LeftDetail"
4141
detail={'Contact'}
42-
onPress={() => email([job.contactEmail], null, null, job.title, '')}
42+
onPress={() =>
43+
sendEmail({to: [job.contactEmail], subject: job.title, body: ''})
44+
}
4345
title={getContactName(job).trim() || job.contactEmail}
4446
/>
4547
) : null

0 commit comments

Comments
 (0)