<commit_before>(ns braid.ui.views.group-invite
  (:require [reagent.core :as r]
            [clojure.string :as string]
            [chat.client.reagent-adapter :refer [subscribe]]
            [chat.client.dispatcher :refer [dispatch!]])
  (:import [goog.events KeyCodes]))

(defn group-invite-view
  []
  (let [group-id (subscribe [:open-group-id])
        collapsed? (r/atom true)
        invitee-email (r/atom "")
        set-collapse! (fn [c?] (reset! collapsed? c?))
        set-invitee-email! (fn [message] (reset! invitee-email message))]
    (fn []
      (if collapsed?
        [:button.invite-open {:on-click
                                (fn [_]
                                    (set-collapse! false))}
          "invite"]
        [:div.invite-form
          [:input {:value invitee-email
                   :type "email"
                   :placeholder "email address"
                   :on-change
                     (fn [e]
                       (set-invitee-email! (.. e -target -value)))}]
          [:button.invite {:disabled (string/blank? invitee-email)
                           :on-click
                             (fn [_]
                               (dispatch! :invite {:group-id group-id
                                                   :invitee-email invitee-email})
                               (set-collapse! true)
                               (set-invitee-email! ""))}
            "invite"]
          [:button.close {:on-click
                           (fn [_]
                             (set-collapse! true))}
            "cancel"]]))))

<commit_msg>fixed group invite rendering issues<commit_after>(ns braid.ui.views.group-invite
  (:require [reagent.core :as r]
            [clojure.string :as string]
            [chat.client.reagent-adapter :refer [subscribe]]
            [chat.client.dispatcher :refer [dispatch!]])
  (:import [goog.events KeyCodes]))

(defn group-invite-view
  []
  (let [group-id (subscribe [:open-group-id])
        collapsed? (r/atom true)
        invitee-email (r/atom "")
        set-collapse! (fn [c?] (reset! collapsed? c?))
        set-invitee-email! (fn [message] (reset! invitee-email message))]
    (fn []
      (if @collapsed?
        [:button.invite-open {:on-click
                                (fn [_]
                                    (set-collapse! false))}
          "Invite"]
        [:div.invite-form
          [:input {:value @invitee-email
                   :type "email"
                   :placeholder "email address"
                   :on-change
                     (fn [e]
                       (set-invitee-email! (.. e -target -value)))}]
          [:button.invite {:disabled (string/blank? @invitee-email)
                           :on-click
                             (fn [_]
                               (dispatch! :invite {:group-id @group-id
                                                   :invitee-email @invitee-email})
                               (set-collapse! true)
                               (set-invitee-email! ""))}
            "invite"]
          [:button.close {:on-click
                           (fn [_]
                             (set-collapse! true))}
            "cancel"]]))))


{'fraction_non_alphanumeric': 0.13480012395413696, 'fraction_numerical': 0.0, 'mean_word_length': 1.1708137188971082, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2348123', 'n_tokens_mistral': 920, 'n_tokens_neox': 884, 'n_words': 180}