Skip to content

Commit

Permalink
close popup on opening the user detail
Browse files Browse the repository at this point in the history
  • Loading branch information
dhairyasenjaliya committed May 23, 2023
1 parent f0235bc commit cab3b1a
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions src/pages/home/report/ReactionList/BaseReactionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}) => (
<OptionRow
item={item}
boldStyle
style={{maxWidth: variables.mobileResponsiveWidthBreakpoint}}
hoverStyle={styles.hoveredComponentBG}
onSelectRow={() => {
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
Expand Down Expand Up @@ -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}) => (
<OptionRow
item={item}
boldStyle
style={{maxWidth: variables.mobileResponsiveWidthBreakpoint}}
hoverStyle={styles.hoveredComponentBG}
onSelectRow={() => {
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 (
<>
<HeaderReactionList
Expand Down

0 comments on commit cab3b1a

Please sign in to comment.