Skip to content

Instantly share code, notes, and snippets.

@claudiuapetrei
Created August 30, 2017 09:30
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 claudiuapetrei/618b433ad4b9476bf99e31bf575ad1cd to your computer and use it in GitHub Desktop.
Save claudiuapetrei/618b433ad4b9476bf99e31bf575ad1cd to your computer and use it in GitHub Desktop.
(defui ^:once GrantDisplay
static om/IQuery
(query [this] [:id :title :funder_name :ui/awarded-to :funding_amount_in_usd :start_date :end_date])
static om/Ident
(ident [this props] [:grant/by-id (:id props)])
(defui ^:once GrantOverlay
static f-core/InitialAppState
(initial-state [this params] {:grant nil})
static om/IQuery
(query [this] [{:grant (om/get-query GrantDisplay)}])
static om/Ident
(ident [this props] [:overlays/by-type :grant])
Object
(render [this]
(let [{:keys [grant]} (om/props this)]
(ui-grant-display grant {})
(defmutation open-grant-modal!
[{:keys [grant-id]}]
(action [{:keys [state]}]
(swap! state assoc-in [:overlays/by-type :grant :grant] [:grant/by-id grant-id])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment