 (sablono/defhtml modal-overlay [click-fn]
   [:div.modal-overlay-120d3 {:on-click click-fn}])
 
-(sablono/defhtml new-project-step-1 []
+(sablono/defhtml new-or-existing-project []
   [:div.modal-body-fe4db
     [:div.modal-chunk-2041a
       [:button.big-btn-a5d18 {:on-click click-new-project-btn}

(defn- letter? [s]
  (and (string? s)
       (.test #"[a-zA-Z]" s)))

;;------------------------------------------------------------------------------
;; State-effecting

                                     :prj-key prj-key))))
            (:builds-order prj))]])))

(quiescent/defcomponent NewProjectForm [modal-state]
  (quiescent/on-mount
    (new-project-form modal-state)
    on-mount-new-project-form))

(quiescent/defcomponent AddProjectModal [modal-state]
  (let [current-step (:new-project-step modal-state)]
    (case current-step
      1 (new-or-existing-project)
      2 (NewProjectForm modal-state)
      3 (creating-new-project modal-state)
      nil)))

(quiescent/defcomponent SettingsModal [app-state]
  (sablono/html
    [:div.modal-body-fe4db "Settings menu!"]))

(def new-project-modal-keys
  "These are all the keys we need in order to build the Add Project modal."
  #{:new-project-dir
    :new-project-error
    :new-project-name
    :new-project-step })

(quiescent/defcomponent AppRoot [app-state]
  (sablono/html
    [:div
      (when (:add-project-modal-showing? app-state)
        (list (modal-overlay click-add-project-modal-overlay)
              (AddProjectModal (select-keys app-state new-project-modal-keys))))
      (when (:settings-modal-showing? app-state)
        (list (modal-overlay click-settings-modal-overlay)
              (SettingsModal app-state)))
