Adding findbar to main app component
This commit is contained in:
parent
b0f26e7cd7
commit
5be770ac00
@ -3,6 +3,7 @@ import { connect } from 'react-redux';
|
|||||||
import { loadConfig } from '../actions/config';
|
import { loadConfig } from '../actions/config';
|
||||||
import { loginUser } from '../actions/auth';
|
import { loginUser } from '../actions/auth';
|
||||||
import { currentBackend } from '../backends/backend';
|
import { currentBackend } from '../backends/backend';
|
||||||
|
import FindBar from './FindBar';
|
||||||
|
|
||||||
class App extends React.Component {
|
class App extends React.Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -50,6 +51,14 @@ class App extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const { user, config, children } = this.props;
|
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) {
|
if (config === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -67,7 +76,10 @@ class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>{children}</div>
|
<div>
|
||||||
|
<FindBar commands={commands} />
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import { connect } from 'react-redux';
|
|||||||
import { loadEntries } from '../actions/entries';
|
import { loadEntries } from '../actions/entries';
|
||||||
import { selectEntries } from '../reducers';
|
import { selectEntries } from '../reducers';
|
||||||
import EntryListing from '../components/EntryListing';
|
import EntryListing from '../components/EntryListing';
|
||||||
import FindBar from './FindBar';
|
|
||||||
|
|
||||||
class DashboardPage extends React.Component {
|
class DashboardPage extends React.Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -29,16 +28,8 @@ class DashboardPage extends React.Component {
|
|||||||
return <h1>No collections defined in your config.yml</h1>;
|
return <h1>No collections defined in your config.yml</h1>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const commands = [
|
|
||||||
{ pattern: 'Create Collections(:collectionName)' },
|
|
||||||
{ pattern: 'Create Posts(:postName)' },
|
|
||||||
{ pattern: 'Find(:seachTerm as what?)' },
|
|
||||||
{ pattern: '(:searchTerm as Find...)' }
|
|
||||||
];
|
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<h1>Dashboard</h1>
|
<h1>Dashboard</h1>
|
||||||
<FindBar commands={commands} />
|
|
||||||
<div>
|
<div>
|
||||||
{collections.map((collection) => (
|
{collections.map((collection) => (
|
||||||
<div key={collection.get('name')}>
|
<div key={collection.get('name')}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user