Skip to content

Commit 02da42b

Browse files
Lex. Huangembbnux
authored andcommitted
feat(MessagesPage): add canNotViewContact prop (ringcentral#596)
* feat(MessagesPage): add canNotViewContact prop * refactor(MessagesPage): canNotViewContact->showViewContact
1 parent bc9754d commit 02da42b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/containers/MessagesPage/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function mapToFunctions(_, {
9898
composeText,
9999
contactSearch,
100100
},
101+
showViewContact = true,
101102
dateTimeFormatter = (...args) => dateTimeFormat.formatDateTime(...args),
102103
dialerRoute = '/dialer',
103104
onCreateContact,
@@ -109,9 +110,9 @@ function mapToFunctions(_, {
109110
}) {
110111
return {
111112
dateTimeFormatter,
112-
onViewContact: onViewContact || (({ contact: { id, type } }) => {
113+
onViewContact: showViewContact ? (onViewContact || (({ contact: { id, type } }) => {
113114
routerInteraction.push(`/contacts/${type}/${id}?direct=true`);
114-
}),
115+
})) : null,
115116
onCreateContact: onCreateContact ?
116117
async ({ phoneNumber, name, entityType }) => {
117118
const hasMatchNumber = await contactMatcher.hasMatchNumber({

0 commit comments

Comments
 (0)