2014-01-02 14:04:30 +01:00
|
|
|
(ns demo
|
2014-01-17 11:12:11 +01:00
|
|
|
(:require [reagent.core :as reagent :refer [atom]]
|
2014-11-29 18:30:24 +01:00
|
|
|
[reagent.interop :as i :refer-macros [.' .!]]
|
2014-01-06 12:46:58 +01:00
|
|
|
[clojure.string :as string]
|
2014-11-29 18:30:24 +01:00
|
|
|
[sitetools :as tools :refer [link]]
|
2014-01-21 11:50:08 +01:00
|
|
|
[reagentdemo.common :as common :refer [demo-component]]
|
2014-01-18 11:31:43 +01:00
|
|
|
[reagentdemo.intro :as intro]
|
2014-01-20 09:42:16 +01:00
|
|
|
[reagentdemo.news :as news]
|
2014-01-17 11:12:11 +01:00
|
|
|
[reagent.debug :refer-macros [dbg println]]))
|
2014-01-02 14:04:30 +01:00
|
|
|
|
2014-11-29 18:30:24 +01:00
|
|
|
(def test-results-comp (atom nil))
|
2014-01-17 12:35:40 +01:00
|
|
|
|
2014-11-06 20:21:38 +01:00
|
|
|
(def github {:href "https://github.com/reagent-project/reagent"})
|
2014-01-22 08:40:04 +01:00
|
|
|
|
2014-01-07 17:01:28 +01:00
|
|
|
(defn github-badge []
|
|
|
|
[:a.github-badge
|
2014-01-22 08:40:04 +01:00
|
|
|
github
|
2014-01-07 17:01:28 +01:00
|
|
|
[:img {:style {:position "absolute" :top 0 :left 0 :border 0}
|
2014-01-22 08:40:04 +01:00
|
|
|
:alt "Fork me on GitHub"
|
|
|
|
:src "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"}]])
|
2014-01-07 17:01:28 +01:00
|
|
|
|
2014-11-29 18:30:24 +01:00
|
|
|
(def index-page "index.html")
|
|
|
|
(def news-page "news/index.html")
|
|
|
|
|
2014-11-29 19:51:45 +01:00
|
|
|
(tools/register-page index-page
|
|
|
|
(fn [] [intro/main])
|
|
|
|
"Reagent: Minimalistic React for ClojureScript")
|
|
|
|
(tools/register-page news-page
|
|
|
|
(fn [] [news/main])
|
|
|
|
"Reagent news")
|
2014-11-29 18:30:24 +01:00
|
|
|
|
2014-01-02 14:04:30 +01:00
|
|
|
(defn demo []
|
2014-01-06 19:16:53 +01:00
|
|
|
[:div
|
2014-01-20 09:42:16 +01:00
|
|
|
[:div.nav
|
|
|
|
[:ul.nav
|
2014-11-29 18:30:24 +01:00
|
|
|
[:li.brand [link {:href index-page} "Reagent:"]]
|
|
|
|
[:li [link {:href index-page} "Intro"]]
|
|
|
|
[:li [link {:href news-page} "News"]]
|
2014-01-22 08:40:04 +01:00
|
|
|
[:li [:a github "GitHub"]]]]
|
2014-11-29 18:30:24 +01:00
|
|
|
(when @test-results-comp [@test-results-comp])
|
|
|
|
[tools/page-content]
|
2014-01-09 14:37:11 +01:00
|
|
|
[github-badge]])
|
2014-01-05 11:16:01 +01:00
|
|
|
|
2014-11-29 18:30:24 +01:00
|
|
|
(defn start! [{:keys [test-results]}]
|
|
|
|
(reset! test-results-comp test-results)
|
2014-11-29 19:51:45 +01:00
|
|
|
(tools/start! {:body (fn [] [demo])
|
2014-12-11 09:01:25 +01:00
|
|
|
:css-infiles ["site/public/css/examples.css"
|
|
|
|
"site/public/css/main.css"]}))
|