|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import React, { PureComponent } from 'react'
|
|
|
|
|
import * as hljs from 'highlight.js'
|
|
|
|
|
import Spinner from 'react-spinner'
|
|
|
|
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
|
|
|
import debounce from 'lodash.debounce'
|
|
|
|
|
import ms from 'ms'
|
|
|
|
@ -29,7 +28,6 @@ class Carbon extends PureComponent {
|
|
|
|
|
super(props)
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
|
loading: true,
|
|
|
|
|
language: props.config.language
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -40,10 +38,6 @@ class Carbon extends PureComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.setState({
|
|
|
|
|
loading: false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState(handleLanguageChange(this.props.children, this.props))
|
|
|
|
|
|
|
|
|
|
const ro = new ResizeObserver(entries => {
|
|
|
|
@ -93,21 +87,7 @@ class Carbon extends PureComponent {
|
|
|
|
|
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
|
|
|
|
|
this.props.config.backgroundImage
|
|
|
|
|
|
|
|
|
|
// set content to spinner if loading, else editor
|
|
|
|
|
let content = (
|
|
|
|
|
<div>
|
|
|
|
|
<Spinner />
|
|
|
|
|
<style jsx>
|
|
|
|
|
{`
|
|
|
|
|
div {
|
|
|
|
|
height: 352px;
|
|
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
</style>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
if (this.state.loading === false) {
|
|
|
|
|
content = (
|
|
|
|
|
const content = (
|
|
|
|
|
<div id="container">
|
|
|
|
|
{config.windowControls ? (
|
|
|
|
|
<WindowControls
|
|
|
|
@ -246,7 +226,6 @@ class Carbon extends PureComponent {
|
|
|
|
|
</style>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div id="section">
|
|
|
|
|