From 7729fc0accab4011d3c6aacb1cdac2091c394e55 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 8 Jul 2021 11:55:35 -0600 Subject: [PATCH] show user profile on avatar and name click --- .../home/report/ReportActionItemSingle.js | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 1b4ead443c9a..9801b6c6dbe6 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -1,5 +1,5 @@ import React from 'react'; -import {View} from 'react-native'; +import {View, Pressable} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import _ from 'underscore'; @@ -14,6 +14,8 @@ import ONYXKEYS from '../../../ONYXKEYS'; import personalDetailsPropType from '../../personalDetailsPropType'; import compose from '../../../libs/compose'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; +import Navigation from '../../../libs/Navigation/Navigation'; +import ROUTES from '../../../ROUTES'; const propTypes = { /** All the data of the action */ @@ -56,24 +58,33 @@ const ReportActionItemSingle = ({ const personArray = displayName ? [{type: 'TEXT', text: Str.isSMSLogin(login) ? toLocalPhone(displayName) : displayName}] : action.person; + + const showUserDetails = (email) => { + Navigation.navigate(`${ROUTES.DETAILS}/${email}`); + }; + return ( - + showUserDetails(action.actorEmail)}> + + - {_.map(personArray, (fragment, index) => ( - - ))} + showUserDetails(action.actorEmail)}> + {_.map(personArray, (fragment, index) => ( + + ))} + {children}