(ns auto-ap.views.pages.needs-activation
  (:require-macros [cljs.core.async.macros :refer [go]])
  (:require [re-frame.core :as re-frame]
            [reagent.core :as reagent]
            [auto-ap.subs :as subs]
            [auto-ap.events :as events]
            [auto-ap.views.utils :refer [login-url dispatch-event]]
            [cljs.reader :as edn]
            [auto-ap.routes :as routes]
            [bidi.bidi :as bidi]
            [goog.string :as gstring]))

(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."]])
