Skip to content

Instantly share code, notes, and snippets.

View iamkevingreen's full-sized avatar
💭
🍝 🍝 🍝 🍝 🍝 🍝

Kevin Green iamkevingreen

💭
🍝 🍝 🍝 🍝 🍝 🍝
View GitHub Profile
import React, { Component } from 'react'
import { render } from 'react-dom'
class App extends Component {
render() {
return (
<div>Welcome to React Electron!</div>
)
}
}
import './styles/app.scss'
import { Config } from '../config'
import React, { Component } from 'react'
import { render } from 'react-dom'
import { Router, Route, IndexRoute, hashHistory } from 'react-router'
import AuthService from './utils/AuthService'
import Layout from './Layout'
import React, { Component } from 'react'
export default class Layout extends Component {
constructor(props) {
super(props)
}
render() {
let children = null;
if (this.props.children) {
children = React.cloneElement(this.props.children, {
import React, { Component } from 'react'
import { Link } from 'react-router'
import AuthService from '../../utils/AuthService'
export default class Home extends Component {
constructor(props, context) {
super(props, context)
this.state = {
profile: props.auth.getProfile()
}
import React, { Component, PropTypes as T} from 'react'
import AuthService from '../../../utils/AuthService'
import { Link } from 'react-router'
export default class Login extends Component {
render() {
const { auth } = this.props
return (
<div className="login">
<h2>Login</h2>
let Config = {}
Config = {
"auth" : [
{
key: '',
domain: ''
}
]
}
this.lock = new Auth0Lock(clientId, domain, {
auth: {
redirect: false,
sso: false
}
})
const Prismic = require('prismic.io');
const endpoint = 'https://yourrepo.prismic.io/api';
const CMS = Prismic.api(endpoint);
const cursor = Prismic.Predicates;
class API {
query(key, value) {
return CMS.then((api) => {
return api.query(cursor.at(key, value));
import React, { Component } from 'react';
import { render } from 'react-dom';
// Pages
import Home from './pages/home';
if (document.getElementById('Home')) { // eslint-disable-line
render(<HomeLayout />,
document.getElementById('Home') // eslint-disable-line
);
import React, { Component } from 'react';
import API from '../api/prismic';
import Carousel from '../globals/carousel'
import Helper from '../helper';
class Home extends Component {
constructor(props) {
super(props)