diff --git a/www-src/js/actions/index.jsx b/www-src/js/actions/index.jsx index 3eb0ecd..3823ce5 100644 --- a/www-src/js/actions/index.jsx +++ b/www-src/js/actions/index.jsx @@ -3,6 +3,7 @@ import * as Web3Actions from './web3' import * as ChainActions from './chain' import * as ConfigActions from './config' import * as PackageIndexActions from './package_index' +import * as ThingActions from './thing' export default { ...PaginationActions, @@ -10,4 +11,5 @@ export default { ...ChainActions, ...ConfigActions, ...PackageIndexActions, + ...ThingActions, } diff --git a/www-src/js/actions/thing.jsx b/www-src/js/actions/thing.jsx new file mode 100644 index 0000000..f08e7e4 --- /dev/null +++ b/www-src/js/actions/thing.jsx @@ -0,0 +1,10 @@ +import TYPES from './types' + + + +export function setThing(value) { + return { + type: TYPES.SET_THING, + value: value, + } +} diff --git a/www-src/js/actions/types.jsx b/www-src/js/actions/types.jsx index 7631d64..48ca31c 100644 --- a/www-src/js/actions/types.jsx +++ b/www-src/js/actions/types.jsx @@ -22,4 +22,6 @@ export default { SET_RELEASE_HASH: 'SET_RELEASE_HASH', // release data SET_RELEASE_DATA: 'SET_RELEASE_DATA', + // Thing Setter + SET_THING: 'SET_THING' } diff --git a/www-src/js/components/pages/SiteIndex.jsx b/www-src/js/components/pages/SiteIndex.jsx index 939b238..0ffa6a4 100644 --- a/www-src/js/components/pages/SiteIndex.jsx +++ b/www-src/js/components/pages/SiteIndex.jsx @@ -4,12 +4,18 @@ import { Link } from 'react-router' import BSCard from '../bootstrap/BSCard' import FAIcon from '../common/FAIcon' import layoutStyles from '../../../css/layout.css' +import actions from '../../actions' function mapStateToProps(state) { - return {} + return { + thing: state.thing.get('thingValue') + } } export default connect(mapStateToProps)(React.createClass({ + setThing() { + this.props.dispatch(actions.setThing(5)) + }, render() { return (
A package index for Ethereum smart contract packages.
Thing is {this.props.thing}
+