From 4f238919414690a1d66e7814ca474b6001a28208 Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Sun, 17 Dec 2023 16:51:12 +0000 Subject: [PATCH] clean --- .../components/utilities/token/loader.cljs | 2 +- src/quo/core_spec.cljs | 22 ++- .../common/floating_button_page/view.cljs | 3 +- .../contexts/wallet/account/view.cljs | 3 +- .../send/transaction_progress/style.cljs | 2 +- .../send/transaction_progress/view.cljs | 44 ++++++ src/status_im/navigation/screens.cljs | 126 +++++++++--------- .../send/transaction_progress/view.cljs | 55 -------- 8 files changed, 121 insertions(+), 136 deletions(-) rename src/{status_im2 => status_im}/contexts/wallet/send/transaction_progress/style.cljs (53%) create mode 100644 src/status_im/contexts/wallet/send/transaction_progress/view.cljs delete mode 100644 src/status_im2/contexts/wallet/send/transaction_progress/view.cljs diff --git a/src/quo/components/utilities/token/loader.cljs b/src/quo/components/utilities/token/loader.cljs index 671b321d7906..af3274b78031 100644 --- a/src/quo/components/utilities/token/loader.cljs +++ b/src/quo/components/utilities/token/loader.cljs @@ -8,7 +8,7 @@ [token] (let [token-symbol (cond-> token (keyword? token) name - :always string/lower-case)] + :always (comp string/lower-case str))] (get tokens token-symbol))) (def get-token-image (memoize get-token-image*)) diff --git a/src/quo/core_spec.cljs b/src/quo/core_spec.cljs index dc67a4bfac76..30771ab3ed72 100644 --- a/src/quo/core_spec.cljs +++ b/src/quo/core_spec.cljs @@ -1,5 +1,10 @@ (ns quo.core-spec - (:require + (:require ;; [quo.components.list-items.account.component-spec] + ;; [quo.components.list-items.address.component-spec] + ;; [quo.components.list-items.saved-address.component-spec] + ;; [quo.components.list-items.saved-contact-address.component-spec] + ;; [quo.components.list-items.saved-contact-address.component-spec] + ;; [quo.components.list-items.token-network.component-spec] [quo.components.avatars.account-avatar.component-spec] [quo.components.avatars.user-avatar.component-spec] [quo.components.banners.banner.component-spec] @@ -31,25 +36,18 @@ [quo.components.dropdowns.dropdown.component-spec] [quo.components.dropdowns.network-dropdown.component-spec] [quo.components.gradient.gradient-cover.component-spec] - [quo.components.graph.wallet-graph.component-spec] - ;; [quo.components.inputs.address-input.component-spec] + [quo.components.graph.wallet-graph.component-spec] ;; [quo.components.inputs.address-input.component-spec] [quo.components.inputs.input.component-spec] [quo.components.inputs.locked-input.component-spec] [quo.components.inputs.profile-input.component-spec] - [quo.components.inputs.recovery-phrase.component-spec] - ;; [quo.components.inputs.title-input.component-spec] + [quo.components.inputs.recovery-phrase.component-spec] ;; [quo.components.inputs.title-input.component-spec] [quo.components.keycard.component-spec] [quo.components.links.link-preview.component-spec] [quo.components.links.url-preview-list.component-spec] - [quo.components.links.url-preview.component-spec] - ;; [quo.components.list-items.account.component-spec] - ;; [quo.components.list-items.address.component-spec] + [quo.components.links.url-preview.component-spec] ;; [quo.components.list-items.account.component-spec] [quo.components.list-items.channel.component-spec] [quo.components.list-items.community.component-spec] - [quo.components.list-items.dapp.component-spec] - ;; [quo.components.list-items.saved-address.component-spec] - ;; [quo.components.list-items.saved-contact-address.component-spec] - ;; [quo.components.list-items.token-network.component-spec] + [quo.components.list-items.dapp.component-spec] ;; [quo.components.list-items.saved-address.component-spec] [quo.components.list-items.token-value.component-spec] [quo.components.loaders.skeleton-list.component-spec] [quo.components.markdown.list.component-spec] diff --git a/src/status_im/common/floating_button_page/view.cljs b/src/status_im/common/floating_button_page/view.cljs index c7d53b2bf286..dc0ed27b6bd2 100644 --- a/src/status_im/common/floating_button_page/view.cljs +++ b/src/status_im/common/floating_button_page/view.cljs @@ -52,7 +52,7 @@ :remove-listeners remove-listeners})) (defn view - [{:keys [header footer customization-color gradient-cover?] :or {customization-color :blue}} & + [{:keys [header footer customization-color gradient-cover?]} & children] (reagent/with-let [window-height (:height (rn/get-window)) footer-container-height (reagent/atom 0) @@ -83,7 +83,6 @@ :keyboard-shown? keyboard-shown?})] [:<> (when gradient-cover? [quo/gradient-cover {:customization-color customization-color}]) - [rn/view {:style style/page-container} [rn/view {:on-layout set-header-height} header] diff --git a/src/status_im/contexts/wallet/account/view.cljs b/src/status_im/contexts/wallet/account/view.cljs index 5bf7efc2fd68..47b0e3d8061f 100644 --- a/src/status_im/contexts/wallet/account/view.cljs +++ b/src/status_im/contexts/wallet/account/view.cljs @@ -38,8 +38,7 @@ (let [{:keys [name color balance watch-only?]} (rf/sub [:wallet/current-viewing-account]) currency-symbol (rf/sub [:profile/currency-symbol])] [rn/view {:style {:flex 1}} - [rn/pressable {:on-press #(rf/dispatch [:navigate-to :wallet-transaction-progress])} - [account-switcher/view {:on-press #(rf/dispatch [:wallet/close-account-page])}]] + [account-switcher/view {:on-press #(rf/dispatch [:wallet/close-account-page])}] [quo/account-overview {:current-value (utils/prettify-balance currency-symbol balance) :account-name name diff --git a/src/status_im2/contexts/wallet/send/transaction_progress/style.cljs b/src/status_im/contexts/wallet/send/transaction_progress/style.cljs similarity index 53% rename from src/status_im2/contexts/wallet/send/transaction_progress/style.cljs rename to src/status_im/contexts/wallet/send/transaction_progress/style.cljs index e68dc4bb5b11..94f31ccae946 100644 --- a/src/status_im2/contexts/wallet/send/transaction_progress/style.cljs +++ b/src/status_im/contexts/wallet/send/transaction_progress/style.cljs @@ -1,4 +1,4 @@ -(ns status-im2.contexts.wallet.send.transaction-progress.style) +(ns status-im.contexts.wallet.send.transaction-progress.style) (def content-container {:flex 1 diff --git a/src/status_im/contexts/wallet/send/transaction_progress/view.cljs b/src/status_im/contexts/wallet/send/transaction_progress/view.cljs new file mode 100644 index 000000000000..cc940aec38cf --- /dev/null +++ b/src/status_im/contexts/wallet/send/transaction_progress/view.cljs @@ -0,0 +1,44 @@ +(ns status-im.contexts.wallet.send.transaction-progress.view + (:require + [quo.core :as quo] + [react-native.core :as rn] + [react-native.safe-area :as safe-area] + [reagent.core :as reagent] + [status-im.common.floating-button-page.view :as floating-button-page] + [status-im.common.resources :as resources] + [status-im.contexts.wallet.send.transaction-progress.style :as style] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(defn titles + [status] + (case status + :sending (i18n/label :t/sending-with-elipsis) + :confirmed (i18n/label :t/transaction-confirmed) + :finalised (i18n/label :t/transacation-finalised) + "")) + +(defn view + [] + (let [status (reagent/atom :sending) + {:keys [color]} (rf/sub [:wallet/current-viewing-account])] + [floating-button-page/view + {:header [quo/page-nav + {:type :no-title + :background :blur + :icon-name :i/close + :margin-top (safe-area/get-top) + :on-press #(rf/dispatch [:navigate-back]) + :accessibility-label :top-bar}] + :footer [quo/button + {:customization-color color + :on-press #(rf/dispatch [:navigate-back])} + (i18n/label :t/done)] + :customization-color color + :gradient-cover? true} + [rn/view {:style style/content-container} + [rn/image + {:source (resources/get-image :transaction-progress) + :style {:margin-bottom 12}}] + [quo/standard-title + {:title (titles @status)}]]])) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index ff1e5f5cd3ed..779c945d657b 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -1,68 +1,68 @@ (ns status-im.navigation.screens (:require - [legacy.status-im.ui.screens.screens :as old-screens] - [status-im.config :as config] - [status-im.contexts.add-new-contact.scan.scan-profile-qr-page :as scan-profile-qr-page] - [status-im.contexts.add-new-contact.views :as add-new-contact] - [status-im.contexts.chat.camera.view :as camera-screen] - [status-im.contexts.chat.group-details.view :as group-details] - [status-im.contexts.chat.lightbox.view :as lightbox] - [status-im.contexts.chat.messages.view :as chat] - [status-im.contexts.chat.new-chat.view :as new-chat] - [status-im.contexts.chat.photo-selector.view :as photo-selector] - [status-im.contexts.communities.actions.accounts-selection.view :as communities.accounts-selection] - [status-im.contexts.communities.actions.addresses-for-permissions.view :as - addresses-for-permissions] - [status-im.contexts.communities.actions.request-to-join.view :as join-menu] - [status-im.contexts.communities.discover.view :as communities.discover] - [status-im.contexts.communities.overview.view :as communities.overview] - [status-im.contexts.emoji-picker.view :as emoji-picker] - [status-im.contexts.onboarding.create-password.view :as create-password] - [status-im.contexts.onboarding.create-profile.view :as create-profile] - [status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics] - [status-im.contexts.onboarding.enable-notifications.view :as enable-notifications] - [status-im.contexts.onboarding.enter-seed-phrase.view :as enter-seed-phrase] - [status-im.contexts.onboarding.generating-keys.view :as generating-keys] - [status-im.contexts.onboarding.identifiers.view :as identifiers] - [status-im.contexts.onboarding.intro.view :as intro] - [status-im.contexts.onboarding.new-to-status.view :as new-to-status] - [status-im.contexts.onboarding.sign-in.view :as sign-in] - [status-im.contexts.onboarding.syncing.progress.view :as syncing-devices] - [status-im.contexts.onboarding.syncing.results.view :as syncing-results] - [status-im.contexts.onboarding.welcome.view :as welcome] - [status-im.contexts.profile.profiles.view :as profiles] - [status-im.contexts.profile.settings.view :as settings] - [status-im.contexts.quo-preview.component-preview.view :as component-preview] - [status-im.contexts.quo-preview.main :as quo.preview] - [status-im.contexts.shell.activity-center.view :as activity-center] - [status-im.contexts.shell.jump-to.view :as shell] - [status-im.contexts.shell.share.view :as share] - [status-im.contexts.status-im-preview.main :as status-im-preview] - [status-im.contexts.syncing.find-sync-code.view :as find-sync-code] - [status-im.contexts.syncing.how-to-pair.view :as how-to-pair] - [status-im.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page] - [status-im.contexts.syncing.setup-syncing.view :as settings-setup-syncing] - [status-im.contexts.syncing.syncing-devices-list.view :as settings-syncing] - [status-im.contexts.wallet.account.bridge.view :as bridge] - [status-im.contexts.wallet.account.view :as wallet-accounts] - [status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as confirm-address-to-watch] - [status-im.contexts.wallet.add-address-to-watch.view :as add-address-to-watch] - [status-im.contexts.wallet.collectible.view :as wallet-collectible] - [status-im.contexts.wallet.create-account.backup-recovery-phrase.view :as - wallet-backup-recovery-phrase] - [status-im.contexts.wallet.create-account.edit-derivation-path.view :as wallet-edit-derivation-path] - [status-im.contexts.wallet.create-account.select-keypair.view :as wallet-select-keypair] - [status-im.contexts.wallet.create-account.view :as wallet-create-account] - [status-im.contexts.wallet.edit-account.view :as wallet-edit-account] - [status-im.contexts.wallet.saved-addresses.view :as wallet-saved-addresses] - [status-im.contexts.wallet.scan-account.view :as scan-address] - [status-im.contexts.wallet.send.input-amount.view :as wallet-send-input-amount] - [status-im.contexts.wallet.send.select-address.view :as wallet-select-address] - [status-im.contexts.wallet.send.select-asset.view :as wallet-select-asset] - [status-im.contexts.wallet.send.transaction-confirmation.view :as wallet-transaction-confirmation] - [status-im.contexts.wallet.send.transaction-progress.view :as wallet-transaction-progress] - [status-im.navigation.options :as options] - [status-im.navigation.transitions :as transitions])) + [legacy.status-im.ui.screens.screens :as old-screens] + [status-im.config :as config] + [status-im.contexts.add-new-contact.scan.scan-profile-qr-page :as scan-profile-qr-page] + [status-im.contexts.add-new-contact.views :as add-new-contact] + [status-im.contexts.chat.camera.view :as camera-screen] + [status-im.contexts.chat.group-details.view :as group-details] + [status-im.contexts.chat.lightbox.view :as lightbox] + [status-im.contexts.chat.messages.view :as chat] + [status-im.contexts.chat.new-chat.view :as new-chat] + [status-im.contexts.chat.photo-selector.view :as photo-selector] + [status-im.contexts.communities.actions.accounts-selection.view :as communities.accounts-selection] + [status-im.contexts.communities.actions.addresses-for-permissions.view :as + addresses-for-permissions] + [status-im.contexts.communities.actions.request-to-join.view :as join-menu] + [status-im.contexts.communities.discover.view :as communities.discover] + [status-im.contexts.communities.overview.view :as communities.overview] + [status-im.contexts.emoji-picker.view :as emoji-picker] + [status-im.contexts.onboarding.create-password.view :as create-password] + [status-im.contexts.onboarding.create-profile.view :as create-profile] + [status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics] + [status-im.contexts.onboarding.enable-notifications.view :as enable-notifications] + [status-im.contexts.onboarding.enter-seed-phrase.view :as enter-seed-phrase] + [status-im.contexts.onboarding.generating-keys.view :as generating-keys] + [status-im.contexts.onboarding.identifiers.view :as identifiers] + [status-im.contexts.onboarding.intro.view :as intro] + [status-im.contexts.onboarding.new-to-status.view :as new-to-status] + [status-im.contexts.onboarding.sign-in.view :as sign-in] + [status-im.contexts.onboarding.syncing.progress.view :as syncing-devices] + [status-im.contexts.onboarding.syncing.results.view :as syncing-results] + [status-im.contexts.onboarding.welcome.view :as welcome] + [status-im.contexts.profile.profiles.view :as profiles] + [status-im.contexts.profile.settings.view :as settings] + [status-im.contexts.quo-preview.component-preview.view :as component-preview] + [status-im.contexts.quo-preview.main :as quo.preview] + [status-im.contexts.shell.activity-center.view :as activity-center] + [status-im.contexts.shell.jump-to.view :as shell] + [status-im.contexts.shell.share.view :as share] + [status-im.contexts.status-im-preview.main :as status-im-preview] + [status-im.contexts.syncing.find-sync-code.view :as find-sync-code] + [status-im.contexts.syncing.how-to-pair.view :as how-to-pair] + [status-im.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page] + [status-im.contexts.syncing.setup-syncing.view :as settings-setup-syncing] + [status-im.contexts.syncing.syncing-devices-list.view :as settings-syncing] + [status-im.contexts.wallet.account.bridge.view :as bridge] + [status-im.contexts.wallet.account.view :as wallet-accounts] + [status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as confirm-address-to-watch] + [status-im.contexts.wallet.add-address-to-watch.view :as add-address-to-watch] + [status-im.contexts.wallet.collectible.view :as wallet-collectible] + [status-im.contexts.wallet.create-account.backup-recovery-phrase.view :as + wallet-backup-recovery-phrase] + [status-im.contexts.wallet.create-account.edit-derivation-path.view :as wallet-edit-derivation-path] + [status-im.contexts.wallet.create-account.select-keypair.view :as wallet-select-keypair] + [status-im.contexts.wallet.create-account.view :as wallet-create-account] + [status-im.contexts.wallet.edit-account.view :as wallet-edit-account] + [status-im.contexts.wallet.saved-addresses.view :as wallet-saved-addresses] + [status-im.contexts.wallet.scan-account.view :as scan-address] + [status-im.contexts.wallet.send.input-amount.view :as wallet-send-input-amount] + [status-im.contexts.wallet.send.select-address.view :as wallet-select-address] + [status-im.contexts.wallet.send.select-asset.view :as wallet-select-asset] + [status-im.contexts.wallet.send.transaction-confirmation.view :as wallet-transaction-confirmation] + [status-im.contexts.wallet.send.transaction-progress.view :as wallet-transaction-progress] + [status-im.navigation.options :as options] + [status-im.navigation.transitions :as transitions])) (defn screens [] diff --git a/src/status_im2/contexts/wallet/send/transaction_progress/view.cljs b/src/status_im2/contexts/wallet/send/transaction_progress/view.cljs deleted file mode 100644 index 2b50becfafcd..000000000000 --- a/src/status_im2/contexts/wallet/send/transaction_progress/view.cljs +++ /dev/null @@ -1,55 +0,0 @@ -(ns status-im2.contexts.wallet.send.transaction-progress.view - (:require - [quo.core :as quo] - [quo.theme :as quo.theme] - [react-native.core :as rn] - [react-native.safe-area :as safe-area] - [reagent.core :as reagent] - [status-im2.common.floating-button-page.view :as floating-button-page] - [status-im2.common.resources :as resources] - [status-im2.contexts.wallet.send.transaction-progress.style :as style] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) - -(defn titles - [status] - (case status - :sending (i18n/label :t/sending-with-elipsis) - :confirmed (i18n/label :t/transaction-confirmed) - :finalised (i18n/label :t/transacation-finalised))) - -(defn- f-view-internal - [_] - (let [status (reagent/atom :sending) - {:keys [color]} (rf/sub [:wallet/current-viewing-account])] - (fn [{:keys []}] - [floating-button-page/view - {:header [quo/page-nav - {:type :no-title - :background :blur - :icon-name :i/close - :margin-top (safe-area/get-top) - :on-press #(rf/dispatch [:navigate-back]) - :accessibility-label :top-bar}] - :footer [quo/button - {:customization-color color - :on-press #(rf/dispatch [:navigate-back])} - (i18n/label :t/done)] - :customization-color color - :gradient-cover? true} - - - [rn/view {:style style/content-container} - [rn/image - {:source (resources/get-image :transaction-progress) - :style {:margin-bottom 12}}] - [quo/standard-title - {:title (titles @status) - :on-press #() - :accessibility-label :top-bar}]]]))) - -(defn view-internal - [props] - [:f> f-view-internal props]) - -(def view (quo.theme/with-theme view-internal))