Treat the App Setting link as a proper link (fixes #375)

master
Thibaut Girka 6 years ago committed by ThibG
parent 88b7ccc2ca
commit 3eb3c21327
  1. 3
      app/javascript/flavours/glitch/features/drawer/header/index.js
  2. 30
      app/javascript/flavours/glitch/features/drawer/index.js

@ -96,9 +96,8 @@ export default function DrawerHeader ({
<a <a
aria-label={intl.formatMessage(messages.settings)} aria-label={intl.formatMessage(messages.settings)}
onClick={onSettingsClick} onClick={onSettingsClick}
role='button' href='#'
title={intl.formatMessage(messages.settings)} title={intl.formatMessage(messages.settings)}
tabIndex='0'
><Icon icon='cogs' /></a> ><Icon icon='cogs' /></a>
<a <a
aria-label={intl.formatMessage(messages.logout)} aria-label={intl.formatMessage(messages.logout)}

@ -37,14 +37,28 @@ const mapStateToProps = state => ({
}); });
// Dispatch mapping. // Dispatch mapping.
const mapDispatchToProps = { const mapDispatchToProps = (dispatch, { intl }) => ({
onChange: changeSearch, onChange (value) {
onClear: clearSearch, dispatch(changeSearch(value));
onClickElefriend: cycleElefriendCompose, },
onShow: showSearch, onClear () {
onSubmit: submitSearch, dispatch(clearSearch());
onOpenSettings: openModal.bind(null, 'SETTINGS', {}), },
}; onClickElefriend () {
dispatch(cycleElefriendCompose());
},
onShow () {
dispatch(showSearch());
},
onSubmit () {
dispatch(submitSearch());
},
onOpenSettings (e) {
e.preventDefault();
e.stopPropagation();
dispatch(openModal('SETTINGS', {}));
},
});
// The component. // The component.
class Drawer extends React.Component { class Drawer extends React.Component {

Loading…
Cancel
Save