reagent/demo/reagentdemo/core.cljs

41 lines
1.4 KiB
Plaintext
Raw Normal View History

(ns reagentdemo.core
(:require [reagent.core :as r]
2014-01-06 11:46:58 +00:00
[clojure.string :as string]
[sitetools.core :as tools :refer [emit link]]
2014-01-21 10:50:08 +00:00
[reagentdemo.common :as common :refer [demo-component]]
2014-01-18 10:31:43 +00:00
[reagentdemo.intro :as intro]
[reagentdemo.news :as news]
[reagent.debug :refer-macros [dbg println]]))
2014-01-02 13:04:30 +00:00
(def github {:href "https://github.com/reagent-project/reagent"})
2014-01-22 07:40:04 +00:00
2014-01-07 16:01:28 +00:00
(defn github-badge []
[:a.github-badge
2014-01-22 07:40:04 +00:00
github
2014-01-07 16:01:28 +00:00
[:img {:style {:position "absolute" :top 0 :left 0 :border 0}
2014-01-22 07:40:04 +00:00
:alt "Fork me on GitHub"
:src "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"}]])
2014-01-07 16:01:28 +00:00
2015-09-08 18:26:07 +00:00
(def index-page "/index.html")
2015-09-08 06:38:45 +00:00
(def title "Minimalistic React for ClojureScript")
2015-09-08 18:26:07 +00:00
(tools/register-page index-page [#'intro/main] title)
(defn demo [& [test-component]]
[:div
2015-09-09 10:11:30 +00:00
[:div.nav>ul.nav
[:li.brand [link {:href index-page} "Reagent:"]]
[:li [link {:href index-page} "Intro"]]
[:li [link {:href news/url} "News"]]
[:li>a github "GitHub"]
[:li [:a {:href "http://reagent-project.github.io/docs/master/"} "API"]]]
[:div test-component]
2015-09-09 10:11:30 +00:00
[tools/main-content]
2014-01-09 13:37:11 +00:00
[github-badge]])
2014-01-05 10:16:01 +00:00
(defn init! [& [test-component]]
(tools/start! {:body [#'demo test-component]
2015-09-07 22:29:06 +00:00
:title-prefix "Reagent: "
:css-infiles ["site/public/css/examples.css"
"site/public/css/main.css"]}))