import { h, Component } from 'preact' import { Link } from 'react-router-dom' import { randrange } from '../util' export default class Paintings extends Component { constructor() { super() } render() { const paintings = this.props.data.painting.map( (painting, i) => { painting.style = painting.style || 'background-color:hsl(' + randrange(300,460) + ',50%,98%)' return (
{painting.title}
{painting.medium}
{painting.date}
{painting.image.caption}

More info >
) }) const about = this.props.data.page[0] const body = (about.body || '').replace(/\n/g,'
') const page = (
) return (
{paintings} {page}
) } }