|
|
@ -1,6 +1,7 @@
|
|
|
|
// Theirs
|
|
|
|
// Theirs
|
|
|
|
import React from 'react'
|
|
|
|
import React from 'react'
|
|
|
|
import { withRouter } from 'next/router'
|
|
|
|
import { withRouter } from 'next/router'
|
|
|
|
|
|
|
|
import debounce from 'lodash.debounce'
|
|
|
|
|
|
|
|
|
|
|
|
// Ours
|
|
|
|
// Ours
|
|
|
|
import Editor from '../components/Editor'
|
|
|
|
import Editor from '../components/Editor'
|
|
|
@ -13,13 +14,17 @@ import { saveSettings, clearSettings, omit } from '../lib/util'
|
|
|
|
class Index extends React.Component {
|
|
|
|
class Index extends React.Component {
|
|
|
|
shouldComponentUpdate = () => false
|
|
|
|
shouldComponentUpdate = () => false
|
|
|
|
|
|
|
|
|
|
|
|
onEditorUpdate = state => {
|
|
|
|
onEditorUpdate = debounce(
|
|
|
|
updateQueryString(this.props.router, state)
|
|
|
|
state => {
|
|
|
|
saveSettings(
|
|
|
|
updateQueryString(this.props.router, state)
|
|
|
|
localStorage,
|
|
|
|
saveSettings(
|
|
|
|
omit(state, ['code', 'backgroundImage', 'backgroundImageSelection', 'filename'])
|
|
|
|
localStorage,
|
|
|
|
)
|
|
|
|
omit(state, ['code', 'backgroundImage', 'backgroundImageSelection', 'filename'])
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
750,
|
|
|
|
|
|
|
|
{ trailing: true, leading: true }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|