From 0ecf7b818b0157076a22012621f58cc25ec23f08 Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Sat, 5 Mar 2016 16:48:41 -0700 Subject: [PATCH] Remove rethink references and old main js file Remove them because rethink integration will be saved for the paid model. The main.jsx file was replaced by the app/containers/App.jsx file. --- app/containers/App.jsx | 19 ------ app/main.jsx | 148 ----------------------------------------- 2 files changed, 167 deletions(-) delete mode 100644 app/main.jsx diff --git a/app/containers/App.jsx b/app/containers/App.jsx index 40dbf56..20101df 100644 --- a/app/containers/App.jsx +++ b/app/containers/App.jsx @@ -1,7 +1,6 @@ import React from 'react' import getMuiTheme from 'material-ui/lib/styles/getMuiTheme' import Styles from 'material-ui/lib/styles' -import Rethink from 'rethinkdbdash' import mui from 'material-ui' import * as ContextMenuActions from '../actions' @@ -20,27 +19,9 @@ const { const DefaultRawTheme = Styles.LightRawTheme -let r = Rethink({ - db: 'technote', - servers: [ - {host: '162.243.255.144', - port: 28015} - ]}) - -function createTables(){ - r.tableCreate('notes').run() - .then(function(){ - r.table('notes').indexCreate('account_id').run() - }) - .error(function(){}) - - r.tableCreate('accounts').run().error(function(){}) -} - class App extends React.Component { constructor(props, context){ super(props, context) - createTables() this.state = { entries: [], } diff --git a/app/main.jsx b/app/main.jsx deleted file mode 100644 index 5118131..0000000 --- a/app/main.jsx +++ /dev/null @@ -1,148 +0,0 @@ -import React from 'react' -import injectTapEventPlugin from "react-tap-event-plugin" -injectTapEventPlugin() -import getMuiTheme from 'material-ui/lib/styles/getMuiTheme' -import ReactDOM from 'react-dom' -import LibraryNav from 'LibraryNav' -import Styles from 'material-ui/lib/styles' -import Rethink from 'rethinkdbdash' -import Edit from 'material-ui/lib/svg-icons/editor/mode-edit' -import Delete from 'material-ui/lib/svg-icons/action/delete' -import Divider from 'material-ui/lib/divider' -import moment from 'moment' -import mui from 'material-ui' -import {Provider} from 'react-redux' -import { createStore } from 'redux' -import rootReducer from './reducers' -import * as ContextMenuActions from './actions' - -import { bindActionCreators } from 'redux' -import { connect } from 'react-redux' - - -function getStore(reducer, initialState){ - return createStore(reducer, initialState) -} - -const store = getStore(rootReducer) - -const { - Popover, - Menu, - MenuItem} = mui - -const DefaultRawTheme = Styles.LightRawTheme - -let r = Rethink({ - db: 'technote', - servers: [ - {host: '162.243.255.144', - port: 28015} - ]}) - -function createTables(){ - r.tableCreate('notes').run() - .then(function(){ - r.table('notes').indexCreate('account_id').run() - }) - .error(function(){}) - - r.tableCreate('accounts').run().error(function(){}) -} - - -class Main extends React.Component { - constructor(props, context){ - super(props, context) - createTables() - this.state = { - entries: [], - } - } - - static get childContextTypes(){ - return {muiTheme: React.PropTypes.object} - } - - getChildContext() { - return { - muiTheme: getMuiTheme(DefaultRawTheme) - } - } - - entriesTapped = () => { - r.table('notes').getAll('jyapayne@gmail.com', {index: 'account_id'}).run().then( - function(notes){ - console.log(notes) - } - ) - }; - - handleRequestClose = () => { - this.props.contextMenuActions.closeContextMenu() - }; - - render() { - - const { contextMenu, contextMenuActions } = this.props - return ( -
-
- - - {contextMenu.items.map(function (el, i){ - return el; - })} - - - - -
- ) - } -} - -Main.propTypes = { - contextMenu: React.PropTypes.object.isRequired, - contextMenuActions: React.PropTypes.object.isRequired -} - -function mapStateToProps(state) { - return { - contextMenu: state.contextMenu - } -} - -function mapDispatchToProps(dispatch) { - return { - contextMenuActions: bindActionCreators(ContextMenuActions, dispatch) - } -} - -let App = connect( - mapStateToProps, - mapDispatchToProps -)(Main) - -export default App - -ReactDOM.render( - , - document.getElementById('main') -); -