  (fn [db [_ phone-id]]
    (let [phone-details-reaction (reaction (:phone-details @db))]
      (reaction ((keyword phone-id) @phone-details-reaction)))))
+
+(re-frame/register-handler
+ :set-image
+ (fn
+   [app-state [_ selected-image-url]]
+   (assoc-in app-state [:phone-details :selected-image-url] selected-image-url)))
 
 (re-frame/register-handler
  :process-phones-response

   [additional-features (reaction (:additionalFeatures @phone))]])

(defn phone-page [{phone-id :phone-id}]
  (let [phone (re-frame/subscribe [:phone-query phone-id])]
    (fn []
      [:div
       [:img {:src (first (:images @phone))
              :class "phone"}]
       [:h1 (:name @phone)]
       [:p (:description @phone)]

  [:ul {:class "phone-thumbs"}
   (for [image (:images @phone)]
     ^{:key image} [:li [:img {:src image
                               :class "phone"
                               :on-click #(re-frame/dispatch [:set-image image])}]])])

(defn availability
  [availability]
