diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index 373f119c0..7db81e2fc 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -20,6 +20,8 @@ import { debounce } from 'lodash'; import StillImage from 'soapbox/components/still_image'; import ActionButton from 'soapbox/features/ui/components/action_button'; import { isVerified } from 'soapbox/utils/accounts'; +import { openModal } from 'soapbox/actions/modal'; +import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; const messages = defineMessages({ edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' }, @@ -105,6 +107,24 @@ class Header extends ImmutablePureComponent { trailing: true, }); + onAvatarClick = () => { + const avatar_url = this.props.account.get('avatar'); + const avatar = ImmutableMap({ + type: 'image', + preview_url: avatar_url, + url: avatar_url, + description: '', + }); + this.props.dispatch(openModal('MEDIA', { media: ImmutableList.of(avatar), index: 0 })); + } + + handleAvatarClick = (e) => { + if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { + e.preventDefault(); + this.onAvatarClick(); + } + } + makeMenu() { const { account, intl, me, isStaff, version } = this.props; @@ -255,9 +275,9 @@ class Header extends ImmutablePureComponent {
-
+ -
+