about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-23 16:03:30 +0200
committerThibG <thib@sitedethib.com>2018-07-30 14:31:45 +0200
commit3eb3c21327b262ad7a3b929248ff30161ab87da3 (patch)
tree80d046bcd6896a07c82a75073b1c0471fea65a11
parent88b7ccc2cae1bec5104459b881cfa49969753498 (diff)
Treat the App Setting link as a proper link (fixes #375)
-rw-r--r--app/javascript/flavours/glitch/features/drawer/header/index.js3
-rw-r--r--app/javascript/flavours/glitch/features/drawer/index.js30
2 files changed, 23 insertions, 10 deletions
diff --git a/app/javascript/flavours/glitch/features/drawer/header/index.js b/app/javascript/flavours/glitch/features/drawer/header/index.js
index 6949cd028..deec42435 100644
--- a/app/javascript/flavours/glitch/features/drawer/header/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/header/index.js
@@ -96,9 +96,8 @@ export default function DrawerHeader ({
       <a
         aria-label={intl.formatMessage(messages.settings)}
         onClick={onSettingsClick}
-        role='button'
+        href='#'
         title={intl.formatMessage(messages.settings)}
-        tabIndex='0'
       ><Icon icon='cogs' /></a>
       <a
         aria-label={intl.formatMessage(messages.logout)}
diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js
index e6a689575..1679e9a4b 100644
--- a/app/javascript/flavours/glitch/features/drawer/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/index.js
@@ -37,14 +37,28 @@ const mapStateToProps = state => ({
 });
 
 //  Dispatch mapping.
-const mapDispatchToProps = {
-  onChange: changeSearch,
-  onClear: clearSearch,
-  onClickElefriend: cycleElefriendCompose,
-  onShow: showSearch,
-  onSubmit: submitSearch,
-  onOpenSettings: openModal.bind(null, 'SETTINGS', {}),
-};
+const mapDispatchToProps = (dispatch, { intl }) => ({
+  onChange (value) {
+    dispatch(changeSearch(value));
+  },
+  onClear () {
+    dispatch(clearSearch());
+  },
+  onClickElefriend () {
+    dispatch(cycleElefriendCompose());
+  },
+  onShow () {
+    dispatch(showSearch());
+  },
+  onSubmit () {
+    dispatch(submitSearch());
+  },
+  onOpenSettings (e) {
+    e.preventDefault();
+    e.stopPropagation();
+    dispatch(openModal('SETTINGS', {}));
+  },
+});
 
 //  The component.
 class Drawer extends React.Component {