diff options
Diffstat (limited to 'app/assets/javascripts/components/components/dropdown_menu.jsx')
-rw-r--r-- | app/assets/javascripts/components/components/dropdown_menu.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/components/dropdown_menu.jsx b/app/assets/javascripts/components/components/dropdown_menu.jsx index 619605f63..f58a36d29 100644 --- a/app/assets/javascripts/components/components/dropdown_menu.jsx +++ b/app/assets/javascripts/components/components/dropdown_menu.jsx @@ -9,7 +9,12 @@ const DropdownMenu = ({ icon, items, size }) => { <DropdownContent style={{ lineHeight: '18px' }}> <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> </DropdownContent> </Dropdown> |