diff options
author | 2019-08-22 12:03:10 +0200 | |
---|---|---|
committer | 2019-08-22 12:03:10 +0200 | |
commit | df67b6e6adefc9a603e9568a3979881ba98fd3fa (patch) | |
tree | 978c4456e8d5ce9926314faf1b31f308ed9ff708 /src/components/layout/Sidebar.js | |
parent | Remove duplicate features list (diff) | |
download | ferdium-app-df67b6e6adefc9a603e9568a3979881ba98fd3fa.tar.gz ferdium-app-df67b6e6adefc9a603e9568a3979881ba98fd3fa.tar.zst ferdium-app-df67b6e6adefc9a603e9568a3979881ba98fd3fa.zip |
Improve onboarding experience
Diffstat (limited to 'src/components/layout/Sidebar.js')
-rw-r--r-- | src/components/layout/Sidebar.js | 81 |
1 files changed, 49 insertions, 32 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index f43bc0b58..3d8bcddb0 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; | |||
3 | import ReactTooltip from 'react-tooltip'; | 3 | import ReactTooltip from 'react-tooltip'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
5 | import { observer } from 'mobx-react'; | 5 | import { observer } from 'mobx-react'; |
6 | import { Link } from 'react-router'; | ||
6 | 7 | ||
7 | import Tabbar from '../services/tabs/Tabbar'; | 8 | import Tabbar from '../services/tabs/Tabbar'; |
8 | import { ctrlKey } from '../../environment'; | 9 | import { ctrlKey } from '../../environment'; |
@@ -81,6 +82,7 @@ export default @observer class Sidebar extends Component { | |||
81 | const workspaceToggleMessage = ( | 82 | const workspaceToggleMessage = ( |
82 | isWorkspaceDrawerOpen ? messages.closeWorkspaceDrawer : messages.openWorkspaceDrawer | 83 | isWorkspaceDrawerOpen ? messages.closeWorkspaceDrawer : messages.openWorkspaceDrawer |
83 | ); | 84 | ); |
85 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); | ||
84 | 86 | ||
85 | return ( | 87 | return ( |
86 | <div className="sidebar"> | 88 | <div className="sidebar"> |
@@ -89,38 +91,53 @@ export default @observer class Sidebar extends Component { | |||
89 | enableToolTip={() => this.enableToolTip()} | 91 | enableToolTip={() => this.enableToolTip()} |
90 | disableToolTip={() => this.disableToolTip()} | 92 | disableToolTip={() => this.disableToolTip()} |
91 | /> | 93 | /> |
92 | {workspaceStore.isFeatureEnabled ? ( | 94 | { |
93 | <button | 95 | isLoggedIn ? ( |
94 | type="button" | 96 | <> |
95 | onClick={() => { | 97 | {workspaceStore.isFeatureEnabled ? ( |
96 | toggleWorkspaceDrawer(); | 98 | <button |
97 | this.updateToolTip(); | 99 | type="button" |
98 | }} | 100 | onClick={() => { |
99 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} | 101 | toggleWorkspaceDrawer(); |
100 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+D)`} | 102 | this.updateToolTip(); |
101 | > | 103 | }} |
102 | <i className="mdi mdi-view-grid" /> | 104 | className={`sidebar__button sidebar__button--workspaces ${isWorkspaceDrawerOpen ? 'is-active' : ''}`} |
103 | </button> | 105 | data-tip={`${intl.formatMessage(workspaceToggleMessage)} (${ctrlKey}+D)`} |
104 | ) : null} | 106 | > |
105 | <button | 107 | <i className="mdi mdi-view-grid" /> |
106 | type="button" | 108 | </button> |
107 | onClick={() => { | 109 | ) : null} |
108 | toggleMuteApp(); | 110 | |
109 | this.updateToolTip(); | 111 | <button |
110 | }} | 112 | type="button" |
111 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} | 113 | onClick={() => { |
112 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`} | 114 | toggleMuteApp(); |
113 | > | 115 | this.updateToolTip(); |
114 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> | 116 | }} |
115 | </button> | 117 | className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`} |
116 | <button | 118 | data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`} |
117 | type="button" | 119 | > |
118 | onClick={() => openSettings({ path: 'recipes' })} | 120 | <i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} /> |
119 | className="sidebar__button sidebar__button--new-service" | 121 | </button> |
120 | data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`} | 122 | <button |
121 | > | 123 | type="button" |
122 | <i className="mdi mdi-plus-box" /> | 124 | onClick={() => openSettings({ path: 'recipes' })} |
123 | </button> | 125 | className="sidebar__button sidebar__button--new-service" |
126 | data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`} | ||
127 | > | ||
128 | <i className="mdi mdi-plus-box" /> | ||
129 | </button> | ||
130 | </> | ||
131 | ) : ( | ||
132 | <Link | ||
133 | to="/auth/welcome" | ||
134 | className="sidebar__button sidebar__button--new-service" | ||
135 | data-tip="Login"> | ||
136 | <i className="mdi mdi-login-variant" /> | ||
137 | </Link> | ||
138 | ) | ||
139 | } | ||
140 | |||
124 | <button | 141 | <button |
125 | type="button" | 142 | type="button" |
126 | onClick={() => openSettings({ path: 'app' })} | 143 | onClick={() => openSettings({ path: 'app' })} |