about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account/components/header.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-21 07:25:46 +0200
committerThibG <thib@sitedethib.com>2018-09-21 12:56:42 +0200
commit5833cc41c2a3e53332968dbeed384f565472eba4 (patch)
tree78fc594c5246650f105a7dc0bea7de30da420c95 /app/javascript/flavours/glitch/features/account/components/header.js
parentc1701ae2a837d7e6a59fc98d800a4c67fc4adaa8 (diff)
[Glitch] Add edit profile action button to profile
Port some parts from 1a7a74ff76a129031a3fd6d73688ab9409899002
Diffstat (limited to 'app/javascript/flavours/glitch/features/account/components/header.js')
-rw-r--r--app/javascript/flavours/glitch/features/account/components/header.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js
index eda0d637e..9cf2e9131 100644
--- a/app/javascript/flavours/glitch/features/account/components/header.js
+++ b/app/javascript/flavours/glitch/features/account/components/header.js
@@ -15,6 +15,7 @@ const messages = defineMessages({
   follow: { id: 'account.follow', defaultMessage: 'Follow' },
   requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },
   unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
+  edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
 });
 
 @injectIntl
@@ -27,6 +28,10 @@ export default class Header extends ImmutablePureComponent {
     intl: PropTypes.object.isRequired,
   };
 
+  openEditProfile = () => {
+    window.open('/settings/profile', '_blank');
+  }
+
   render () {
     const { account, intl } = this.props;
 
@@ -77,6 +82,12 @@ export default class Header extends ImmutablePureComponent {
           </div>
         );
       }
+    } else {
+      actionBtn = (
+        <div className='account--action-button'>
+          <IconButton size={26} icon='pencil' title={intl.formatMessage(messages.edit_profile)} onClick={this.openEditProfile} />
+        </div>
+      );
     }
 
     if (account.get('moved') && !account.getIn(['relationship', 'following'])) {