mirror of
https://github.com/status-im/status-react.git
synced 2025-01-28 03:36:23 +00:00
parent
1b9c8d3d6f
commit
6a03d90432
@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [0.9.26 - Unreleased]
|
## [0.9.26 - Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
- Allow user to remove custom avatar
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -195,6 +195,7 @@
|
|||||||
:image-source-title "Edit picture"
|
:image-source-title "Edit picture"
|
||||||
:image-source-make-photo "Capture"
|
:image-source-make-photo "Capture"
|
||||||
:image-source-gallery "Select from gallery"
|
:image-source-gallery "Select from gallery"
|
||||||
|
:image-remove-current "Remove current photo"
|
||||||
|
|
||||||
;;sharing
|
;;sharing
|
||||||
:sharing-copy-to-clipboard "Copy to clipboard"
|
:sharing-copy-to-clipboard "Copy to clipboard"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
(:require [re-frame.core :as re-frame]
|
(:require [re-frame.core :as re-frame]
|
||||||
[status-im.ui.screens.profile.navigation]
|
[status-im.ui.screens.profile.navigation]
|
||||||
[status-im.utils.handlers :as handlers]
|
[status-im.utils.handlers :as handlers]
|
||||||
|
[status-im.utils.identicon :as identicon]
|
||||||
[status-im.ui.screens.profile.models :as profile.models]))
|
[status-im.ui.screens.profile.models :as profile.models]))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
@ -25,6 +26,14 @@
|
|||||||
(fn [cofx [this-event base64-image]]
|
(fn [cofx [this-event base64-image]]
|
||||||
(profile.models/update-picture this-event base64-image cofx)))
|
(profile.models/update-picture this-event base64-image cofx)))
|
||||||
|
|
||||||
|
(handlers/register-handler-fx
|
||||||
|
:my-profile/remove-current-photo
|
||||||
|
(fn [{:keys [db]}]
|
||||||
|
{:db (-> db
|
||||||
|
(assoc-in [:my-profile/profile :photo-path]
|
||||||
|
(identicon/identicon (:current-public-key db)))
|
||||||
|
(assoc :my-profile/editing? true))}))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:my-profile/start-editing-profile
|
:my-profile/start-editing-profile
|
||||||
(fn [cofx _]
|
(fn [cofx _]
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.utils :as utils]
|
||||||
[status-im.ui.components.icons.vector-icons :as icons]
|
[status-im.ui.components.icons.vector-icons :as icons]
|
||||||
[status-im.ui.components.common.common :as components.common]
|
[status-im.ui.components.common.common :as components.common]
|
||||||
|
[status-im.utils.identicon :as identicon]
|
||||||
[clojure.string :as string]))
|
[clojure.string :as string]))
|
||||||
|
|
||||||
(defn my-profile-toolbar []
|
(defn my-profile-toolbar []
|
||||||
@ -59,6 +60,10 @@
|
|||||||
(i18n/label :t/camera-access-error))
|
(i18n/label :t/camera-access-error))
|
||||||
50))}]))}])
|
50))}]))}])
|
||||||
|
|
||||||
|
(defn- profile-icon-options-ext []
|
||||||
|
(conj profile-icon-options {:label (i18n/label :t/image-remove-current)
|
||||||
|
:action #(re-frame/dispatch [:my-profile/remove-current-photo])}))
|
||||||
|
|
||||||
(defn qr-viewer-toolbar [label value]
|
(defn qr-viewer-toolbar [label value]
|
||||||
[toolbar/toolbar {}
|
[toolbar/toolbar {}
|
||||||
[toolbar/default-done {:icon-opts {:color colors/black}
|
[toolbar/default-done {:icon-opts {:color colors/black}
|
||||||
@ -182,7 +187,7 @@
|
|||||||
[advanced-settings params on-show])]))
|
[advanced-settings params on-show])]))
|
||||||
|
|
||||||
(defview my-profile []
|
(defview my-profile []
|
||||||
(letsubs [{:keys [public-key] :as current-account} [:get-current-account]
|
(letsubs [{:keys [public-key photo-path] :as current-account} [:get-current-account]
|
||||||
editing? [:get :my-profile/editing?]
|
editing? [:get :my-profile/editing?]
|
||||||
changed-account [:get :my-profile/profile]
|
changed-account [:get :my-profile/profile]
|
||||||
currency [:wallet/currency]
|
currency [:wallet/currency]
|
||||||
@ -210,7 +215,9 @@
|
|||||||
:edited-contact changed-account
|
:edited-contact changed-account
|
||||||
:editing? editing?
|
:editing? editing?
|
||||||
:allow-icon-change? true
|
:allow-icon-change? true
|
||||||
:options profile-icon-options
|
:options (if (not= (identicon/identicon public-key) photo-path)
|
||||||
|
(profile-icon-options-ext)
|
||||||
|
profile-icon-options)
|
||||||
:on-change-text-event :my-profile/update-name}]]
|
:on-change-text-event :my-profile/update-name}]]
|
||||||
[react/view action-button.styles/actions-list
|
[react/view action-button.styles/actions-list
|
||||||
[share-contact-code current-account public-key]]
|
[share-contact-code current-account public-key]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user