fix bugs in page

This commit is contained in:
didier amyot committed 2018-01-27 11:50:00 -05:00
1 parent 6ed638a1cc
commit e654fdfea6
387 files changed
+13618 -88879

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
(ns website.core
(:require [reagent.core :as reagent :refer [atom]]
[secretary.core :as secretary :include-macros true]
[accountant.core :as accountant]
[website.tobbar :refer [topbar]]
[website.home :refer [home-page]]))
;; -------------------------
;; Routes
(defonce page (atom #'home-page))
(defn current-page []
[:div
[topbar]
[:div.columns
[:div.column.is-offset-1.is-10
[:br]
[@page]]]])
(secretary/defroute "/" []
(reset! page #'home-page))
;; -------------------------
;; Initialize app
(defn mount-root []
(reagent/render [current-page] (.getElementById js/document "app")))
(defn init! []
(accountant/configure-navigation!
{:nav-handler
(fn [path]
(secretary/dispatch! path))
:path-exists?
(fn [path]
(secretary/locate-route path))})
(accountant/dispatch-current!)
(mount-root))