(ns auto-ap.views.pages.needs-activation
  (:require
   [auto-ap.views.utils :refer [login-url]]
   [re-frame.core :as re-frame]))

(re-frame/reg-event-fx
 ::relogin
 (fn [{:keys [db]} _]
   {
    :db (assoc db :user nil)}
   ))


(defn needs-activation-page []
  [:div
   [:h2 "Sorry, your user is not activated yet. Please have Ben Skinner enable your account. Click "
    [:a {:on-click (fn []
                     (re-frame/dispatch-sync [::relogin])
                     true)
         :href (login-url)}
     "here"]
    " to try again."]])
