address refactoring.

This commit is contained in:
Bryce Covert
2018-05-17 20:45:56 -07:00
parent 9e63624227
commit 4312c0e2ad
3 changed files with 69 additions and 105 deletions

View File

@@ -0,0 +1,60 @@
(ns auto-ap.views.components.address
(:require [auto-ap.entities.address :as address]
[auto-ap.views.utils :refer [dispatch-value-change dispatch-event bind-field horizontal-field]]))
(defn address-field [{:keys [event field subscription]}]
[:span
[horizontal-field
nil
[:div.control
[:p.help "Address"]
[bind-field
[:input.input.is-expanded {:type "text"
:placeholder "1700 Pennsylvania Ave"
:field (conj field :street1)
:spec ::address/street1
:event event
:subscription subscription}]]]]
[horizontal-field
nil
[:div.control
[bind-field
[:input.input.is-expanded {:type "text"
:placeholder "Suite 400"
:field (conj field :street2)
:spec ::address/street2
:event event
:subscription subscription}]]]]
[horizontal-field
nil
[:div.control
[:p.help "City"]
[bind-field
[:input.input.is-expanded {:type "text"
:placeholder "Cupertino"
:field (conj field :city)
:spec ::address/city
:event event
:subscription subscription}]]]
[:div.control
[:p.help "State"]
[bind-field
[:input.input {:type "text"
:placeholder "CA"
:field (conj field :state)
:spec ::address/state
:size 2
:max-length "2"
:event event
:subscription subscription}]]]
[:div.control
[:p.help "Zip"]
[bind-field
[:input.input {:type "text"
:field (conj field :zip)
:spec ::address/zip
:event event
:subscription subscription
:placeholder "95014"}]]]]])