summaryrefslogtreecommitdiff
path: root/app/client/common
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-29 04:05:11 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-29 04:05:11 +0200
commit953027ccdfb34c83a6d301401ccb47ec43b86825 (patch)
tree4d8adef283de22e7c41ec3abe5805d0d06130ce8 /app/client/common
parent59d22800576541b46a3004086835f8cc304927f5 (diff)
file list
Diffstat (limited to 'app/client/common')
-rw-r--r--app/client/common/fileList.component.js44
-rw-r--r--app/client/common/gallery.component.js32
-rw-r--r--app/client/common/textInput.component.js1
3 files changed, 77 insertions, 0 deletions
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 (
+ <div class='row' key={file.name}>
+ <div className="filename">{file.name || file.url}</div>
+ <div className="size">{file.size || ''}</div>
+ <div className="date">{moment(file.created_at).format("YYYY-MM-DD H:mm")}</div>
+ {file.epoch && <div className="epoch">epoch {file.epoch}</div>}
+ <div className='activity'>{file.activity || ''} {file.module || ''}</div>
+ {this.props.options && this.props.options(file)}
+ {file.epochs && <div className='epochs'>{file.epochs} ep.</div>}
+ {file.eta && <div className='eta'>{file.eta}</div>}
+ </div>
+ )
+ })
+ return (
+ <div className='filelist rows'>
+ {fileList}
+ </div>
+ )
+ }
+}
+
+
+
+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 (
+ <div>
+ <img src={image.url} />
+ </div>
+ )
+ })
+ return (
+ <div class='gallery'>
+ {imageList}
+ </div>
+ )
+ }
+}
+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}
/>
</label>
</div>