attempting to fix window not available on build

This commit is contained in:
WaylonWalker 2020-02-29 19:48:59 -06:00
parent 48680dfd5b
commit 4bbb5e5cde
2 changed files with 25 additions and 11 deletions

View file

@ -5,7 +5,7 @@
"version": "0.1.0", "version": "0.1.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>", "author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": { "dependencies": {
"@quantumblack/kedro-viz": "^3.2.0", "@quantumblack/kedro-viz": "3.0.1",
"gatsby": "^2.19.7", "gatsby": "^2.19.7",
"gatsby-image": "^2.2.39", "gatsby-image": "^2.2.39",
"gatsby-plugin-manifest": "^2.2.39", "gatsby-plugin-manifest": "^2.2.39",

View file

@ -7,14 +7,28 @@ import SEO from "../components/seo"
import data from './default-kedro157.json' import data from './default-kedro157.json'
import KedroViz from '@quantumblack/kedro-viz'; import KedroViz from '@quantumblack/kedro-viz';
const IndexPage = () => ( class IndexPage extends React.Component {
constructor(props) {
super(props)
this.state = {
loaded: false
}
this.componentDidMount = () => {
this.setState({ loaded: false })
}
}
render() {
return (
<Layout> <Layout>
<SEO title="Home" /> <SEO title="Home" />
<h1>default kedro pipeline</h1> <h1>default kedro pipeline</h1>
<div className="pipeline" style={{ minHeight: '80vh' }}> <div className="pipeline" style={{ minHeight: '80vh' }}>
<KedroViz style={{ minHeight: '80vh' }} data={data} /> {this.state.loaded === false ? 'loading' : <KedroViz style={{ minHeight: '80vh' }} data={data} />}
</div> </div>
</Layout> </Layout>
) )
}
}
export default IndexPage export default IndexPage