   (enable-console-print!)
   (setup!)
   (site-list/setup!)
-  (re-frame/dispatch [:initialize-app-state {:page-key :site}])
-  (re-frame/dispatch [:set-site-list [{:id :a :name "Comic A"}]])
+  (comic-list/setup!)
+  (re-frame/dispatch [:initialize-app-state {:page-key :site-list}])
+  (api/get-sites {:on-success #(re-frame/dispatch [:set-site-list %])})
   (reagent/render-component [main-panel-container]
                             (.getElementById js/document "app")))
 

  (re-frame/register-handler
   :initialize-app-state
   (fn [db [_ state]]
     state)))

(defn main-panel
  [page-key]
  (case page-key
    :site [site-list/site-list-container]
    [base/four-oh-four]))

(defn main-panel-container []

(ns comic-reader.main
  (:require
    [comic-reader.api :as api]
    [comic-reader.ui.base :as base]
    [comic-reader.ui.site-list :as site-list]
    [comic-reader.ui.comic-list :as comic-list]
    [reagent.core :as reagent]
    [reagent.ratom :refer-macros [reaction]]
    [re-frame.core :as re-frame]))
