mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-26 23:31:03 +00:00
show ens name by default
This commit is contained in:
parent
1a61ae4b73
commit
5f28dc0a52
@ -90,8 +90,7 @@
|
|||||||
(when-not (string/blank? input-text)
|
(when-not (string/blank? input-text)
|
||||||
(let [{:keys [message-id]}
|
(let [{:keys [message-id]}
|
||||||
(get-in db [:chats current-chat-id :metadata :responding-to-message])
|
(get-in db [:chats current-chat-id :metadata :responding-to-message])
|
||||||
show-name? (get-in db [:multiaccount :show-name?])
|
preferred-name (get-in db [:multiaccount :preferred-name])
|
||||||
preferred-name (when show-name? (get-in db [:multiaccount :preferred-name]))
|
|
||||||
emoji? (message-content/emoji-only-content? {:text input-text
|
emoji? (message-content/emoji-only-content? {:text input-text
|
||||||
:response-to message-id})]
|
:response-to message-id})]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
|
@ -229,14 +229,6 @@
|
|||||||
{:preferred-name name}
|
{:preferred-name name}
|
||||||
{}))
|
{}))
|
||||||
|
|
||||||
(fx/defn switch-show-username
|
|
||||||
{:events [::switch-show-username]}
|
|
||||||
[{:keys [db] :as cofx} _]
|
|
||||||
(let [show-name? (not (get-in db [:multiaccount :show-name?]))]
|
|
||||||
(multiaccounts.update/multiaccount-update cofx
|
|
||||||
{:show-name? show-name?}
|
|
||||||
{})))
|
|
||||||
|
|
||||||
(fx/defn on-registration-failure
|
(fx/defn on-registration-failure
|
||||||
"TODO not sure there is actually anything to do here
|
"TODO not sure there is actually anything to do here
|
||||||
it should only be called if the user cancels the signing
|
it should only be called if the user cancels the signing
|
||||||
|
@ -1885,12 +1885,6 @@
|
|||||||
(fn [multiaccount]
|
(fn [multiaccount]
|
||||||
(:preferred-name multiaccount)))
|
(:preferred-name multiaccount)))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
|
||||||
:ens/show?
|
|
||||||
:<- [:multiaccount]
|
|
||||||
(fn [multiaccount]
|
|
||||||
(:show-name? multiaccount)))
|
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:ens/search-screen
|
:ens/search-screen
|
||||||
:<- [:ens/registration]
|
:<- [:ens/registration]
|
||||||
@ -1950,12 +1944,10 @@
|
|||||||
:<- [:multiaccount/usernames]
|
:<- [:multiaccount/usernames]
|
||||||
:<- [:multiaccount]
|
:<- [:multiaccount]
|
||||||
:<- [:ens/preferred-name]
|
:<- [:ens/preferred-name]
|
||||||
:<- [:ens/show?]
|
(fn [[names multiaccount preferred-name]]
|
||||||
(fn [[names multiaccount preferred-name show?]]
|
|
||||||
{:names names
|
{:names names
|
||||||
:multiaccount multiaccount
|
:multiaccount multiaccount
|
||||||
:preferred-name preferred-name
|
:preferred-name preferred-name}))
|
||||||
:show? (or show? false)}))
|
|
||||||
|
|
||||||
;;SIGNING =============================================================================================================
|
;;SIGNING =============================================================================================================
|
||||||
|
|
||||||
|
@ -590,8 +590,7 @@
|
|||||||
{:title s
|
{:title s
|
||||||
:subtitle (when stateofus-username stateofus/domain)
|
:subtitle (when stateofus-username stateofus/domain)
|
||||||
:on-press action
|
:on-press action
|
||||||
:icon :main-icons/username
|
:icon :main-icons/username}]))
|
||||||
:accessories [:chevron]}]))
|
|
||||||
|
|
||||||
(defn- name-list [names preferred-name]
|
(defn- name-list [names preferred-name]
|
||||||
[react/view {:style {:flex 1 :margin-top 16}}
|
[react/view {:style {:flex 1 :margin-top 16}}
|
||||||
@ -633,32 +632,27 @@
|
|||||||
[name-item {:name name :action #(re-frame/dispatch [::ens/navigate-to-name name])}])]
|
[name-item {:name name :action #(re-frame/dispatch [::ens/navigate-to-name name])}])]
|
||||||
[react/text {:style {:color colors/gray :font-size 15}}
|
[react/text {:style {:color colors/gray :font-size 15}}
|
||||||
(i18n/label :t/ens-no-usernames)])]
|
(i18n/label :t/ens-no-usernames)])]
|
||||||
[react/view {:style {:padding-top 22 :border-color colors/gray-lighter :border-top-width 1}}
|
[react/view {:style {:padding-vertical 22 :border-color colors/gray-lighter :border-top-width 1}}
|
||||||
[react/text {:style {:color colors/gray :margin-horizontal 16}}
|
|
||||||
(i18n/label :t/ens-chat-settings)]
|
|
||||||
(when (> (count names) 1)
|
(when (> (count names) 1)
|
||||||
[profile.components/settings-item
|
[react/view
|
||||||
{:label-kw :ens-primary-username
|
[react/text {:style {:color colors/gray :margin-horizontal 16}}
|
||||||
:value preferred-name
|
(i18n/label :t/ens-chat-settings)]
|
||||||
:action-fn #(re-frame/dispatch [:bottom-sheet/show-sheet
|
[profile.components/settings-item
|
||||||
{:content
|
{:label-kw :ens-primary-username
|
||||||
(fn [] (name-list names preferred-name))
|
:value preferred-name
|
||||||
:content-height
|
:action-fn #(re-frame/dispatch [:bottom-sheet/show-sheet
|
||||||
(+ 72 (* (min 4 (count names)) 64))}])}])
|
{:content
|
||||||
[profile.components/settings-switch-item
|
(fn [] (name-list names preferred-name))
|
||||||
{:label-kw :ens-show-username
|
:content-height
|
||||||
:action-fn #(re-frame/dispatch [::ens/switch-show-username])
|
(+ 72 (* (min 4 (count names)) 64))}])}]])]
|
||||||
:value show?}]]
|
(let [message {:content {:parsed-text
|
||||||
(let [message {:content {:parsed-text [{:type "paragraph", :children [{:literal (i18n/label :t/ens-test-message)}]}]}
|
[{:type "paragraph"
|
||||||
|
:children [{:literal (i18n/label :t/ens-test-message)}]}]}
|
||||||
:content-type constants/content-type-text
|
:content-type constants/content-type-text
|
||||||
:timestamp-str "9:41 AM"}]
|
:timestamp-str "9:41 AM"}]
|
||||||
[react/view
|
[react/view
|
||||||
[react/view {:padding-left 60}
|
[react/view {:padding-left 60}
|
||||||
(if show?
|
[message/message-author-name public-key]]
|
||||||
^{:key "ens-name"}
|
|
||||||
[message/message-author-name public-key]
|
|
||||||
^{:key "generated"}
|
|
||||||
[message/message-author-name nil name])]
|
|
||||||
[react/view {:flex-direction :row}
|
[react/view {:flex-direction :row}
|
||||||
[react/view {:padding-left 16 :padding-right 8 :padding-top 4}
|
[react/view {:padding-left 16 :padding-right 8 :padding-top 4}
|
||||||
[photos/photo (multiaccounts/displayed-photo account) {:size 36}]]
|
[photos/photo (multiaccounts/displayed-photo account) {:size 36}]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user