                                  (when-not (empty? newval) 
                                    (go
                                      (reset! search-results (<! (<search-user newval)))))))}]]]
-       ;;Results
        [SearchResults @search-results ]])))
 
 
-(defn json->userdetails [json]
-  {:id (:UserID json)
-   :photo (str "https://genome.klick.com" (:PhotoPath json))
-   :name (:Name json)
-   :title (:Title json)
-   :dept (:BusinessUnitName json)})
-
-(defn save-to-atom [atm id]
-  (go
-    (as-> (<! (<get-user id)) $
-      (first $) 
-      (json->userdetails $)
-      (reset! user $))))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Routes
 
 (save-to-atom user 5702)
 
-(defn card [] (Card))
+(defn card [] (Card user))
+
 (defn search [] (Search))
-
 
 (defn current-page []
   [:div [(session/get :current-page)]])
-
-;; -------------------------
-;; Routes
 (secretary/set-config! :prefix "#")
 
 (secretary/defroute "/" []


(enable-console-print!)

(defonce user (atom {}))
;; (defonce search-term (atom ""))
;; (defonce search-results (atom []))

;; -------------------------
;; Views



(defn home-page []
  [:div [:h2 "Yo, Welcome to jiyi"]])

(defn Card []
  (let [{:keys [id photo name title dept]} @user]
    [:div.card {:style {:width "400px" :height "600px"}}
     [:div.card-image.waves-effect.waves-block.waves-light

(secretary/defroute "/search" []
  (session/put! :current-page #'search))


;; -------------------------
;; History
