From cab3b1a7dabf49c0bc3ccb0f63b270ae075b10e9 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 23 May 2023 13:33:01 +0530 Subject: [PATCH] close popup on opening the user detail --- .../report/ReactionList/BaseReactionList.js | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/pages/home/report/ReactionList/BaseReactionList.js b/src/pages/home/report/ReactionList/BaseReactionList.js index 8470863786f6..d42a2284f22f 100755 --- a/src/pages/home/report/ReactionList/BaseReactionList.js +++ b/src/pages/home/report/ReactionList/BaseReactionList.js @@ -33,40 +33,6 @@ const defaultProps = { hasUserReacted: false, }; -/** - * Given an emoji item object, render a component based on its type. - * Items with the code "SPACER" return nothing and are used to fill rows up to 8 - * so that the sticky headers function properly - * - * @param {Object} params - * @param {Object} params.item - * @return {React.Component} - */ -const renderItem = ({item}) => ( - { - Navigation.navigate(ROUTES.getDetailsRoute(item.login)); - }} - option={{ - text: Str.removeSMSDomain(item.displayName), - alternateText: Str.removeSMSDomain(item.login), - participantsList: [item], - icons: [ - { - source: ReportUtils.getAvatar(item.avatar, item.login), - name: item.login, - type: CONST.ICON_TYPE_AVATAR, - }, - ], - keyForList: item.login, - }} - /> -); - /** * Create a unique key for each action in the FlatList. * @param {Object} item @@ -95,6 +61,42 @@ const BaseReactionList = (props) => { if (!props.isVisible) { return null; } + + /** + * Given an emoji item object, render a component based on its type. + * Items with the code "SPACER" return nothing and are used to fill rows up to 8 + * so that the sticky headers function properly + * + * @param {Object} params + * @param {Object} params.item + * @return {React.Component} + */ + const renderItem = ({item}) => ( + { + props.onClose(); + Navigation.navigate(ROUTES.getDetailsRoute(item.login)); + }} + option={{ + text: Str.removeSMSDomain(item.displayName), + alternateText: Str.removeSMSDomain(item.login), + participantsList: [item], + icons: [ + { + source: ReportUtils.getAvatar(item.avatar, item.login), + name: item.login, + type: CONST.ICON_TYPE_AVATAR, + }, + ], + keyForList: item.login, + }} + /> + ); + return ( <>