diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2017-12-21 18:47:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-21 18:47:07 -0500 |
commit | 60d415bc5e05c6f82d8ca643f52f6081246614f7 (patch) | |
tree | da81b436e1b7c3e91ff039d1f9e21f4f3f92fb6d /app/javascript/flavours/glitch/features/ui/index.js | |
parent | f78d169d7190a65501c65c05daa70fd03de20ee7 (diff) | |
parent | d736739e8ff79044be6f605cd28c89ead710aec6 (diff) |
Merge pull request #266 from chriswmartin/getting-started-improvements
Getting started column improvements
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/index.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 698ae996c..5c80ea07b 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -20,6 +20,7 @@ import { Compose, Status, GettingStarted, + KeyboardShortcuts, PublicTimeline, CommunityTimeline, AccountTimeline, @@ -40,6 +41,7 @@ import { Mutes, PinnedStatuses, Lists, + GettingStartedMisc, } from 'flavours/glitch/util/async-components'; import { HotKeys } from 'react-hotkeys'; import { me } from 'flavours/glitch/util/initial_state'; @@ -62,6 +64,7 @@ const mapStateToProps = state => ({ }); const keyMap = { + help: '?', new: 'n', search: 's', forceNew: 'option+n', @@ -311,6 +314,14 @@ export default class UI extends React.Component { this.hotkeys = c; } + handleHotkeyToggleHelp = () => { + if (this.props.location.pathname === '/keyboard-shortcuts') { + this.context.router.history.goBack(); + } else { + this.context.router.history.push('/keyboard-shortcuts'); + } + } + handleHotkeyGoToHome = () => { this.context.router.history.push('/timelines/home'); } @@ -377,6 +388,7 @@ export default class UI extends React.Component { }); const handlers = { + help: this.handleHotkeyToggleHelp, new: this.handleHotkeyNew, search: this.handleHotkeySearch, forceNew: this.handleHotkeyForceNew, @@ -404,6 +416,7 @@ export default class UI extends React.Component { <WrappedSwitch> <Redirect from='/' to='/getting-started' exact /> <WrappedRoute path='/getting-started' component={GettingStarted} content={children} /> + <WrappedRoute path='/keyboard-shortcuts' component={KeyboardShortcuts} content={children} /> <WrappedRoute path='/timelines/home' component={HomeTimeline} content={children} /> <WrappedRoute path='/timelines/public' exact component={PublicTimeline} content={children} /> <WrappedRoute path='/timelines/public/local' component={CommunityTimeline} content={children} /> @@ -428,6 +441,7 @@ export default class UI extends React.Component { <WrappedRoute path='/blocks' component={Blocks} content={children} /> <WrappedRoute path='/mutes' component={Mutes} content={children} /> <WrappedRoute path='/lists' component={Lists} content={children} /> + <WrappedRoute path='/getting-started-misc' component={GettingStartedMisc} content={children} /> <WrappedRoute component={GenericNotFound} content={children} /> </WrappedSwitch> |