diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-07 18:43:24 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-07 18:43:24 +0200 |
| commit | b89147ecd38b0f95a2e4917aba7f44bf3bb70327 (patch) | |
| tree | 554d0d726755c89e55dbe79f0339cceb13543dd5 /client/containers/fileLink.js | |
| parent | d520c67839724e80d8b68b8fe933f1e7755a8f42 (diff) | |
refactor audioplayer
Diffstat (limited to 'client/containers/fileLink.js')
| -rw-r--r-- | client/containers/fileLink.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/client/containers/fileLink.js b/client/containers/fileLink.js new file mode 100644 index 0000000..cb55c1c --- /dev/null +++ b/client/containers/fileLink.js @@ -0,0 +1,23 @@ +import { connect } from 'react-redux' +import { audioPlayFile } from '../actions' +import Link from '../components/UI/Link.jsx' + +const mapStateToProps = (state, ownProps) => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + onClick: () => { + switch (ownProps.file.type) { + case 'audio': + dispatch(audioPlayFile(ownProps.file)) + break + } + } +}) + +const FileLink = connect( + mapStateToProps, + mapDispatchToProps +)(Link) + +export default FileLink |
