-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into slideshow
- Loading branch information
Showing
7 changed files
with
162 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/status_im/contexts/wallet/common/sheets/remove_account/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns status-im.contexts.wallet.common.sheets.remove-account.style) | ||
|
||
(def desc-container | ||
{:padding-horizontal 20 | ||
:padding-top 4 | ||
:padding-bottom 12}) | ||
|
||
(def copy-container | ||
{:margin-horizontal 20 | ||
:margin-top 4 | ||
:margin-bottom 8}) | ||
|
||
(def checkbox-container | ||
{:flex-direction :row | ||
:padding-horizontal 20 | ||
:padding-vertical 8 | ||
:gap 10}) |
91 changes: 91 additions & 0 deletions
91
src/status_im/contexts/wallet/common/sheets/remove_account/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
(ns status-im.contexts.wallet.common.sheets.remove-account.view | ||
(:require | ||
[quo.core :as quo] | ||
[quo.theme] | ||
[react-native.clipboard :as clipboard] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent] | ||
[status-im.contexts.wallet.common.sheets.remove-account.style :as style] | ||
[status-im.contexts.wallet.common.utils :as utils] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- footer | ||
[{:keys [submit-disabled?]}] | ||
[quo/bottom-actions | ||
{:actions :2-actions | ||
:customization-color :danger | ||
:button-one-label (i18n/label :t/remove) | ||
:button-one-props {:on-press #(js/alert "Will be implemented") | ||
:type :danger | ||
:disabled? submit-disabled?} | ||
:button-two-label (i18n/label :t/cancel) | ||
:button-two-props {:on-press #(rf/dispatch [:hide-bottom-sheet]) | ||
:type :grey}}]) | ||
|
||
(defn- recovery-phase-flow | ||
[] | ||
(let [confirmed? (reagent/atom false)] | ||
(fn [{:keys [name emoji path color] :as _account}] | ||
(let [formatted-path (utils/format-derivation-path path)] | ||
[:<> | ||
[quo/drawer-top | ||
{:title (i18n/label :t/remove-account-title) | ||
:type :context-tag | ||
:context-tag-type :account | ||
:account-name name | ||
:emoji emoji | ||
:customization-color color}] | ||
[rn/view {:style style/desc-container} | ||
[quo/text {:weight :medium} | ||
(i18n/label :t/remove-account-desc)]] | ||
[quo/data-item | ||
{:size :default | ||
:status :default | ||
:card? true | ||
:title (i18n/label :t/derivation-path) | ||
:custom-subtitle (fn [] | ||
[quo/text {:weight :medium} | ||
formatted-path]) | ||
:icon-right? true | ||
:right-icon :i/copy | ||
:on-press (fn [] | ||
(rf/dispatch [:toasts/upsert | ||
{:type :positive | ||
:text (i18n/label :t/derivation-path-copied)}]) | ||
(clipboard/set-string formatted-path)) | ||
:container-style style/copy-container}] | ||
[rn/pressable | ||
{:style style/checkbox-container | ||
:on-press #(swap! confirmed? not)} | ||
[quo/selectors | ||
{:type :checkbox | ||
:customization-color color | ||
:checked? @confirmed? | ||
:on-change #(swap! confirmed? not)}] | ||
[quo/text (i18n/label :t/remove-account-confirmation)]] | ||
[footer {:submit-disabled? (not @confirmed?)}]])))) | ||
|
||
(defn- watched-address-flow | ||
[{:keys [name emoji color] :as _account}] | ||
[:<> | ||
[quo/drawer-top | ||
{:title (i18n/label :t/remove-watched-address-title) | ||
:type :context-tag | ||
:context-tag-type :account | ||
:account-name name | ||
:emoji emoji | ||
:customization-color color}] | ||
[rn/view {:style style/desc-container} | ||
[quo/text {:weight :medium} | ||
(i18n/label :t/remove-watched-address-desc)]] | ||
[footer {:submit-disabled? false}]]) | ||
|
||
(defn- view-internal | ||
[] | ||
(let [{:keys [type] :as account} (rf/sub [:wallet/current-viewing-account])] | ||
(case type | ||
:generated [recovery-phase-flow account] | ||
:watch [watched-address-flow account]))) | ||
|
||
(def view (quo.theme/with-theme view-internal)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters