Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Created January 17, 2016 22:25
Show Gist options
  • Save jbaxleyiii/4790fe1becab637af20c to your computer and use it in GitHub Desktop.
Save jbaxleyiii/4790fe1becab637af20c to your computer and use it in GitHub Desktop.
Modal Prototyping with Apollos
/* Sample injection for modal */
import React, { Component, PropTypes } from "react"
import { connect } from "react-redux"
import modalActions from "apollos/core/store/modal"
const SampleUIContainer = React.createClass({
componentWillMount(){
this.props.render(this.SampleUI, { name: "Ed" })
},
componentDidUpdate(){
console.log("here")
this.props.render(this.SampleUI, { name: "Ed" })
},
SampleUI: ({ name }) => (
<div className="soft-double-ends soft-sides">
<h1> Hello {name}!</h1>
</div>
),
render() {
return <div></div>
}
})
export default connect(
null,
modalActions
)(SampleUIContainer)
import { Wrapper } from "apollos"
import { Routes } from "app/client"
import Give from "apollos/give"
import Profile from "apollos/profile"
import Groups from "apollos/groups"
import Recover from "./Recover.jsx"
Give.childRoutes.push({
component: Recover,
path: "recover"
})
ReactRouterSSR.Run({
component: Wrapper,
childRoutes: [
Routes,
Give,
Profile,
Groups
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment