From 2c53b516d60de1a6eea3d7378165cf68a6a86273 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Mon, 12 Nov 2018 15:39:39 -0500 Subject: [PATCH] made otc wui. no back end --- .../skirmish/wui/components/otc_page.cljs | 30 +++++++++---------- .../skirmish/wui/components/todo_page.cljs | 4 +-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/cljs/skirmish/wui/components/otc_page.cljs b/src/cljs/skirmish/wui/components/otc_page.cljs index 302cf0c..3baf553 100644 --- a/src/cljs/skirmish/wui/components/otc_page.cljs +++ b/src/cljs/skirmish/wui/components/otc_page.cljs @@ -1,5 +1,6 @@ (ns skirmish.wui.components.otc-page (:require [reagent.core :refer [atom]] + [skirmish.wui.components.securities-page :refer [get-securities]] [skirmish.wui.util :refer [email?]])) @@ -22,31 +23,29 @@ (and (-> state :value js/parseInt pos?) (-> state :email email?))) -(defn direct-send-confirmation [] - [:div.model - [:div.modal-background] - [:div.modal-content - [:div.modal-card - [:header.modal-card-head - [:p.modal-card-title "Modal title"] - [:button.delete]]]] - [:a.button.modal-close.is-large {:aria-label "close"} "dslkds"]]) + +(defn select-securities-for [securities on-change] + [:select {:on-change on-change} + (for [security securities] + [:option {:value (:sec-id security) :key (:sec-id security)} (:sec-id security)])]) + + +(defn select-security [on-change] + (let [securities (atom [])] + (get-securities securities) + #(select-securities-for @securities on-change))) (defn direct-send [] (let [state (atom {})] (fn [] [:div [:div.content - [:p "Send securities to another person."] - [:pre (str @state)]] + [:p "Send securities to another person."]] [:form.form [:div.field.has-addons.has-addons-centered [:div.control [:span.select - [:select {:value (:sec-id @state) - :on-change (partial set-sec-id state)} - [:option {:value :foo :selected true} "damp"] - [:option {:value :bar } "blah blah blah"]]]] + [select-security (partial set-sec-id state)]]] [:div.control [:input.input {:type "text" :value (:value @state) @@ -62,7 +61,6 @@ (defn page [state] [:div - ;[direct-send-confirmation] [:div.content [:h5 "Do transaction without passing by the exchange."]] diff --git a/src/cljs/skirmish/wui/components/todo_page.cljs b/src/cljs/skirmish/wui/components/todo_page.cljs index 74d870a..c8f01fa 100644 --- a/src/cljs/skirmish/wui/components/todo_page.cljs +++ b/src/cljs/skirmish/wui/components/todo_page.cljs @@ -41,13 +41,13 @@ [:li done "create two stocks"] [:li done "add stocks to didier@gmail.com"] [:li done "make something for urls on the backend"] - [:li on-it "add a wui for OTC"] + [:li done "add a wui for OTC"] [:li "fix the stupid chat. This is an important feature for OTC users."] [:li "make something that allows to send securities from one user to another"] [:li "move 'routes' in 'rest'"] [:li "add a little bit of professionalism on top of the broker api"] [:li "make the api support transit and edn"] - [:li "implements interest rate in ledger."] + [:li on-it "implements interest rate in ledger."] [:li "Make sure the ledger can have accounts"] [:li done "when a new user signs in, he should receive some sort of money"] [:li "implement send securities to friends"]