Browse Source

Add "edit profile" link to dropdown on own profile

master
Eugen Rochko 8 years ago
parent
commit
a3384b6ea6
2 changed files with 7 additions and 2 deletions
  1. +6
    -1
      app/assets/javascripts/components/components/dropdown_menu.jsx
  2. +1
    -1
      app/assets/javascripts/components/features/account/components/action_bar.jsx

+ 6
- 1
app/assets/javascripts/components/components/dropdown_menu.jsx View File

@ -9,7 +9,12 @@ const DropdownMenu = ({ icon, items, size }) => {
<DropdownContent style={{ lineHeight: '18px' }}> <DropdownContent style={{ lineHeight: '18px' }}>
<ul> <ul>
{items.map(({ text, action }, i) => <li key={i}><a href='#' onClick={e => { e.preventDefault(); action(); }}>{text}</a></li>)}
{items.map(({ text, action, href = '#' }, i) => <li key={i}><a href={href} target='_blank' rel='noopener' onClick={e => {
if (typeof action === 'function') {
e.preventDefault();
action();
}
}}>{text}</a></li>)}
</ul> </ul>
</DropdownContent> </DropdownContent>
</Dropdown> </Dropdown>

+ 1
- 1
app/assets/javascripts/components/features/account/components/action_bar.jsx View File

@ -19,7 +19,7 @@ const ActionBar = React.createClass({
let menu = []; let menu = [];
if (account.get('id') === me) { if (account.get('id') === me) {
menu.push({ text: 'Edit profile', href: '/settings/profile' });
} else if (account.getIn(['relationship', 'blocking'])) { } else if (account.getIn(['relationship', 'blocking'])) {
menu.push({ text: 'Unblock', action: this.props.onBlock }); menu.push({ text: 'Unblock', action: this.props.onBlock });
} else if (account.getIn(['relationship', 'following'])) { } else if (account.getIn(['relationship', 'following'])) {

Loading…
Cancel
Save