mirror of
https://github.com/kingomarnajjar/gatsby-starter-netlify-cms.git
synced 2026-07-25 22:27:24 +10:00
Merge pull request #42 from AustinGreen/cms-preloaded
remove css import, now handled by plugin
This commit is contained in:
commit
5131876240
5 changed files with 1023 additions and 33 deletions
1025
package-lock.json
generated
1025
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -16,9 +16,7 @@
|
|||
"gatsby-transformer-remark": "^1.7.17",
|
||||
"gatsby-transformer-sharp": "^1.6.13",
|
||||
"prop-types": "^15.6.0",
|
||||
"react": "^16.2.0",
|
||||
"react-helmet": "^5.2.0",
|
||||
"react-load-script": "0.0.6"
|
||||
"react": "^16.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"gatsby"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import CMS from 'netlify-cms';
|
||||
import 'netlify-cms/dist/cms.css';
|
||||
import CMS from "netlify-cms"
|
||||
|
||||
import AboutPagePreview from './preview-templates/AboutPagePreview';
|
||||
import BlogPostPreview from './preview-templates/BlogPostPreview';
|
||||
|
|
|
|||
|
|
@ -1,32 +1,14 @@
|
|||
import React from "react";
|
||||
import Link from "gatsby-link";
|
||||
import Script from "react-load-script";
|
||||
import graphql from "graphql";
|
||||
|
||||
export default class IndexPage extends React.Component {
|
||||
handleScriptLoad() {
|
||||
if (typeof window !== `undefined` && window.netlifyIdentity) {
|
||||
window.netlifyIdentity.on("init", user => {
|
||||
if (!user) {
|
||||
window.netlifyIdentity.on("login", () => {
|
||||
document.location.href = "/admin/";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
window.netlifyIdentity.init();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data } = this.props;
|
||||
const { edges: posts } = data.allMarkdownRemark;
|
||||
|
||||
return (
|
||||
<section className="section">
|
||||
<Script
|
||||
url="https://identity.netlify.com/v1/netlify-identity-widget.js"
|
||||
onLoad={() => this.handleScriptLoad()}
|
||||
/>
|
||||
<div className="container">
|
||||
<div className="content">
|
||||
<h1 className="has-text-weight-bold is-size-2">Latest Stories</h1>
|
||||
|
|
|
|||
|
|
@ -8024,7 +8024,7 @@ react-frame-component@^2.0.0:
|
|||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-frame-component/-/react-frame-component-2.0.2.tgz#e602a980e1d78f91f471531225b61cfdbf68e614"
|
||||
|
||||
react-helmet@^5.1.3, react-helmet@^5.2.0:
|
||||
react-helmet@^5.1.3:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-5.2.0.tgz#a81811df21313a6d55c5f058c4aeba5d6f3d97a7"
|
||||
dependencies:
|
||||
|
|
@ -8047,10 +8047,6 @@ react-immutable-proptypes@^2.1.0:
|
|||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/react-immutable-proptypes/-/react-immutable-proptypes-2.1.0.tgz#023d6f39bb15c97c071e9e60d00d136eac5fa0b4"
|
||||
|
||||
react-load-script@0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/react-load-script/-/react-load-script-0.0.6.tgz#db6851236aaa25bb622677a2eb51dad4f8d2c258"
|
||||
|
||||
react-modal@^3.1.5:
|
||||
version "3.1.11"
|
||||
resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.1.11.tgz#95c8223fcee7013258ad2d149c38c9f870c89958"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue