          [:div {}
           [TopNavBar {:selected-item page
                       :on-nav (fn [item] (nav/navigate (:nav-context props) (name item)))}]]]
-        (case page
-          :import-data [import-data/Page {:nav-context nav-context}]
-          :workspaces [workspaces/Page {:nav-context nav-context}]
-          :methods [method-repo/Page {:nav-context nav-context}]
-          [:div {} "Page not found."])]))})
+
+        (let [item (first (filter #(= (% :key) page) top-nav-bar-items))]
+          (if item
+            [(item :component) {:nav-context nav-context}]
+            [:div {} "Page not found."]))]))})
 
 ;; Content to display when logged out
 (react/defc LoggedOut

  {:render
   (fn [{:keys [props]}]
     [:div {:style {:textAlign "right"}}
      [TopNavBarLink {:name "Import Data"
                      :selected (= (:selected-item props) :import-data)
                      :onClick (fn [e] ((:on-nav props) :import-data))}]
      [TopNavBarLink {:name "Workspaces"
                      :selected (= (:selected-item props) :workspaces)
                      :onClick (fn [e] ((:on-nav props) :workspaces))}]
      [TopNavBarLink {:name "Method Repository"
                      :selected (= (:selected-item props) :methods)
                      :onClick (fn [e] ((:on-nav props) :methods))}]])})

;; Content to display when logged in via Google
(react/defc LoggedIn

   (fn [{:keys [props state]}]
     (let [nav-context (nav/parse-segment (:nav-context props))
           page (keyword (:segment nav-context))]
       (when-not (contains? (set (map :key top-nav-bar-items)) page)
         (nav/navigate (:nav-context props) "workspaces"))
       [:div {}

