From 5be770ac00f04f9e0982397c62b53128c0e6265b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20Zen?= Date: Fri, 8 Jul 2016 05:58:23 -0300 Subject: [PATCH] Adding findbar to main app component --- src/containers/App.js | 14 +++++++++++++- src/containers/CollectionPage.js | 9 --------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/containers/App.js b/src/containers/App.js index 23277f24..235dd7a8 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { loadConfig } from '../actions/config'; import { loginUser } from '../actions/auth'; import { currentBackend } from '../backends/backend'; +import FindBar from './FindBar'; class App extends React.Component { componentDidMount() { @@ -50,6 +51,14 @@ class App extends React.Component { render() { const { user, config, children } = this.props; + const commands = [ + { pattern: 'Create new Post(:postName)' }, + { pattern: 'Create new FAQ item(:faqName as FAQ item name)' }, + { pattern: 'Add new User(:userName as User name)' }, + { pattern: 'Go to Settings' }, + ]; + + if (config === null) { return null; } @@ -67,7 +76,10 @@ class App extends React.Component { } return ( -
{children}
+
+ + {children} +
); } } diff --git a/src/containers/CollectionPage.js b/src/containers/CollectionPage.js index 93552691..8d8b12b4 100644 --- a/src/containers/CollectionPage.js +++ b/src/containers/CollectionPage.js @@ -5,7 +5,6 @@ import { connect } from 'react-redux'; import { loadEntries } from '../actions/entries'; import { selectEntries } from '../reducers'; import EntryListing from '../components/EntryListing'; -import FindBar from './FindBar'; class DashboardPage extends React.Component { componentDidMount() { @@ -29,16 +28,8 @@ class DashboardPage extends React.Component { return

No collections defined in your config.yml

; } - const commands = [ - { pattern: 'Create Collections(:collectionName)' }, - { pattern: 'Create Posts(:postName)' }, - { pattern: 'Find(:seachTerm as what?)' }, - { pattern: '(:searchTerm as Find...)' } - ]; - return

Dashboard

-
{collections.map((collection) => (