diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-21 04:48:52 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-21 04:48:52 +0200 |
| commit | d41070c7b00fafc974a1a6e7b6d1b42391fa57ed (patch) | |
| tree | 4178eba89627e8581cdc5eea65bf7f11591f6b45 /client/containers | |
| parent | d02cbad01f3abfa8a1aad0b55b8bd9cf544090cf (diff) | |
all async paths working
Diffstat (limited to 'client/containers')
| -rw-r--r-- | client/containers/fileLink.js | 16 | ||||
| -rw-r--r-- | client/containers/taskContentLink.js | 1 | ||||
| -rw-r--r-- | client/containers/taskList.js | 9 | ||||
| -rw-r--r-- | client/containers/taskStyleLink.js | 1 |
4 files changed, 21 insertions, 6 deletions
diff --git a/client/containers/fileLink.js b/client/containers/fileLink.js index 92933cf..22834d8 100644 --- a/client/containers/fileLink.js +++ b/client/containers/fileLink.js @@ -1,17 +1,27 @@ import { connect } from 'react-redux' import { audioPlayFile } from '../actions' +import { filepath } from '../vendor/paths' import Link from '../components/UI/Link.jsx' const mapStateToProps = (state, ownProps) => ({ - children: ownProps.children || ownProps.file ? ownProps.file.name : "(~)", - disabled: ownProps.disabled || ! ownProps.file + href: ownProps.file ? filepath(ownProps.file) : '#', + children: ownProps.children || (ownProps.file ? ownProps.file.name : "(~)"), + disabled: ownProps.disabled || ! ownProps.file, + selected: ownProps.file && state.audioPlayer.file && state.audioPlayer.file.id == ownProps.file.id }) const mapDispatchToProps = (dispatch, ownProps) => ({ onClick: () => { switch (ownProps.file.type) { case 'audio': - dispatch(audioPlayFile(ownProps.file)) + let file = ownProps.file + dispatch(audioPlayFile(null)) + setTimeout(() => { + dispatch(audioPlayFile(ownProps.file)) + }, 10) + break + case 'image': + // document.body.style.backgroundImage = break } } diff --git a/client/containers/taskContentLink.js b/client/containers/taskContentLink.js index bb8ae37..524e6aa 100644 --- a/client/containers/taskContentLink.js +++ b/client/containers/taskContentLink.js @@ -3,6 +3,7 @@ import { setContent } from '../actions' import Link from '../components/UI/Link.jsx' const mapStateToProps = (state, ownProps) => ({ + selected: state.currentTask.content == ownProps.file }) const mapDispatchToProps = (dispatch, ownProps) => ({ diff --git a/client/containers/taskList.js b/client/containers/taskList.js index f4a5a1d..b341e91 100644 --- a/client/containers/taskList.js +++ b/client/containers/taskList.js @@ -1,11 +1,14 @@ import { connect } from 'react-redux' -// import {} from '../actions' +import { cancelTask } from '../actions' import TaskListView from '../components/Tasks/TaskListView.jsx' const mapStateToProps = (state) => ({ tasks: state.tasks }) -const mapDispatchToProps = { -} +const mapDispatchToProps = (dispatch) => ({ + cancelTask: (task) => { + dispatch(cancelTask(task)) + } +}) const TaskList = connect( mapStateToProps, diff --git a/client/containers/taskStyleLink.js b/client/containers/taskStyleLink.js index 7ec5ce5..6157e00 100644 --- a/client/containers/taskStyleLink.js +++ b/client/containers/taskStyleLink.js @@ -3,6 +3,7 @@ import { setStyle } from '../actions' import Link from '../components/UI/Link.jsx' const mapStateToProps = (state, ownProps) => ({ + selected: state.currentTask.style == ownProps.file }) const mapDispatchToProps = (dispatch, ownProps) => ({ |
