From 02efbed9b5d01a813cd07c6631a17c4744a191d6 Mon Sep 17 00:00:00 2001 From: Gabriel Giovanini Date: Sat, 22 Jun 2019 16:26:09 +0200 Subject: Adds a simple layout --- src/genpass/core.cljs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/genpass/core.cljs b/src/genpass/core.cljs index e6b33ca..c65714f 100644 --- a/src/genpass/core.cljs +++ b/src/genpass/core.cljs @@ -1,15 +1,19 @@ (ns genpass.core - (:require - [reagent.core :as r])) + (:require + [reagent.core :as r] + [genpass.gen :refer [genpwd]])) -;; ------------------------- -;; Views +(def password (r/atom (genpwd))) (defn home-page [] - [:div [:h2 "Welcome to Reagent"]]) - -;; ------------------------- -;; Initialize app + [:div.columns>div.column + [:div.field>div.control>input.input.is-primary + {:type "text" + :value @password}] + [:div.field>div.control>input.button.is-primary + {:value "Generate" + :type "button" + :on-click #(reset! password (genpwd))}]]) (defn mount-root [] (r/render [home-page] (.getElementById js/document "app"))) -- cgit v1.2.3