Merge pull request #283 from jorilallo/kb-shortcuts
Shortcuts Documentation
This commit is contained in:
@@ -22,6 +22,11 @@ export default function KeyboardShortcuts() {
|
||||
return this.toggleMark(state, 'underlined');
|
||||
case 'd':
|
||||
return this.toggleMark(state, 'deleted');
|
||||
case 'k':
|
||||
return state
|
||||
.transform()
|
||||
.wrapInline({ type: 'link', data: { href: '' } })
|
||||
.apply();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
||||
import { color } from 'styles/constants';
|
||||
|
||||
const HelpText = styled.p`
|
||||
margin-top: 0;
|
||||
color: ${color.slateDark};
|
||||
`;
|
||||
|
||||
|
||||
3
frontend/components/Key/index.js
Normal file
3
frontend/components/Key/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
import Key from './key';
|
||||
export default Key;
|
||||
19
frontend/components/Key/key.js
Normal file
19
frontend/components/Key/key.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// @flow
|
||||
import styled from 'styled-components';
|
||||
import { color } from 'styles/constants';
|
||||
|
||||
const Key = styled.kbd`
|
||||
display: inline-block;
|
||||
padding: 4px 6px;
|
||||
font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
line-height: 10px;
|
||||
color: ${color.text};
|
||||
vertical-align: middle;
|
||||
background-color: ${color.smokeLight};
|
||||
border: solid 1px ${color.slateLight};
|
||||
border-bottom-color: ${color.slate};
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 -1px 0 ${color.slate};
|
||||
`;
|
||||
|
||||
export default Key;
|
||||
@@ -69,7 +69,7 @@ type Props = {
|
||||
}
|
||||
|
||||
@keydown('shift+/')
|
||||
goToOpenKeyboardShortcuts() {
|
||||
openKeyboardShortcuts() {
|
||||
this.props.ui.setActiveModal('keyboard-shortcuts');
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ type Props = {
|
||||
const Modal = ({
|
||||
children,
|
||||
isOpen,
|
||||
title = 'Untitled Modal',
|
||||
title = 'Untitled',
|
||||
onRequestClose,
|
||||
...rest
|
||||
}: Props) => {
|
||||
@@ -61,7 +61,8 @@ const StyledModal = styled(ReactModal)`
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background: white;
|
||||
padding: 15vh 2rem 2rem
|
||||
padding: 13vh 2rem 2rem;
|
||||
outline: none;
|
||||
`;
|
||||
|
||||
const Close = styled.a`
|
||||
|
||||
Reference in New Issue
Block a user