From 953027ccdfb34c83a6d301401ccb47ec43b86825 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 29 May 2018 04:05:11 +0200 Subject: file list --- app/client/common/fileList.component.js | 44 ++++++++++++++++++++++++++++++++ app/client/common/gallery.component.js | 32 +++++++++++++++++++++++ app/client/common/textInput.component.js | 1 + 3 files changed, 77 insertions(+) create mode 100644 app/client/common/fileList.component.js create mode 100644 app/client/common/gallery.component.js (limited to 'app/client/common') diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js new file mode 100644 index 0000000..8ee61f7 --- /dev/null +++ b/app/client/common/fileList.component.js @@ -0,0 +1,44 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import moment from 'moment' +import * as util from '../util' + +class FileList extends Component { + constructor(props){ + super() + } + render(){ + const { files } = this.props + const fileList = files.map(file => { + return ( +
+
{file.name || file.url}
+
{file.size || ''}
+
{moment(file.created_at).format("YYYY-MM-DD H:mm")}
+ {file.epoch &&
epoch {file.epoch}
} +
{file.activity || ''} {file.module || ''}
+ {this.props.options && this.props.options(file)} + {file.epochs &&
{file.epochs} ep.
} + {file.eta &&
{file.eta}
} +
+ ) + }) + return ( +
+ {fileList} +
+ ) + } +} + + + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(FileList) diff --git a/app/client/common/gallery.component.js b/app/client/common/gallery.component.js new file mode 100644 index 0000000..8db7032 --- /dev/null +++ b/app/client/common/gallery.component.js @@ -0,0 +1,32 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +class Gallery extends Component { + constructor(props){ + super() + } + render(){ + const { title, images } = this.props + const imageList = images.map(image => { + return ( +
+ +
+ ) + }) + return ( + + ) + } +} +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(Gallery) diff --git a/app/client/common/textInput.component.js b/app/client/common/textInput.component.js index b3c4866..c514b78 100644 --- a/app/client/common/textInput.component.js +++ b/app/client/common/textInput.component.js @@ -24,6 +24,7 @@ class TextInput extends Component { value={this.props.value} onInput={this.handleInput} onKeydown={this.handleKeydown} + placeholder={this.props.placeholder} /> -- cgit v1.2.3-70-g09d2