diff options
Diffstat (limited to 'client/components/App.jsx')
| -rw-r--r-- | client/components/App.jsx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/client/components/App.jsx b/client/components/App.jsx new file mode 100644 index 0000000..e478ea0 --- /dev/null +++ b/client/components/App.jsx @@ -0,0 +1,41 @@ +import { h, Component } from 'preact' +import db from '../db' + +export default class App extends Component { + constructor() { + super() + this.state = { + data: db.backupDB, + } + db.fetch( data => this.setState({ data }) ) + } + render() { + const paintings = this.state.data.painting.map( (painting, i) => { + return ( + <div class='cell' key={i}> + <div class='painting'> + <div class='image' style={'background-image: url(' + painting.image.uri + ')'} /> + </div> + <div class='about'> + <div class='medium'> + <div class='title'> + {painting.title} + </div> + {painting.medium}<br/> + {painting.date}<br/> + {painting.image.caption}<br/> + </div> + </div> + </div> + ) + }) + return ( + <div> + <div class='header'>Procedural Paintings by Pepper</div> + <div class='scroller'> + {paintings} + </div> + </div> + ) + } +} |
