move jobs flux, use createClass for react
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
import { Actions } from 'thundercats';
|
||||
|
||||
export default class JobsActions extends Actions {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static displayName = 'JobsActions'
|
||||
|
||||
getJob(id) {
|
||||
return { id };
|
||||
}
|
||||
getJobs(params) {
|
||||
return { params };
|
||||
}
|
||||
}
|
@ -1,28 +1,26 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { createContainer } from 'thundercats';
|
||||
import { contain } from 'thundercats';
|
||||
import { Grid, Row } from 'react-bootstrap';
|
||||
|
||||
@createContainer({
|
||||
store: 'JobsStore'
|
||||
})
|
||||
export default class extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
export default contain(
|
||||
{
|
||||
store: 'jobsStore',
|
||||
actions: 'jobActions'
|
||||
},
|
||||
React.createClass({
|
||||
displayName: 'Jobs',
|
||||
propTypes: {
|
||||
jobs: PropTypes.array
|
||||
},
|
||||
|
||||
|
||||
static displayName = 'Jobs'
|
||||
static propTypes = {
|
||||
jobs: PropTypes.array
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Grid>
|
||||
<Row>
|
||||
foo
|
||||
</Row>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<Grid>
|
||||
<Row>
|
||||
foo
|
||||
</Row>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -1,13 +1,11 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
|
||||
export default class extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
static displayName = 'JobsList'
|
||||
static propTypes = {}
|
||||
export default React.createClass({
|
||||
displayName: 'JobsList',
|
||||
propTypes: {
|
||||
foo: PropTypes.string
|
||||
},
|
||||
render() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,9 +0,0 @@
|
||||
import { Store } from 'thundercats';
|
||||
|
||||
export default class JobsStore extends Store {
|
||||
constructor(cat) {
|
||||
super();
|
||||
let JobsActions = cat.getActions('JobsActions');
|
||||
}
|
||||
static displayName = 'JobsStore'
|
||||
}
|
11
common/app/routes/Jobs/flux/Actions.js
Normal file
11
common/app/routes/Jobs/flux/Actions.js
Normal file
@ -0,0 +1,11 @@
|
||||
import { Actions } from 'thundercats';
|
||||
|
||||
export default Actions({
|
||||
getJob(id) {
|
||||
return { id };
|
||||
},
|
||||
getJobs(params) {
|
||||
return { params };
|
||||
}
|
||||
})
|
||||
.refs({ displayName: 'JobsActions' });
|
8
common/app/routes/Jobs/flux/Store.js
Normal file
8
common/app/routes/Jobs/flux/Store.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { Store } from 'thundercats';
|
||||
|
||||
export default Store()
|
||||
.refs({ displayName: 'JobsStore' })
|
||||
.init(({ instane: jobsStore, args: [cat] }) => {
|
||||
let jobsActions = cat.getActions('JobsActions');
|
||||
jobsStore.register(jobsActions);
|
||||
});
|
Reference in New Issue
Block a user