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,20 +1,17 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { createContainer } from 'thundercats';
|
import { contain } from 'thundercats';
|
||||||
import { Grid, Row } from 'react-bootstrap';
|
import { Grid, Row } from 'react-bootstrap';
|
||||||
|
|
||||||
@createContainer({
|
export default contain(
|
||||||
store: 'JobsStore'
|
{
|
||||||
})
|
store: 'jobsStore',
|
||||||
export default class extends React.Component {
|
actions: 'jobActions'
|
||||||
constructor(props) {
|
},
|
||||||
super(props);
|
React.createClass({
|
||||||
}
|
displayName: 'Jobs',
|
||||||
|
propTypes: {
|
||||||
|
|
||||||
static displayName = 'Jobs'
|
|
||||||
static propTypes = {
|
|
||||||
jobs: PropTypes.array
|
jobs: PropTypes.array
|
||||||
}
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
@ -25,4 +22,5 @@ export default class extends React.Component {
|
|||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
);
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
|
||||||
export default class extends React.Component {
|
export default React.createClass({
|
||||||
constructor(props) {
|
displayName: 'JobsList',
|
||||||
super(props);
|
propTypes: {
|
||||||
}
|
foo: PropTypes.string
|
||||||
|
},
|
||||||
static displayName = 'JobsList'
|
|
||||||
static propTypes = {}
|
|
||||||
render() {
|
render() {
|
||||||
return null;
|
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