-
Notifications
You must be signed in to change notification settings - Fork 376
/
ActionsAdd.js
31 lines (27 loc) · 908 Bytes
/
ActionsAdd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { withNamespaces } from 'react-i18next'
import { withNavigation } from 'react-navigation'
import React from 'react'
import ActionList from './ActionList'
const ActionsAdd = ({ data, self, context, navigation, inModal, t }) => (
<ActionList inModal={inModal}>
<ActionList.Action
icon={'plus'}
title={t('contacts.add-action')}
dismissOnSuccess
action={async () => {
await context.node.service.contactRequest({
contactId: data.id,
contactOverrideDisplayName:
data.overrideDisplayName || data.displayName || '',
introText: '',
})
const beforeDismiss = navigation.getParam('beforeDismiss')
if (beforeDismiss) {
beforeDismiss()
}
}}
successMessage={t('contacts.add-action-feedback')}
/>
</ActionList>
)
export default withNamespaces()(withNavigation(ActionsAdd))