Skip to content

Instantly share code, notes, and snippets.

@selfsame
Created September 12, 2019 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selfsame/b6ed45ff091f3880558d624274dbf088 to your computer and use it in GitHub Desktop.
Save selfsame/b6ed45ff091f3880558d624274dbf088 to your computer and use it in GitHub Desktop.
(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