Created
September 12, 2019 19:45
-
-
Save selfsame/b6ed45ff091f3880558d624274dbf088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn self-serve-info [state] | |
(let [items (retail-cart-items) | |
kitchen-stuff? (< (count items) (count (keys @CART)))] | |
[:div#checkout.retail | |
[:div#content | |
[:h1 "Self Serve Items"] | |
[:h2 "please pick up the following items from the Fridge or the Retail Shelf:"] | |
[:div.group | |
(doall | |
(for [[k items] (group-by :category items)] | |
^{:key (hash k)} | |
[:<> | |
[:h1.category (id->category k)] | |
(doall | |
(for [item items] | |
^{:key (hash item)} | |
[retail-item (get @CART (:id item)) item])) ])) ] | |
(when kitchen-stuff? | |
[:h2 "The rest of your order is being prepared and will be ready shortly!"])] | |
[:div#options | |
[:button {:onClick (fn [e] (swap! state assoc :view :checkout-complete))} | |
"OK!"]]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment