This is just delightful
(defn hiccup [html]
(with-meta
html
{:portal.viewer/default :portal.viewer/hiccup}))
(defn pixel-grid [pixels]
(hiccup
[:div {:style {:display "flex"}}
(for [col pixels]
[:div {:style {:display "flex" :flex-direction "column"}}
(for [color col]
[:div {:style {:width "5px" :height "5px" :background-color (str "rgba(" (str/join "," color) ")")}}])])]))
(tap> (pixel-grid (:pixels @state)))
Since reagent is rendering this, I wonder if you still need a :key
on list elements :thinking_face:
You never really need that, right?
You would need it if you are updating large lists, but most of the time you can get by without it 👌
And since in this case you won't get updates it won't matter in terms of performance either
Right, what you said :)