diff --git a/app/components/EntryLoader.jsx b/app/components/EntryLoader.jsx new file mode 100644 index 0000000..318ee6d --- /dev/null +++ b/app/components/EntryLoader.jsx @@ -0,0 +1,111 @@ +import React from 'react' +import ReactDOM from 'react-dom' + +import mui from 'material-ui' +import getMuiTheme from 'material-ui/lib/styles/getMuiTheme' + +import RefreshIndicator from 'material-ui/lib/refresh-indicator' +import ReactCSSTransitionGroup from 'react-addons-css-transition-group' + +const style = { + container: { + position: 'relative', + }, + refresh: { + display: 'inline-block', + position: 'relative', + }, +} + +const { + Styles +} = mui + +const Colors = Styles.Colors + +const DefaultRawTheme = Styles.LightRawTheme + +export default class EntryLoader extends React.Component { + constructor(props, context){ + super(props, context) + this.state = {loaded: false} + } + + static get childContextTypes(){ + return {muiTheme: React.PropTypes.object} + } + + getChildContext() { + return { + muiTheme: this.context.muiTheme || getMuiTheme(DefaultRawTheme) + } + } + + componentDidMount() { + this.updateState(this.props) + } + + componentWillReceiveProps(nextProps) { + this.updateState(nextProps) + } + + updateState = (props) => { + props || (props = {}) + + var loaded = this.state.loaded + + // update loaded state, if supplied + if ('loaded' in props) { + loaded = !!props.loaded + } + this.setState({loaded: loaded}) + }; + + getContent = () => { + return this.props.children + } + + getLoader = () => { + if(!this.state.loaded){ + return ( +
+ {note.summary} +
+ } + secondaryTextLines={2} + > +- {note.summary} -
- } - secondaryTextLines={2} - > -