Fixed couple of things.
This commit is contained in:
1 parent
75a91f7f7b
commit
ff1ba2dfde
5 files changed
+51
-2
No files matched your search
@@ -11,7 +11,8 @@
|
||||
{:name :accounts :path "/accounts"}
|
||||
{:name :account :path "/accounts/:account-id"}
|
||||
{:name :securities :path "/securities"}
|
||||
{:name :security :path "/securities/:sec-id"}]})
|
||||
{:name :security :path "/securities/:sec-id"}
|
||||
{:name :transactions :path "/transactions"}]})
|
||||
|
||||
(def all-routes [ledger-routes])
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
[:a.navbar-item.is-tab {:href "/create-order" :class (top-bar-class state :create-order)} "Create Order"]
|
||||
[:a.navbar-item.is-tab {:href "/otc" :class (top-bar-class state :otc)} "Over The Counter"]
|
||||
[:a.navbar-item.is-tab {:href "/portfolio" :class (top-bar-class state :view-portfolio)} "Portfolio"]
|
||||
[:a.navbar-item.is-tab {:href "/users" :class (top-bar-class state :users)} "Users"]
|
||||
[:a.navbar-item.is-tab {:href "/todo" :class (top-bar-class state :todo)} "Todo"]]
|
||||
[:div.navbar-end
|
||||
[:a.navbar-item {} "Skirmish Shitty Exchange"]
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
(ns skirmish.wui.components.users-page
|
||||
(:require [cljs-http.client :as http]
|
||||
[cljs.core.async :refer [<!] :as async]
|
||||
[reagent.core :refer [atom]])
|
||||
(:require-macros [cljs.core.async.macros :refer [go]]))
|
||||
|
||||
|
||||
(def users-table-headers
|
||||
[:thead.has-background-grey-dark
|
||||
[:tr
|
||||
[:th.has-text-white-bis "User email"]
|
||||
[:th.has-text-white-bis "Public wallet id"]]])
|
||||
|
||||
|
||||
(defn create-row [user]
|
||||
[:tr.has-text-white-bis {:key (:email user)}
|
||||
[:td (:email user)]
|
||||
[:td "key"]])
|
||||
|
||||
(defn create-users-table [users]
|
||||
[:table.table.is-hoverable.is-fullwidth
|
||||
users-table-headers
|
||||
[:tbody
|
||||
(map create-row users)]])
|
||||
|
||||
(defn get-users [users-a]
|
||||
(go
|
||||
(let [url "http://localhost:1605/api/1/users"
|
||||
resp (<! (http/get url))]
|
||||
(reset! users-a (-> resp :body :users)))))
|
||||
|
||||
(defn users-table []
|
||||
(let [users (atom [])]
|
||||
(get-users users)
|
||||
#(create-users-table @users)))
|
||||
|
||||
(defn page [state]
|
||||
[:div
|
||||
[:div.content
|
||||
[:h5 "Users"]
|
||||
[users-table]]])
|
||||
@@ -44,6 +44,9 @@
|
||||
(session/put! :current-page #'pages/home-page)
|
||||
(swap! state #(into % {:page :home :user nil})))
|
||||
|
||||
(secretary/defroute "/users" []
|
||||
(session/put! :current-page #'pages/users-page)
|
||||
(swap! state #(into % {:page :users})))
|
||||
|
||||
(secretary/defroute "/securities" []
|
||||
(session/put! :current-page #'pages/securities-page)
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
[skirmish.wui.components.create-order-page]
|
||||
[skirmish.wui.components.securities-page]
|
||||
[skirmish.wui.components.security-page]
|
||||
[skirmish.wui.components.otc-page]))
|
||||
[skirmish.wui.components.otc-page]
|
||||
[skirmish.wui.components.users-page]))
|
||||
|
||||
(def home-page skirmish.wui.components.home-page/page)
|
||||
|
||||
@@ -20,3 +21,5 @@
|
||||
(def security-page skirmish.wui.components.security-page/page)
|
||||
|
||||
(def otc-page skirmish.wui.components.otc-page/page)
|
||||
|
||||
(def users-page skirmish.wui.components.users-page/page)
|
||||
Reference in new issue
Block a user