about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-25 14:46:14 +0200
committerThibG <thib@sitedethib.com>2018-11-19 15:56:38 +0100
commitb3ff35a75cf04e4aba2712a9d0897257cf79af82 (patch)
tree51f5b0b0c61c6b58ad0f866179c900bc40c2a0e8 /app/javascript/flavours/glitch/features/account
parenta77ee0bb6dcafffebc55db145ef4bac8038ae2a1 (diff)
Move URLs to backend in their own file
Diffstat (limited to 'app/javascript/flavours/glitch/features/account')
-rw-r--r--app/javascript/flavours/glitch/features/account/components/action_bar.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/account/components/action_bar.js b/app/javascript/flavours/glitch/features/account/components/action_bar.js
index acbe46f8a..ffa5b7e5e 100644
--- a/app/javascript/flavours/glitch/features/account/components/action_bar.js
+++ b/app/javascript/flavours/glitch/features/account/components/action_bar.js
@@ -5,6 +5,7 @@ import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_cont
 import { NavLink } from 'react-router-dom';
 import { defineMessages, injectIntl, FormattedMessage, FormattedNumber } from 'react-intl';
 import { me, isStaff } from 'flavours/glitch/util/initial_state';
+import { profileLink, accountAdminLink } from 'flavours/glitch/util/backend_links';
 
 const messages = defineMessages({
   mention: { id: 'account.mention', defaultMessage: 'Mention @{name}' },
@@ -77,7 +78,9 @@ export default class ActionBar extends React.PureComponent {
     menu.push(null);
 
     if (account.get('id') === me) {
-      menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });
+      if (profileLink !== undefined) {
+        menu.push({ text: intl.formatMessage(messages.edit_profile), href: profileLink });
+      }
     } else {
       if (account.getIn(['relationship', 'following'])) {
         if (account.getIn(['relationship', 'showing_reblogs'])) {
@@ -131,9 +134,12 @@ export default class ActionBar extends React.PureComponent {
       }
     }
 
-    if (account.get('id') !== me && isStaff) {
+    if (account.get('id') !== me && isStaff && (accountAdminLink !== undefined)) {
       menu.push(null);
-      menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });
+      menu.push({
+        text: intl.formatMessage(messages.admin_account, { name: account.get('username') }),
+        href: accountAdminLink(account.get('id')),
+      });
     }
 
     return (