Merge pull request #451 from outline/jori/sunday-tweaks

Sunday tweaks
This commit is contained in:
Jori Lallo
2017-11-26 21:14:18 -08:00
committed by GitHub
5 changed files with 19 additions and 4 deletions

View File

@ -193,7 +193,7 @@ class MarkdownEditor extends Component {
>
<MaxWidth column auto>
<Header onClick={this.focusAtStart} readOnly={readOnly} />
<Contents state={this.editorState} />
{readOnly && <Contents state={this.editorState} />}
{!readOnly && (
<Toolbar state={this.editorState} onChange={this.onChange} />
)}

View File

@ -9,7 +9,7 @@ export default function Code({ children, node, readOnly, attributes }: Props) {
const language = node.data.get('language') || 'javascript';
return (
<Container {...attributes}>
<Container {...attributes} spellCheck={false}>
{readOnly && <CopyButton text={node.text} />}
<Pre className={`language-${language}`}>
<code className={`language-${language}`}>{children}</code>

View File

@ -39,8 +39,9 @@ const StyledCopyToClipboard = styled(CopyToClipboard)`
z-index: 1;
font-size: 12px;
background: ${color.slateLight};
border-radius: 2px;
border-radius: 0 2px 0 2px;
padding: 1px 6px;
cursor: pointer;
&:hover {
background: ${color.slate};

View File

@ -2,7 +2,9 @@
import styled from 'styled-components';
import { color } from 'shared/styles/constants';
const InlineCode = styled.code`
const InlineCode = styled.code.attrs({
spellCheck: false,
})`
padding: 0.25em;
background: ${color.smoke};
border-radius: 4px;

View File

@ -78,6 +78,18 @@ class Layout extends React.Component {
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<link
rel="shortcut icon"
type="image/png"
href="/favicon-16.png"
sizes="16x16"
/>
<link
rel="shortcut icon"
type="image/png"
href="/favicon-32.png"
sizes="32x32"
/>
</Helmet>
<Analytics />