From ec598c5bbc692fc473fbed411d05b07d137b8e14 Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Thu, 22 Jun 2017 01:31:18 +0200
Subject: more css :)

---
 client/components/Paintings.jsx | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

(limited to 'client/components/Paintings.jsx')

diff --git a/client/components/Paintings.jsx b/client/components/Paintings.jsx
index 93b24eb..a2eb601 100644
--- a/client/components/Paintings.jsx
+++ b/client/components/Paintings.jsx
@@ -1,6 +1,6 @@
 import { h, Component } from 'preact'
 import { Link } from 'react-router-dom'
-import util from '../util'
+import { randrange } from '../util'
 
 export default class Paintings extends Component {
   constructor() {
@@ -8,10 +8,13 @@ export default class Paintings extends Component {
   }
   render() {
     const paintings = this.props.data.painting.map( (painting, i) => {
+      painting.style = painting.style || 'background-color:hsl(' + randrange(300,460) + ',50%,98%)'
       return (
-        <div class='cell' key={i}>
+        <div class='cell' key={i} style={painting.style}>
           <div class='painting'>
-            <div class='image' style={'background-image: url(' + painting.image.uri + ')'} />
+            <Link to={'/painting/' + painting.id}>
+              <div class='image' style={'background-image: url(' + painting.image.uri + ')'} />
+            </Link>
           </div>
           <div class='about'>
             <div>
@@ -33,9 +36,13 @@ export default class Paintings extends Component {
     const page = (
       <div class='cell'>
         <div class='painting'>
-          <div class='image' style={'background-image: url(' + about.image.uri + ')'} />
+          <a href='http://asdf.us/pepper' target='_blank'>
+            <div class='image' style={'background-image: url(' + about.image.uri + ')'} />
+          </a>
+        </div>
+        <div class='about'>
+          <div dangerouslySetInnerHTML={{ __html: body }} />
         </div>
-        <div class='about' dangerouslySetInnerHTML={{ __html: body }} />
       </div>
     )
     return (
-- 
cgit v1.2.3-70-g09d2

