rename showUserDetails -> avatarClick for conversationHeader

pull/715/head
Audric Ackermann 5 years ago
parent 43956709ad
commit ab0ff9c3ad

@ -259,7 +259,7 @@
window.Whisper.events.trigger('inviteFriends', this.model); window.Whisper.events.trigger('inviteFriends', this.model);
}, },
onShowUserDetails: pubkey => { onAvatarClick: pubkey => {
if (this.model.isPrivate()) { if (this.model.isPrivate()) {
window.Whisper.events.trigger('onShowUserDetails', { window.Whisper.events.trigger('onShowUserDetails', {
userPubKey: pubkey, userPubKey: pubkey,

@ -80,14 +80,14 @@ interface Props {
onLeaveGroup: () => void; onLeaveGroup: () => void;
onInviteFriends: () => void; onInviteFriends: () => void;
onShowUserDetails?: (userPubKey: string) => void; onAvatarClick?: (userPubKey: string) => void;
i18n: LocalizerType; i18n: LocalizerType;
} }
export class ConversationHeader extends React.Component<Props> { export class ConversationHeader extends React.Component<Props> {
public showMenuBound: (event: React.MouseEvent<HTMLDivElement>) => void; public showMenuBound: (event: React.MouseEvent<HTMLDivElement>) => void;
public onShowUserDetailsBound: (userPubKey: string) => void; public onAvatarClickBound: (userPubKey: string) => void;
public menuTriggerRef: React.RefObject<any>; public menuTriggerRef: React.RefObject<any>;
public constructor(props: Props) { public constructor(props: Props) {
@ -95,7 +95,7 @@ export class ConversationHeader extends React.Component<Props> {
this.menuTriggerRef = React.createRef(); this.menuTriggerRef = React.createRef();
this.showMenuBound = this.showMenu.bind(this); this.showMenuBound = this.showMenu.bind(this);
this.onShowUserDetailsBound = this.onShowUserDetails.bind(this); this.onAvatarClickBound = this.onAvatarClick.bind(this);
} }
public showMenu(event: React.MouseEvent<HTMLDivElement>) { public showMenu(event: React.MouseEvent<HTMLDivElement>) {
@ -207,7 +207,7 @@ export class ConversationHeader extends React.Component<Props> {
borderColor={borderColor} borderColor={borderColor}
borderWidth={2} borderWidth={2}
onAvatarClick={() => { onAvatarClick={() => {
this.onShowUserDetailsBound(phoneNumber); this.onAvatarClickBound(phoneNumber);
}} }}
/> />
</span> </span>
@ -361,9 +361,9 @@ export class ConversationHeader extends React.Component<Props> {
); );
} }
public onShowUserDetails(userPubKey: string) { public onAvatarClick(userPubKey: string) {
if (this.props.onShowUserDetails) { if (this.props.onAvatarClick) {
this.props.onShowUserDetails(userPubKey); this.props.onAvatarClick(userPubKey);
} }
} }

Loading…
Cancel
Save