<commit_before>(ns status-im.ui.screens.browser.bookmarks.views
  (:require [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation]
            [status-im.ui.components.react :as react]
            [status-im.ui.components.topbar :as topbar]
            [status-im.i18n :as i18n]
            [status-im.ui.components.toolbar :as toolbar]
            [quo.core :as quo]
            [status-im.ui.components.colors :as colors]
            [reagent.core :as reagent]
            [clojure.string :as string]
            [re-frame.core :as re-frame]))

(defn screen [{:keys [url name new]}]
  (let [input-name (reagent/atom name)]
    (fn []
      (let [edit? (not new)]
        [kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
         [react/view {:flex 1}
          [topbar/topbar
           {:modal?        true
            :border-bottom true
            :title         (if edit? (i18n/label :t/edit-favourite) (i18n/label :t/new-favourite))}]
          [react/view {:style {:flex 1}}
           [quo/text-input
            {:container-style     {:margin 16 :margin-top 10}
             :accessibility-label :bookmark-input
             :max-length          100
             :auto-focus          true
             :show-cancel         false
             :label               (i18n/label :t/name)
             :default-value       name
             :on-change-text      #(reset! input-name %)}]
           [react/text {:style {:margin 16 :color colors/gray}}
            url]]
          [toolbar/toolbar
           {:show-border? true
            :center
            [quo/button
             {:accessibility-label :save-bookmark
              :type                :secondary
              :disabled            (string/blank? @input-name)<commit_msg>[#11606] Favorites - when changing the name of a favorite, the past name appears quickly when saving it<commit_after>(ns status-im.ui.screens.browser.bookmarks.views
  (:require [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation]
            [status-im.ui.components.react :as react]
            [status-im.ui.components.topbar :as topbar]
            [status-im.i18n :as i18n]
            [status-im.ui.components.toolbar :as toolbar]
            [quo.core :as quo]
            [status-im.ui.components.colors :as colors]
            [reagent.core :as reagent]
            [clojure.string :as string]
            [re-frame.core :as re-frame]))

(defn screen [{:keys [url name new]}]
  (let [input-name (reagent/atom name)]
    (fn []
      (let [edit? (not new)]
        [kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
         [react/view {:flex 1}
          [topbar/topbar
           {:modal?        true
            :border-bottom true
            :title         (if edit? (i18n/label :t/edit-favourite) (i18n/label :t/new-favourite))}]
          [react/view {:style {:flex 1}}
           [quo/text-input
            {:container-style     {:margin 16 :margin-top 10}
             :accessibility-label :bookmark-input
             :max-length          100
             :auto-focus          true
             :show-cancel         false
             :label               (i18n/label :t/name)
             :default-value       @input-name
             :on-change-text      #(reset! input-name %)}]
           [react/text {:style {:margin 16 :color colors/gray}}
            url]]
          [toolbar/toolbar
           {:show-border? true
            :center
            [quo/button
             {:accessibility-label :save-bookmark
              :type                :secondary
              :disabled            (string/blank? @input-name)
{'fraction_non_alphanumeric': 0.12414360098657166, 'fraction_numerical': 0.013428336530556317, 'mean_word_length': 1.5560224089635855, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222488', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1055, 'n_words': 239}