|
|
@ -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(
|
|
|
|
|
|
|
|
state => {
|
|
|
|
updateQueryString(this.props.router, state)
|
|
|
|
updateQueryString(this.props.router, state)
|
|
|
|
saveSettings(
|
|
|
|
saveSettings(
|
|
|
|
localStorage,
|
|
|
|
localStorage,
|
|
|
|
omit(state, ['code', 'backgroundImage', 'backgroundImageSelection', 'filename'])
|
|
|
|
omit(state, ['code', 'backgroundImage', 'backgroundImageSelection', 'filename'])
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
750,
|
|
|
|
|
|
|
|
{ trailing: true, leading: true }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|