-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes [6654] Clicking on user avatar (profile picture) in header doesn't open conversation details #6658
fixes [6654] Clicking on user avatar (profile picture) in header doesn't open conversation details #6658
Changes from 2 commits
ec5705c
1bb1e3a
361468c
650c2f5
29ffac9
795293e
62ac48f
3f30a7b
d22828d
0de7f40
6842129
15ddae1
7106352
842332a
308270f
8c2ce6b
20356ac
e6de7d8
16186d5
db78a63
824d252
7e02619
70c7d2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,7 +242,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> { | |
storyViewMode: StoryViewModeType.User, | ||
}); | ||
} | ||
: undefined | ||
: this.getActionForType() | ||
} | ||
phoneNumber={phoneNumber} | ||
profileName={profileName} | ||
|
@@ -679,7 +679,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> { | |
); | ||
} | ||
|
||
private renderHeader(): ReactNode { | ||
private getActionForType() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Combined with the change to (As a side note, if hypothetically we wanted to keep this new onClick generator, it's maybe more clear to name it verbosely such as |
||
const { groupVersion, pushPanelForConversation, type } = this.props; | ||
|
||
let onClick: undefined | (() => void); | ||
|
@@ -703,7 +703,10 @@ export class ConversationHeader extends React.Component<PropsType, StateType> { | |
default: | ||
throw missingCaseError(type); | ||
} | ||
|
||
return onClick; | ||
} | ||
private renderHeader(): ReactNode { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, I think we can revert this change and keep |
||
const onClick = this.getActionForType(); | ||
const avatar = this.renderAvatar(); | ||
const contents = ( | ||
<div className="module-ConversationHeader__header__info"> | ||
|
@@ -905,4 +908,4 @@ function OutgoingCallButtons({ | |
default: | ||
throw missingCaseError(outgoingCallButtonStyle); | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The app's eslint style guide specifies trailing newlines. Can you revert this newline deletion? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this function would be called a duplicate time from
renderHeader()
.Also
renderAvatar()
is only called fromrenderHeader()
.What if we change
renderAvatar()
to take theonClick
handler generated earlier?It can look like this to indicate it's a fallback handler in case the stories handler isn't needed:
Then it will be simpler and we would not recreate the handler function.