From a450fa75edb927b7568b8a3198f9209c6a4c7f79 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 3 Jun 2018 14:46:18 +0200 Subject: adjusting the form, calling samplernn tasks --- app/client/common/audioPlayer.component.js | 38 ++++++++++++++++++++++++++++++ app/client/common/fileList.component.js | 19 +++++++++++---- 2 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 app/client/common/audioPlayer.component.js (limited to 'app/client/common') diff --git a/app/client/common/audioPlayer.component.js b/app/client/common/audioPlayer.component.js new file mode 100644 index 0000000..f10a505 --- /dev/null +++ b/app/client/common/audioPlayer.component.js @@ -0,0 +1,38 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' +import { bindActionCreators } from 'redux' +import * as liveActions from '../live/live.actions' + +const audio = document.createElement('audio') + +class AudioPlayer extends Component { + constructor(props){ + super(props) + this.handleClick = this.handleClick.bind(this) + } + handleClick(e){ + this.props.onClick && this.props.onClick() + } + render() { + const { player={} } = this.props + return ( +
+ {this.props.title} + +
+ ) + } +} + +const mapStateToProps = state => ({ + player: state.audioPlayer, +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(AudioPlayer) diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index c16928f..f596c8d 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -30,13 +30,22 @@ export const FileList = props => { onClick /> }) + if (! (files && files.length)) { + return ( +
+
+

No files

+
+
+ ) + } return (
-
- {(files && files.length) - ? (title &&

{title}

) - :

No files

} -
+ {title && +
+

{title}

} +
+ }
{fileList} -- cgit v1.2.3-70-g09d2