Compare commits

...
Author SHA1 Message Date
Yevheniia Berdnyk 32542baa24 e2e: community names update 2024-04-15 05:53:07 +03:00
Andrea Maria Piana de56aed530 Replace creation on communities client side
https://github.com/status-im/status-go/compare/b744ff43...b710fa3e
2024-04-11 17:23:11 +01:00
flexsurfer cfc43be3cc migrate reagent part6 (#19270) 2024-04-11 16:43:33 +02:00
flexsurfer 3164cc6a6c Chore: setup feature-flag for not-implemented settings (#19591) 2024-04-11 16:43:09 +02:00
Mohsen 5badb5bdb5 [#19178] fix: jump card responsive (#19600) 2024-04-11 17:36:28 +03:00
flexsurfer 292fd78ff8 warning fixes (#19605) 2024-04-11 15:42:29 +02:00
Lungu Cristian c875fb33fa Show token requirements only for token gated channels (#19529)
* fix: use role-permissions? instead of token-permission

token-permissions contains channel-permissions as well, which don't
make the community token-gated

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>

* fix: hide token requirements from open channels

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>

* fixed tests

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>

---------

Signed-off-by: Cristian Lungu <lungucristian95@gmail.com>
2024-04-11 16:27:18 +03:00
jakub b5962fd83a nix: fix detecting install type in Docker
Otherwise build fails in a Docker container for Desktop:
```
+ make status-go
Building: status-go
Unknown Nix installtion type!
Unknown Nix installtion type!
make[1]: *** [Makefile:223: statusgo-shared-library] Error 1
make: *** [Makefile:432: vendor/status-go/build/bin/libstatus.so] Error 2
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-04-11 16:01:34 +03:00
Jamie Caprani 1d1eae13a9 chore(wallet): move add-account funcitonality into its own folder (#19476) 2024-04-11 12:01:35 +02:00
71 changed files with 884 additions and 648 deletions
+1
View File
@@ -35,3 +35,4 @@ LOCAL_PAIRING_ENABLED=1
TEST_STATEOFUS=1
FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1
+1
View File
@@ -34,3 +34,4 @@ STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1
FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1
+1
View File
@@ -36,3 +36,4 @@ STICKERS_TEST_ENABLED=1
LOCAL_PAIRING_ENABLED=1
FAST_CREATE_COMMUNITY_ENABLED=1
TEST_NETWORKS_ENABLED=1
SHOW_NOT_IMPLEMENTED_FEATURES=1
+1
View File
@@ -27,6 +27,7 @@ nix_install_type() {
if [[ "$(os_name)" =~ NixOS ]]; then
echo "nixos"
else
USER=$(id -un) # Missing in Docker.
case "${NIX_STORE_DIR_GROUP}" in
"nixbld") echo "multi";;
"30000") echo "multi";;
+246 -24
View File
@@ -1,35 +1,257 @@
(ns legacy.status-im.communities.e2e
(:require [taoensso.timbre :as log]
(:require [promesa.core :as promesa]
[status-im.common.json-rpc.events :as rpc]
[status-im.constants :as constants]
[taoensso.timbre :as log]
[utils.re-frame :as rf]))
;;NOTE: ONLY FOR QA
(rf/defn create-closed-community
{:events [:fast-create-community/create-closed-community]}
[_]
{:json-rpc/call [{:method "wakuext_createClosedCommunity"
:params []
:js-response true
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
:on-error #(log/error "failed to create closed community." {:error %})}]
:dispatch [:hide-bottom-sheet]})
(def one-stt-in-wei "1000000000000000000")
(def one-eth-in-wei "1000000000000000000")
(def ten-stt-in-wei "10000000000000000000")
(def stt-symbol "STT")
(def eth-symbol "ETH")
(def null-address "0x0000000000000000000000000000000000000000")
(defn- eth-token-criteria
[amount-in-wei]
{:contractAddresses {constants/ethereum-sepolia-chain-id null-address
constants/arbitrum-sepolia-chain-id null-address
constants/optimism-sepolia-chain-id null-address}
:type constants/community-token-type-erc20
:symbol "ETH"
:name "Ethereum"
:amountInWei amount-in-wei
:decimals 18})
(defn- stt-token-criteria
[amount-in-wei]
{:contractAddresses {constants/ethereum-sepolia-chain-id constants/sepolia-stt-contract-address}
:type constants/community-token-type-erc20
:symbol "STT"
:name "Status Test Token"
:amountInWei amount-in-wei
:decimals 18})
(def token-criteria
{stt-symbol stt-token-criteria
eth-symbol eth-token-criteria})
(def base-channel-permissions
[{:permission-type constants/community-token-permission-can-view-channel
:token-symbol stt-symbol
:amount one-stt-in-wei}
{:permission-type constants/community-token-permission-can-view-channel
:token-symbol eth-symbol
:amount one-eth-in-wei}
{:permission-type constants/community-token-permission-can-view-and-post-channel
:token-symbol stt-symbol
:amount one-stt-in-wei}
{:permission-type constants/community-token-permission-can-view-and-post-channel
:token-symbol eth-symbol
:amount one-eth-in-wei}])
(defn- channel-names->description
[channel-names]
(map #(hash-map :name %1
:permissions [%2])
channel-names
base-channel-permissions))
(def community-descriptions
{:open
{:community-name "Open community"
:membership constants/community-permissions-auto-accept
:pin-message-allowed false}
:closed
{:community-name "Closed community"
:membership constants/community-permissions-manual-accept
:pin-message-allowed true
:categories [{:category-name "Pets" :channels #{"Cats" "Dogs"}}
{:category-name "Household" :channels #{"Rules"}}]
:channel-list [{:name "Cats"} {:name "Dogs"} {:name "Rules"}]}
:token-gated
{:community-name "Token gated community"
:membership constants/community-permissions-auto-accept
:pin-message-allowed true
:community-permissions [{:amount-in-wei ten-stt-in-wei
:permission-type constants/community-token-permission-become-member
:token-symbol stt-symbol}]
:channel-list (channel-names->description ["Lions" "Birds" "Trees" "Flowers"])}
:snt-admin
{:community-name "SNT Admin Community"
:membership constants/community-permissions-auto-accept
:pin-message-allowed true
:community-permissions [{:amount-in-wei one-stt-in-wei
:permission-type constants/community-token-permission-become-admin
:token-symbol stt-symbol}]
:channel-list (channel-names->description ["Sounds" "Colors" "Books" "Sports"])}
:admin-and-member
{:community-name "Admin and Member"
:membership constants/community-permissions-auto-accept
:pin-message-allowed true
:community-permissions [{:amount-in-wei one-stt-in-wei
:permission-type constants/community-token-permission-become-member
:token-symbol stt-symbol}
{:amount-in-wei one-eth-in-wei
:permission-type constants/community-token-permission-become-admin
:token-symbol eth-symbol}]
:channel-list (channel-names->description ["Party" "Birthday" "Travel" "Cars"])}})
(defn- js-messenger-response->community-id
[response]
(-> response .-communities first .-id))
(defn- js-messenger-response->channel-id
[channel-name response]
(->> response
.-communities
first
.-chats
js->clj
vals
(some #(when (= channel-name (get % "name")) (get % "id")))))
(defn- channel-token-criteria->request
[community-id channel-id {:keys [token-symbol amount]}]
(fn []
(rpc/call
{:method "wakuext_createCommunityTokenPermissionV2"
:js-response true
:params [{:communityID community-id
:type constants/community-token-permission-become-member
:chatIds [channel-id]
:tokenCriteria [((token-criteria token-symbol) amount)]}]})))
(defn- channel-token-criteria->requests
[community-id channel-id tokens]
(let [keep-fn (partial channel-token-criteria->request community-id channel-id)]
(keep keep-fn tokens)))
(defn- create-community-channel!
[channel community-id]
(->
(rpc/call
{:method "wakuext_createCommunityChannel"
:js-response true
:params [{:name (:name channel)
:communityId community-id
:description (:name channel)}]})
(.then (fn [response]
(if (:permissions channel)
(let [channel-id (js-messenger-response->channel-id (:name channel) response)]
(apply
promesa/chain
(promesa/resolved nil)
(channel-token-criteria->requests community-id channel-id (:permissions channel))))
response)))
(.catch #(log/error "failed to create token gated community channel."
{:error %
:channel-name (:name channel)}))))
(defn- create-category!
[response {:keys [category-name channels]}]
(let [community-id (js-messenger-response->community-id response)
channel-ids (map #(js-messenger-response->channel-id % response)
channels)]
(rpc/call
{:method "wakuext_createCommunityCategory"
:js-response true
:params [{:communityId community-id
:categoryName category-name
:chatIds channel-ids}]})))
(defn- create-community!
[community-name membership pin-message-allowed]
(rpc/call
{:method "wakuext_createCommunity"
:js-response true
:params [{:name community-name
:description community-name
:color "#887af9"
:historyArchiveSupportEnabled true
:membership membership
:pinMessageAllMembersEnabled pin-message-allowed}]}))
(defn- create-token-gated-permission!
[{:keys [token-symbol permission-type amount-in-wei]} community-id]
(rpc/call
{:method "wakuext_createCommunityTokenPermissionV2"
:js-response true
:params [{:communityId community-id
:type permission-type
:tokenCriteria [((token-criteria token-symbol) amount-in-wei)]}]}))
(def passthrough [identity])
(defn- create-community-from-description
[{:keys [community-name
membership
community-permissions
pin-message-allowed
categories
channel-list]}]
(let [create-community-permissions-fn (if (seq community-permissions)
(map
(fn [permission]
(fn [response]
(create-token-gated-permission!
permission
(js-messenger-response->community-id response))))
community-permissions)
passthrough)
create-channels-fn (if (seq channel-list)
(map
(fn [channel]
(fn [response]
(create-community-channel!
channel
(js-messenger-response->community-id response))))
channel-list)
passthrough)
create-categories-fn (if (seq categories)
(map
(fn [category]
(fn [messenger-response]
(create-category! messenger-response category)))
categories)
passthrough)]
(as-> (create-community! community-name membership pin-message-allowed) $
(apply promesa/chain $ create-community-permissions-fn)
(apply promesa/chain $ create-channels-fn)
(apply promesa/chain $ create-categories-fn)
(promesa/then $ #(rf/dispatch [:hide-bottom-sheet]))
(promesa/catch $ #(log/error "failed to create community e2e" {:error %})))))
(rf/defn create-open-community
{:events [:fast-create-community/create-open-community]}
{:events [:e2e/create-open-community]}
[_]
{:json-rpc/call [{:method "wakuext_createOpenCommunity"
:params []
:js-response true
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
:on-error #(log/error "failed to create open community." {:error %})}]
:dispatch [:hide-bottom-sheet]})
(create-community-from-description (community-descriptions :open))
nil)
(rf/defn create-closed-community
{:events [:e2e/create-closed-community]}
[_]
(create-community-from-description (community-descriptions :closed))
nil)
(rf/defn create-token-gated-community
{:events [:fast-create-community/create-token-gated-community]}
{:events [:e2e/create-token-gated-community]}
[_]
{:json-rpc/call [{:method "wakuext_createTokenGatedCommunity"
:params []
:js-response true
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
:on-error #(log/error "failed to create token gated community." {:error %})}]
:dispatch [:hide-bottom-sheet]})
(create-community-from-description (community-descriptions :token-gated))
nil)
(rf/defn snt-admin-community
{:events [:e2e/create-snt-admin-community]}
[_]
(create-community-from-description (community-descriptions :snt-admin))
nil)
(rf/defn admin-and-member-community
{:events [:e2e/create-admin-and-member-community]}
[_]
(create-community-from-description (community-descriptions :admin-and-member))
nil)
-16
View File
@@ -38,22 +38,6 @@
:params []
:on-success [:stickers/stickers-recent-success]})))
(rf/defn load-packs
{:events [:stickers/load-packs]}
[{:keys [db]}]
{:json-rpc/call [{:method "stickers_market"
:params [(chain/chain-id db)]
:on-success #(re-frame/dispatch [:stickers/stickers-market-success %])}
{:method "stickers_installed"
:params []
:on-success #(re-frame/dispatch [:stickers/stickers-installed-success %])}
{:method "stickers_pending"
:params []
:on-success #(re-frame/dispatch [:stickers/stickers-pending-success %])}
{:method "stickers_recent"
:params []
:on-success #(re-frame/dispatch [:stickers/stickers-recent-success %])}]})
(rf/defn pending-pack
{:events [:stickers/pending-pack]}
[{db :db} id]
@@ -9,11 +9,10 @@
[quo.components.tags.status-tags :as status-tags]
[quo.foundations.colors :as colors]
[react-native.core :as rn]
[reagent.core :as reagent]
[utils.i18n :as i18n]))
(defn- activity-reply-text-input
[{:keys [on-update-reply max-reply-length valid-reply?]} reply-input]
[{:keys [on-update-reply max-reply-length valid-reply?]} reply-input set-reply-input]
[rn/view
[rn/view
{:style {:margin-top 16
@@ -26,12 +25,12 @@
(i18n/label :t/your-answer)]
[text/text
{:style {:flex-shrink 1
:color (if (valid-reply? @reply-input)
:color (if (valid-reply? reply-input)
colors/neutral-40
colors/danger-60)}}
(str (count @reply-input) "/" max-reply-length)]]
(str (count reply-input) "/" max-reply-length)]]
[input/input
{:on-change-text #(do (reset! reply-input %)
{:on-change-text #(do (set-reply-input %)
(when on-update-reply
(on-update-reply %)))
:auto-capitalize :none
@@ -136,7 +135,7 @@
(-> button
(assoc :size size)
(assoc :type subtype)
(assoc :disabled? (and replying? disable-when (disable-when @reply-input)))
(assoc :disabled? (and replying? disable-when (disable-when reply-input)))
(assoc :inner-style
{:justify-content :center
:padding-bottom 0
@@ -153,17 +152,16 @@
:blur? blur?}])
(defn- footer
[_]
(let [reply-input (reagent/atom "")]
(fn [{:keys [replying? items] :as props}]
[:<>
(when replying?
[activity-reply-text-input props reply-input])
(when items
[rn/view style/footer-container
(for [item items]
^{:key (:key item)}
[footer-item-view item replying? reply-input])])])))
[{:keys [replying? items] :as props}]
(let [[reply-input set-reply-input] (rn/use-state "")]
[:<>
(when replying?
[activity-reply-text-input props reply-input set-reply-input])
(when items
[rn/view style/footer-container
(for [item items]
^{:key (:key item)}
[footer-item-view item replying? reply-input])])]))
(defn view
[{:keys [icon
@@ -4,8 +4,7 @@
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[react-native.svg :as svg]
[reagent.core :as reagent]))
[react-native.svg :as svg]))
(defn- get-path-props
[size stroke-width rotation]
@@ -49,60 +48,53 @@
{:color {:dark colors/neutral-80-opa-40
:light colors/white-opa-40}})
(defn- circle-timer-internal
[{:keys [color duration size stroke-width trail-color rotation initial-remaining-time theme]}]
(let [rotation (or rotation :clockwise)
duration (or duration 4)
stroke-width (or stroke-width 1)
size (or size 9)
max-stroke-width (max stroke-width 0)
{:keys [path path-length]} (get-path-props size max-stroke-width rotation)
start-at (get-start-at duration initial-remaining-time)
elapsed-time (reagent/atom 0)
prev-frame-time (reagent/atom nil)
frame-request (reagent/atom nil)
display-time (reagent/atom start-at)
;; get elapsed frame time
swap-elapsed-time-each-frame (fn swap-elapsed-time-each-frame [frame-time]
(if (nil? @prev-frame-time)
(do (reset! prev-frame-time frame-time)
(reset! frame-request (js/requestAnimationFrame
swap-elapsed-time-each-frame)))
(let [delta (- (/ frame-time 1000)
(/ @prev-frame-time 1000))
current-elapsed (swap! elapsed-time + delta)
current-display-time (+ start-at current-elapsed)
completed? (>= current-display-time duration)]
(reset! display-time (if completed?
duration
current-display-time))
(when-not completed?
(reset! prev-frame-time frame-time)
(reset! frame-request (js/requestAnimationFrame
swap-elapsed-time-each-frame))))))]
(reagent/create-class
{:component-will-unmount #(js/cancelAnimationFrame @frame-request)
:reagent-render
(fn []
(reset! frame-request (js/requestAnimationFrame swap-elapsed-time-each-frame))
[rn/view
{:style {:position :relative
:width size
:height size}}
[svg/svg
{:view-box (str "0 0 " size " " size)
:width size
:height size}
[svg/path
{:d path :fill :none :stroke (or trail-color :transparent) :stroke-width stroke-width}]
(when-not (= @display-time duration)
[svg/path
{:d path
:fill :none
:stroke (or color (get-in themes [:color theme]))
:stroke-linecap :square
:stroke-width stroke-width
:stroke-dasharray path-length
:stroke-dashoffset (linear-ease @display-time 0 path-length duration)}])]])})))
(def circle-timer (quo.theme/with-theme circle-timer-internal))
(defn circle-timer
[{:keys [color duration size stroke-width trail-color rotation initial-remaining-time]}]
(let [theme (quo.theme/use-theme-value)
rotation (or rotation :clockwise)
duration (or duration 4)
stroke-width (or stroke-width 1)
size (or size 9)
max-stroke-width (max stroke-width 0)
{:keys [path path-length]} (get-path-props size max-stroke-width rotation)
start-at (get-start-at duration initial-remaining-time)
elapsed-time (rn/use-ref-atom 0)
prev-frame-time (rn/use-ref-atom nil)
frame-request (rn/use-ref-atom nil)
[display-time set-display-time] (rn/use-state start-at)
swap-elapsed-time-each-frame (fn swap-elapsed-time-each-frame [frame-time]
(if (nil? @prev-frame-time)
(do (reset! prev-frame-time frame-time)
(reset! frame-request (js/requestAnimationFrame
swap-elapsed-time-each-frame)))
(let [delta (- (/ frame-time 1000)
(/ @prev-frame-time 1000))
current-elapsed (swap! elapsed-time + delta)
current-display-time (+ start-at current-elapsed)
completed? (>= current-display-time
duration)]
(set-display-time
(if completed? duration current-display-time))
(when-not completed?
(reset! prev-frame-time frame-time)))))]
(rn/use-effect #(reset! frame-request (js/requestAnimationFrame swap-elapsed-time-each-frame)))
(rn/use-unmount #(js/cancelAnimationFrame @frame-request))
[rn/view
{:style {:position :relative
:width size
:height size}}
[svg/svg
{:view-box (str "0 0 " size " " size)
:width size
:height size}
[svg/path
{:d path :fill :none :stroke (or trail-color :transparent) :stroke-width stroke-width}]
(when-not (= display-time duration)
[svg/path
{:d path
:fill :none
:stroke (or color (get-in themes [:color theme]))
:stroke-linecap :square
:stroke-width stroke-width
:stroke-dasharray path-length
:stroke-dashoffset (linear-ease display-time 0 path-length duration)}])]]))
@@ -15,10 +15,10 @@
[rn/touchable-highlight
{:on-press on-press
:underlay-color :transparent}
[into
(into
[rn/view
{:style (merge (style/action-container theme) style)}]
children]])
children)])
(defn toast-undo-action-internal
[{:keys [undo-duration undo-on-press theme]}]
+16 -19
View File
@@ -3,23 +3,20 @@
[quo.components.icon :as icon]
[quo.components.selectors.filter.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[reagent.core :as reagent]))
[react-native.core :as rn]))
(defn view-internal
[initial-props]
(let [pressed? (reagent/atom (:pressed? initial-props))]
(fn [{:keys [blur? customization-color theme on-press-out]}]
[rn/touchable-without-feedback
{:accessibility-label :selector-filter
:on-press-out (fn []
(swap! pressed? not)
(when on-press-out
(on-press-out @pressed?)))}
[rn/view {:style (style/container-outer customization-color @pressed? theme)}
[rn/view {:style (style/container-inner @pressed? blur? theme)}
[icon/icon :i/unread
{:color (style/icon-color @pressed? theme)
:size 20}]]]])))
(def view (quo.theme/with-theme view-internal))
(defn view
[{:keys [blur? customization-color on-press-out pressed?]}]
(let [theme (quo.theme/use-theme-value)
[pressed? set-pressed] (rn/use-state pressed?)
on-press-out (fn []
(set-pressed (not pressed?))
(when on-press-out (on-press-out pressed?)))]
[rn/touchable-without-feedback
{:accessibility-label :selector-filter
:on-press-out on-press-out}
[rn/view {:style (style/container-outer customization-color pressed? theme)}
[rn/view {:style (style/container-inner pressed? blur? theme)}
[icon/icon :i/unread
{:color (style/icon-color pressed? theme)
:size 20}]]]]))
@@ -2,23 +2,20 @@
(:require
[quo.components.selectors.reaction-resource :as reactions.resource]
[quo.components.selectors.reactions-selector.style :as style]
[react-native.core :as rn]
[reagent.core :as reagent]))
[react-native.core :as rn]))
(defn view
[{:keys [start-pressed?]}]
(let [pressed? (reagent/atom start-pressed?)]
(fn [{:keys [emoji container-style on-press
accessibility-label]
:or {accessibility-label :reaction}}]
[rn/pressable
{:accessibility-label accessibility-label
:allow-multiple-presses? true
:style (merge (style/container @pressed?)
container-style)
:on-press (fn [e]
(swap! pressed? not)
(when on-press
(on-press e)))}
[rn/text
(reactions.resource/system-emojis emoji)]])))
[{:keys [emoji container-style on-press
accessibility-label start-pressed?]
:or {accessibility-label :reaction}}]
(let [[pressed? set-pressed] (rn/use-state start-pressed?)
on-press (fn [e]
(set-pressed (not pressed?))
(when on-press (on-press e)))]
[rn/pressable
{:accessibility-label accessibility-label
:allow-multiple-presses? true
:style (merge (style/container pressed?)
container-style)
:on-press on-press}
[rn/text (reactions.resource/system-emojis emoji)]]))
@@ -3,47 +3,47 @@
[quo.components.icon :as icons]
[quo.components.selectors.selectors.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[reagent.core :as reagent]))
(defn- handle-press
[on-change checked-atom checked?]
(when checked-atom (swap! checked-atom not))
(when on-change (on-change (not checked?))))
[react-native.core :as rn]))
(defn- base-selector
[{:keys [default-checked? checked?]}]
(let [controlled-component? (some? checked?)
internal-checked? (when-not controlled-component?
(reagent/atom (or default-checked? false)))]
(fn [{:keys [checked? disabled? blur? customization-color on-change container-style
label-prefix outer-style-fn inner-style-fn icon-style-fn theme]
:or {customization-color :blue}}]
(let [actual-checked? (if controlled-component? checked? @internal-checked?)
accessibility-label (str label-prefix "-" (if actual-checked? "on" "off"))
test-id (str label-prefix "-component")
outer-styles (outer-style-fn {:checked? actual-checked?
[{:keys [default-checked? checked? disabled? blur? customization-color on-change container-style
label-prefix outer-style-fn inner-style-fn icon-style-fn theme]
:or {customization-color :blue}}]
(let [controlled-component? (some? checked?)
[internal-checked?
set-internal-checked?] (rn/use-state (when-not controlled-component?
(or default-checked? false)))
actual-checked? (if controlled-component? checked? internal-checked?)
accessibility-label (str label-prefix "-" (if actual-checked? "on" "off"))
test-id (str label-prefix "-component")
outer-styles (outer-style-fn {:checked? actual-checked?
:disabled? disabled?
:blur? blur?
:container-style container-style
:customization-color customization-color
:theme theme})]
[rn/pressable
(when-not disabled?
{:on-press #(handle-press on-change internal-checked? actual-checked?)
:allow-multiple-presses? true})
[rn/view
{:style outer-styles
:needs-offscreen-alpha-compositing true
:accessibility-label accessibility-label
:testID test-id}
[rn/view
{:style (inner-style-fn {:theme theme
:checked? actual-checked?
:blur? blur?
:customization-color customization-color})}
(when (and icon-style-fn actual-checked?)
[icons/icon :i/check-small (icon-style-fn actual-checked? blur? theme)])]]]))))
:theme theme})
on-press (rn/use-callback
(fn []
(when-not (nil? internal-checked?)
(set-internal-checked? (not internal-checked?)))
(when on-change (on-change (not actual-checked?))))
[internal-checked? actual-checked? on-change])]
[rn/pressable
(when-not disabled?
{:on-press on-press
:allow-multiple-presses? true})
[rn/view
{:style outer-styles
:needs-offscreen-alpha-compositing true
:accessibility-label accessibility-label
:testID test-id}
[rn/view
{:style (inner-style-fn {:theme theme
:checked? actual-checked?
:blur? blur?
:customization-color customization-color})}
(when (and icon-style-fn actual-checked?)
[icons/icon :i/check-small (icon-style-fn actual-checked? blur? theme)])]]]))
(defn- toggle
[props]
@@ -8,7 +8,6 @@
[:options {:optional true} [:maybe [:enum :add :hold]]]
[:size {:optional true} [:maybe [:enum :size-24 :size-32]]]
[:blur? {:optional true} [:maybe :boolean]]
[:theme :schema.common/theme]
[:collectible-img-src :schema.common/image-source]
[:collectible-name :string]
[:collectible-id :string]]]]
@@ -8,52 +8,49 @@
[quo.theme]
[react-native.core :as rn]
[react-native.hole-view :as hole-view]
[reagent.core :as reagent]
[schema.core :as schema]))
(defn- view-internal
[]
(let [container-width (reagent/atom 0)
on-layout #(->> (oops/oget % :nativeEvent :layout :width)
(reset! container-width))]
(fn [{:keys [options blur? theme collectible-img-src collectible-name collectible-id] :as props}]
(let [size (or (:size props) :size-24)]
[rn/view
{:on-layout on-layout}
[hole-view/hole-view
{:holes (if options
[{:x (- @container-width
(case size
:size-24 10
:size-32 12
nil))
:y (case size
:size-24 -6
:size-32 -4
nil)
:width 16
:height 16
:borderRadius 8}]
[])}
[rn/view {:style (style/container size options blur? theme)}
[rn/image {:style (style/collectible-img size) :source collectible-img-src}]
[text/text
{:size :paragraph-2
:weight :medium
:style (style/label theme)}
collectible-name]
[text/text
{:size :paragraph-2
:weight :medium
:margin-left 5
:style (style/label theme)}
collectible-id]]]
(when options
[rn/view {:style (style/options-icon size)}
[icons/icon (if (= options :hold) :i/hold :i/add-token)
{:size 20
:no-color true}]])]))))
[{:keys [options blur? collectible-img-src collectible-name collectible-id] :as props}]
(let [theme (quo.theme/use-theme-value)
[container-width
set-container-width] (rn/use-state 0)
on-layout (rn/use-callback
#(set-container-width (oops/oget % :nativeEvent :layout :width)))
size (or (:size props) :size-24)]
[rn/view {:on-layout on-layout}
[hole-view/hole-view
{:holes (if options
[{:x (- container-width
(case size
:size-24 10
:size-32 12
nil))
:y (case size
:size-24 -6
:size-32 -4
nil)
:width 16
:height 16
:borderRadius 8}]
[])}
[rn/view {:style (style/container size options blur? theme)}
[rn/image {:style (style/collectible-img size) :source collectible-img-src}]
[text/text
{:size :paragraph-2
:weight :medium
:style (style/label theme)}
collectible-name]
[text/text
{:size :paragraph-2
:weight :medium
:margin-left 5
:style (style/label theme)}
collectible-id]]]
(when options
[rn/view {:style (style/options-icon size)}
[icons/icon (if (= options :hold) :i/hold :i/add-token)
{:size 20
:no-color true}]])]))
(def view
(quo.theme/with-theme
(schema/instrument #'view-internal component-schema/?schema)))
(def view (schema/instrument #'view-internal component-schema/?schema))
+118 -115
View File
@@ -50,128 +50,131 @@
- `fade-end-percentage` Percentage where fading starts relative to the total
layout width of the `flat-list` data."
[{:keys [default-active fade-end-percentage]
:or {fade-end-percentage 0.8}}]
(let [active-tab-id (reagent/atom default-active)
fading (reagent/atom {:fade-end-percentage fade-end-percentage})
flat-list-ref (atom nil)]
(fn
[{:keys [data
fade-end-percentage
fade-end?
on-change
on-scroll
scroll-event-throttle
scrollable?
scroll-on-press?
size
type
labelled?
disabled?
blurred?
icon-color]
:or {fade-end-percentage fade-end-percentage
fade-end? false
scroll-event-throttle 64
scrollable? false
scroll-on-press? false
size default-tab-size}
:as props}]
(let [maybe-mask-wrapper (if fade-end?
[{:keys [default-active data fade-end-percentage fade-end? on-change on-scroll scroll-event-throttle
scrollable?
scroll-on-press? size type labelled? disabled? blurred? icon-color]
:or {fade-end-percentage 0.8
fade-end? false
scroll-event-throttle 64
scrollable? false
scroll-on-press? false
size default-tab-size}
:as props}]
(let [[active-tab-id
set-active-tab-id] (rn/use-state default-active)
[fading set-fading] (rn/use-state {:fade-end-percentage fade-end-percentage})
flat-list-ref (rn/use-ref-atom nil)
maybe-mask-wrapper (rn/use-memo
(fn []
(if fade-end?
[masked-view/masked-view
{:mask-element (reagent/as-element
[linear-gradient/linear-gradient
{:colors [:black :transparent]
:locations [(get @fading :fade-end-percentage)
:locations [(get fading :fade-end-percentage)
1]
:start {:x 0 :y 0}
:end {:x 1 :y 0}
:pointer-events :none
:style {:width "100%"
:height "100%"}}])}]
[:<>])]
(if scrollable?
(conj
maybe-mask-wrapper
[rn/flat-list
(merge
(dissoc props
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= @active-tab-id (:id %)) data)})
{:ref #(reset! flat-list-ref %)
:extra-data (str @active-tab-id)
:horizontal true
:scroll-event-throttle scroll-event-throttle
:shows-horizontal-scroll-indicator false
:data data
:key-fn (comp str :id)
:on-scroll (fn [^js e]
(when fade-end?
(let [offset-x (oget e "nativeEvent.contentOffset.x")
content-width (oget e "nativeEvent.contentSize.width")
layout-width (oget e "nativeEvent.layoutMeasurement.width")
new-percentage (calculate-fade-end-percentage
{:offset-x offset-x
:content-width content-width
:layout-width layout-width
:max-fade-percentage fade-end-percentage})]
;; Avoid unnecessary re-rendering.
(when (not= new-percentage (get @fading :fade-end-percentage))
(swap! fading assoc :fade-end-percentage new-percentage))))
(when on-scroll
(on-scroll e)))
:render-fn (fn [{:keys [id label resource]} index]
[rn/view
{:style {:margin-right (if (= size default-tab-size) 12 8)
:padding-right (when (= index (dec (count data)))
(get-in props [:style :padding-left]))}}
[tag/tag
{:id id
:size size
:active (= id @active-tab-id)
:resource resource
:blurred? blurred?
:icon-color icon-color
:disabled? disabled?
:label (if labelled?
label
(when (= type :label) label))
:type type
:labelled? labelled?
:on-press (fn [id]
(reset! active-tab-id id)
(when scroll-on-press?
(.scrollToIndex ^js @flat-list-ref
#js
{:animated true
:index index
:viewPosition 0.5}))
(when on-change
(on-change id)))}]])})])
[rn/view {:style {:flex-direction :row}}
(for [{:keys [id label resource]} data]
^{:key id}
[rn/view {:style {:margin-right 8}}
[tag/tag
(merge {:id id
:size size
:type type
:label (if labelled?
label
(when (= type :label) label))
:active (= id active-tab-id)
:disabled? disabled?
:blurred? blurred?
:icon-color icon-color
:labelled? (if (= type :label) true labelled?)
:resource (if (= type :icon)
:i/placeholder
resource)
:on-press #(do (reset! active-tab-id %)
(when on-change (on-change %)))})]])])))))
[:<>]))
[fade-end? fading])
on-scroll (rn/use-context
(fn [^js e]
(when fade-end?
(let [offset-x (oget e "nativeEvent.contentOffset.x")
content-width (oget e "nativeEvent.contentSize.width")
layout-width (oget e "nativeEvent.layoutMeasurement.width")
new-percentage (calculate-fade-end-percentage
{:offset-x offset-x
:content-width content-width
:layout-width layout-width
:max-fade-percentage fade-end-percentage})]
;; Avoid unnecessary re-rendering.
(when (not= new-percentage (get fading :fade-end-percentage))
(set-fading (assoc fading :fade-end-percentage new-percentage)))))
(when on-scroll
(on-scroll e)))
[fade-end? fading fade-end-percentage])
data-count (count data)
style-padding-left (get-in props [:style :padding-left])
render-fn (rn/use-callback
(fn [{:keys [id label resource]} index]
[rn/view
{:style {:margin-right (if (= size default-tab-size) 12 8)
:padding-right (when (= index (dec data-count))
style-padding-left)}}
[tag/tag
{:id id
:size size
:active (= id active-tab-id)
:resource resource
:blurred? blurred?
:icon-color icon-color
:disabled? disabled?
:label (if labelled?
label
(when (= type :label) label))
:type type
:labelled? labelled?
:on-press (fn [id]
(set-active-tab-id id)
(when scroll-on-press?
(.scrollToIndex ^js @flat-list-ref
#js
{:animated true
:index index
:viewPosition 0.5}))
(when on-change
(on-change id)))}]])
[size default-tab-size data-count style-padding-left active-tab-id blurred?
icon-color disabled? labelled? type scroll-on-press? on-change])
on-press (rn/use-callback #(do (set-active-tab-id %) (when on-change (on-change %)))
[on-change])
key-fn (rn/use-callback (comp str :id))
ref (rn/use-callback #(reset! flat-list-ref %))
clean-props (dissoc props
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)]
(if scrollable?
(conj
maybe-mask-wrapper
[rn/flat-list
(merge
clean-props
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= active-tab-id (:id %)) data)})
{:ref ref
:extra-data (str active-tab-id)
:horizontal true
:scroll-event-throttle scroll-event-throttle
:shows-horizontal-scroll-indicator false
:data data
:key-fn key-fn
:on-scroll on-scroll
:render-fn render-fn})])
[rn/view {:style {:flex-direction :row}}
(for [{:keys [id label resource]} data]
^{:key id}
[rn/view {:style {:margin-right 8}}
[tag/tag
{:id id
:size size
:type type
:label (if labelled?
label
(when (= type :label) label))
:active (= id active-tab-id)
:disabled? disabled?
:blurred? blurred?
:icon-color icon-color
:labelled? (if (= type :label) true labelled?)
:resource (if (= type :icon) :i/placeholder resource)
:on-press on-press}]])])))
+43 -45
View File
@@ -7,10 +7,9 @@
[quo.components.utilities.token.view :as token]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[react-native.hole-view :as hole-view]
[reagent.core :as reagent]))
[react-native.hole-view :as hole-view]))
(defn- view-internal
(defn view
"Options:
- :options - false / :add / :hold (default false)
- :size - :size-24 / :size-32 (default :size-24)
@@ -18,45 +17,44 @@
- :theme - :light / :dark
- :token-value - string - token value
- :token-symbol - string"
[]
(let [container-width (reagent/atom 0)]
(fn [{:keys [options size blur? theme token-value token-img-src token-symbol]
:or {size :size-24}}]
[rn/view
{:on-layout #(reset! container-width
(oget % :nativeEvent :layout :width))}
[hole-view/hole-view
{:holes (if options
[{:x (- @container-width
(case size
:size-24 10
:size-32 12
nil))
:y (case size
:size-24 -6
:size-32 -4
nil)
:width 16
:height 16
:borderRadius 8}]
[])}
[rn/view {:style (style/container size options blur? theme)}
[token/view
{:style (style/token-img size)
:token token-symbol
:size (case size
:size-24 :size-20
:size-32 :size-28)
:image-source token-img-src}]
[text/text
{:size :paragraph-2
:weight :medium
:style (style/label theme)}
(str token-value " " token-symbol)]]]
(when options
[rn/view {:style (style/options-icon size)}
[icons/icon (if (= options :hold) :i/hold :i/add-token)
{:size 20
:no-color true}]])])))
(def view (quo.theme/with-theme view-internal))
[{:keys [options size blur? token-value token-img-src token-symbol]
:or {size :size-24}}]
(let [theme (quo.theme/use-theme-value)
[container-width
set-container-width] (rn/use-state 0)
on-layout (rn/use-callback #(set-container-width
(oget % :nativeEvent :layout :width)))]
[rn/view {:on-layout on-layout}
[hole-view/hole-view
{:holes (if options
[{:x (- container-width
(case size
:size-24 10
:size-32 12
nil))
:y (case size
:size-24 -6
:size-32 -4
nil)
:width 16
:height 16
:borderRadius 8}]
[])}
[rn/view {:style (style/container size options blur? theme)}
[token/view
{:style (style/token-img size)
:token token-symbol
:size (case size
:size-24 :size-20
:size-32 :size-28)
:image-source token-img-src}]
[text/text
{:size :paragraph-2
:weight :medium
:style (style/label theme)}
(str token-value " " token-symbol)]]]
(when options
[rn/view {:style (style/options-icon size)}
[icons/icon (if (= options :hold) :i/hold :i/add-token)
{:size 20
:no-color true}]])]))
+18 -16
View File
@@ -2,6 +2,7 @@
(:require
[clojure.string :as string]
[native-module.core :as native-module]
[promesa.core :as promesa]
[re-frame.core :as re-frame]
[react-native.background-timer :as background-timer]
[taoensso.timbre :as log]
@@ -30,6 +31,14 @@
updated-delay)))
on-error))
(defn- handle-rpc-response
[callback deferred promise-resolution-fn result]
(when callback
(if (vector? callback)
(rf/dispatch (conj callback result))
(callback result)))
(promise-resolution-fn deferred result))
(defn call
"Call private RPC endpoint.
@@ -57,7 +66,8 @@
will be used.
"
[{:keys [method params on-success on-error js-response] :as arg}]
(let [params (or params [])
(let [deferred (promesa/deferred)
params (or params [])
on-error (or on-error
(on-error-retry call arg)
#(log/warn :json-rpc/error method :error % :params params))]
@@ -68,23 +78,15 @@
:params params})
(fn [raw-response]
(if (string/blank? raw-response)
(let [error {:message "Blank response"}]
(if (vector? on-error)
(rf/dispatch (conj on-error error))
(on-error error)))
(handle-rpc-response on-error deferred promesa/reject! {:message "Blank response"})
(let [^js response-js (transforms/json->js raw-response)]
(if-let [error (.-error response-js)]
(let [error (transforms/js->clj error)]
(if (vector? on-error)
(rf/dispatch (conj on-error error))
(on-error error)))
(when on-success
(let [result (if js-response
(.-result response-js)
(transforms/js->clj (.-result response-js)))]
(if (vector? on-success)
(rf/dispatch (conj on-success result))
(on-success result)))))))))))
(handle-rpc-response on-error deferred promesa/reject! (transforms/js->clj error))
(let [result (if js-response
(.-result response-js)
(transforms/js->clj (.-result response-js)))]
(handle-rpc-response on-success deferred promesa/resolve! result)))))))
deferred))
(re-frame/reg-fx
:json-rpc/call
+1 -1
View File
@@ -61,4 +61,4 @@
(->> (rf/sub [:toasts])
:ordered
(into [rn/view {:style (style/outmost-transparent-container)}]
(map #(with-meta [:f> f-container %] {:key %})))))
(map #(with-meta [f-container %] {:key %})))))
+1
View File
@@ -59,6 +59,7 @@
(def swap-enabled? (enabled? (get-config :SWAP_ENABLED "0")))
(def stickers-test-enabled? (enabled? (get-config :STICKERS_TEST_ENABLED "0")))
(def local-pairing-mode-enabled? (enabled? (get-config :LOCAL_PAIRING_ENABLED "1")))
(def show-not-implemented-features? (enabled? (get-config :SHOW_NOT_IMPLEMENTED_FEATURES "0")))
;; CONFIG VALUES
(def log-level (string/upper-case (get-config :LOG_LEVEL "")))
+5
View File
@@ -71,6 +71,9 @@
(def ^:const timeline-chat-type 5)
(def ^:const community-chat-type 6)
(def ^:const community-permissions-auto-accept 1)
(def ^:const community-permissions-manual-accept 3)
(def ^:const contact-request-message-state-none 0)
(def ^:const contact-request-message-state-pending 1)
(def ^:const contact-request-message-state-accepted 2)
@@ -168,6 +171,8 @@
(def ^:const community-token-type-erc20 1)
(def ^:const community-token-type-erc721 2)
(def ^:const sepolia-stt-contract-address "0xe452027cdef746c7cd3db31cb700428b16cd8e51")
;; Community rules for joining
(def ^:const community-rule-ens-only "ens-only")
@@ -112,12 +112,14 @@
(defn actions
[{:keys [locked? chat-id community-id]} inside-chat? hide-view-members?]
(let [{:keys [muted muted-till chat-type]} (rf/sub [:chats/chat-by-id chat-id])]
(let [{:keys [muted muted-till chat-type]} (rf/sub [:chats/chat-by-id chat-id])
{:keys [token-gated?]} (rf/sub [:chats/community-chat-by-id community-id chat-id])]
(cond
locked?
[quo/action-drawer
[[(action-invite-people)
(action-token-requirements)
(when token-gated?
(action-token-requirements))
(action-qr-code chat-id)
(action-share chat-id)]]]
@@ -135,7 +137,8 @@
(and inside-chat? (not locked?))
[quo/action-drawer
[[(action-view-members-and-details community-id chat-id)
(action-token-requirements)
(when token-gated?
(action-token-requirements))
(action-mark-as-read)
(action-toggle-muted chat-id muted muted-till chat-type)
(action-notification-settings)
@@ -23,7 +23,7 @@
(h/test "joined options - Token Gated"
(h/setup-subs {:communities/my-pending-request-to-join nil
:communities/community {:joined true
:token-permissions []}})
:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/view-members))
(h/is-truthy (h/get-by-translation-text :t/view-community-rules))
@@ -52,7 +52,7 @@
(h/test "admin options - Token Gated"
(h/setup-subs {:communities/my-pending-request-to-join nil
:communities/community {:admin true
:token-permissions []}})
:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/view-members))
(h/is-truthy (h/get-by-translation-text :t/view-community-rules))
@@ -76,7 +76,7 @@
(h/test "request sent options - Token Gated"
(h/setup-subs {:communities/my-pending-request-to-join "mock-id"
:communities/community {:token-permissions []}})
:communities/community {:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts))
(h/is-truthy (h/get-by-translation-text :t/view-token-gating))
@@ -97,7 +97,7 @@
(h/test "banned options - Token Gated"
(h/setup-subs {:communities/my-pending-request-to-join nil
:communities/community {:banList 100
:token-permissions []}})
:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts))
(h/is-truthy (h/get-by-translation-text :t/view-token-gating))
@@ -107,7 +107,7 @@
(h/test "banned options - Token Gated"
(h/setup-subs {:communities/my-pending-request-to-join nil
:communities/community {:banList 100
:token-permissions []}})
:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts))
(h/is-truthy (h/get-by-translation-text :t/view-token-gating))
@@ -118,6 +118,6 @@
(h/setup-subs {:communities/my-pending-request-to-join nil
:communities/community {:joined true
:muted true
:token-permissions []}})
:role-permissions? true}})
(h/render [options/community-options-bottom-sheet {:id "test"}])
(h/is-truthy (h/get-by-translation-text :t/unmute-community))))
@@ -180,16 +180,16 @@
(defn get-context-drawers
[{:keys [id]}]
(let [{:keys [token-permissions admin joined
(let [{:keys [role-permissions? admin joined
muted banList muted-till color
intro-message]} (rf/sub [:communities/community id])
request-id (rf/sub [:communities/my-pending-request-to-join id])]
(cond
admin (owner-options id token-permissions muted muted-till intro-message)
joined (joined-options id token-permissions muted muted-till color intro-message)
request-id (join-request-sent-options id token-permissions request-id intro-message)
banList (banned-options id token-permissions intro-message)
:else (not-joined-options id token-permissions request-id intro-message))))
admin (owner-options id role-permissions? muted muted-till intro-message)
joined (joined-options id role-permissions? muted muted-till color intro-message)
request-id (join-request-sent-options id role-permissions? request-id intro-message)
banList (banned-options id role-permissions? intro-message)
:else (not-joined-options id role-permissions? request-id intro-message))))
(defn community-options-bottom-sheet
[id]
@@ -7,15 +7,22 @@
[]
[quo/action-drawer
[[{:icon :i/communities
:accessibility-label :create-closed-community
:label "Create closed community (only for testing)"
:on-press #(rf/dispatch [:fast-create-community/create-closed-community])}
{:icon :i/communities
:accessibility-label :create-open-community
:label "Create open community (only for testing)"
:on-press #(rf/dispatch [:fast-create-community/create-open-community])}
:label "Create Open community (only for testing)"
:on-press #(rf/dispatch [:e2e/create-open-community])}
{:icon :i/communities
:accessibility-label :create-closed-community
:label "Create Closed community (only for testing)"
:on-press #(rf/dispatch [:e2e/create-closed-community])}
{:icon :i/communities
:accessibility-label :create-admin-and-member-community
:label "Create Admin and Member community (only for testing)"
:on-press #(rf/dispatch [:e2e/create-admin-and-member-community])}
{:icon :i/communities
:accessibility-label :create-snt-admin-community
:label "Create SNT Admin community (only for testing)"
:on-press #(rf/dispatch [:e2e/create-snt-admin-community])}
{:icon :i/communities
:accessibility-label :create-token-gated-community
:label "Create token-gated community (only for testing)"
:on-press #(rf/dispatch
[:fast-create-community/create-token-gated-community])}]]])
:label "Create Token Gated community (only for testing)"
:on-press #(rf/dispatch [:e2e/create-token-gated-community])}]]])
@@ -2,6 +2,7 @@
(:require [legacy.status-im.utils.core :as utils]
[quo.foundations.colors :as colors]
[status-im.common.not-implemented :as not-implemented]
[status-im.config :as config]
[status-im.contexts.profile.edit.style :as style]
[status-im.contexts.profile.utils :as profile.utils]
[utils.i18n :as i18n]
@@ -36,31 +37,33 @@
:action :arrow
:container-style style/item-container}]}
{:label (i18n/label :t/showcase)
:items [{:title (i18n/label :t/communities)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/accounts)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/collectibles)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/assets)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}]}
(when config/show-not-implemented-features?
{:label (i18n/label :t/showcase)
:items [{:title (i18n/label :t/communities)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/accounts)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/collectibles)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}
{:title (i18n/label :t/assets)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}]})
{:label (i18n/label :t/on-the-web)
:items [{:title (i18n/label :t/links)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}]}]))
(when config/show-not-implemented-features?
{:label (i18n/label :t/on-the-web)
:items [{:title (i18n/label :t/links)
:on-press not-implemented/alert
:blur? true
:action :arrow
:container-style style/item-container}]})]))
@@ -4,6 +4,7 @@
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im.common.not-implemented :as not-implemented]
[status-im.config :as config]
[status-im.contexts.profile.edit.header.view :as header]
[status-im.contexts.profile.edit.list-items :as edit.items]
[status-im.contexts.profile.edit.style :as style]
@@ -33,7 +34,8 @@
:background :blur
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back])
:right-side [{:icon-name :i/reveal :on-press not-implemented/alert}]}]
:right-side (when config/show-not-implemented-features?
[{:icon-name :i/reveal :on-press not-implemented/alert}])}]
[rn/flat-list
{:key :list
:header [header/view]
@@ -9,7 +9,6 @@
status-im.contexts.profile.login.effects
[status-im.contexts.profile.rpc :as profile.rpc]
[taoensso.timbre :as log]
[utils.ethereum.chain :as chain]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.security.core :as security]))
@@ -87,18 +86,14 @@
;; login phase 2: we want to load and show chats faster, so we split login into 2 phases
(rf/reg-event-fx :profile.login/get-chats-callback
(fn [{:keys [db]}]
(let [{:networks/keys [current-network networks]} db
{:keys [notifications-enabled? key-uid
preview-privacy?]} (:profile/profile db)
network-id (str (get-in networks
[current-network :config :NetworkId]))]
(let [{:keys [notifications-enabled? key-uid
preview-privacy?]} (:profile/profile db)]
{:db db
:fx [[:json-rpc/call
[{:method "wakuext_startMessenger"
:on-success [:profile.login/messenger-started]
:on-error #(log/error
"failed to start messenger")}]]
[:check-eip1559-activation {:network-id network-id}]
[:effects.profile/enable-local-notifications]
[:contacts/initialize-contacts]
[:browser/initialize-browser]
@@ -116,8 +111,7 @@
(rf/reg-event-fx :profile.login/messenger-started
(fn [{:keys [db]} [{:keys [mailservers]}]]
(let [chain-id (chain/chain-id db)
new-account? (get db :onboarding/new-account?)]
(let [new-account? (get db :onboarding/new-account?)]
{:db (-> db
(assoc :messenger/started? true)
(mailserver/add-mailservers mailservers))
@@ -126,7 +120,6 @@
:on-success [:profile.login/node-info-fetched]
:on-error #(log/error "node-info: failed error" %)}]]
[:pairing/get-our-installations]
[:stickers/load-packs chain-id]
(when-not new-account?
[:dispatch [:universal-links/process-stored-event]])]})))
@@ -17,36 +17,41 @@
:image :icon
:blur? true
:action :arrow}]
[{:title (i18n/label :t/messages)
:on-press not-implemented/alert
:image-props :i/messages
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/wallet)
:on-press not-implemented/alert
:image-props :i/wallet
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/dapps)
:on-press not-implemented/alert
:image-props :i/placeholder
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/browser)
:on-press not-implemented/alert
:image-props :i/browser
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/keycard)
:on-press not-implemented/alert
:image-props :i/keycard
:image :icon
:blur? true
:action :arrow}]
[(when config/show-not-implemented-features?
{:title (i18n/label :t/messages)
:on-press not-implemented/alert
:image-props :i/messages
:image :icon
:blur? true
:action :arrow})
(when config/show-not-implemented-features?
{:title (i18n/label :t/wallet)
:on-press not-implemented/alert
:image-props :i/wallet
:image :icon
:blur? true
:action :arrow})
(when config/show-not-implemented-features?
{:title (i18n/label :t/dapps)
:on-press not-implemented/alert
:image-props :i/placeholder
:image :icon
:blur? true
:action :arrow})
(when config/show-not-implemented-features?
{:title (i18n/label :t/browser)
:on-press not-implemented/alert
:image-props :i/browser
:image :icon
:blur? true
:action :arrow})
(when config/show-not-implemented-features?
{:title (i18n/label :t/keycard)
:on-press not-implemented/alert
:image-props :i/keycard
:image :icon
:blur? true
:action :arrow})]
[{:title (i18n/label :t/syncing)
:on-press #(rf/dispatch [:open-modal :settings-syncing])
:image-props :i/syncing
@@ -65,18 +70,20 @@
:image :icon
:blur? true
:action :arrow}
{:title (i18n/label :t/language-and-currency)
:on-press not-implemented/alert
:image-props :i/globe
:image :icon
:blur? true
:action :arrow}]
[{:title (i18n/label :t/data-usage)
:on-press not-implemented/alert
:image-props :i/mobile
:image :icon
:blur? true
:action :arrow}
(when config/show-not-implemented-features?
{:title (i18n/label :t/language-and-currency)
:on-press not-implemented/alert
:image-props :i/globe
:image :icon
:blur? true
:action :arrow})]
[(when config/show-not-implemented-features?
{:title (i18n/label :t/data-usage)
:on-press not-implemented/alert
:image-props :i/mobile
:image :icon
:blur? true
:action :arrow})
{:title (i18n/label :t/advanced)
:on-press #(rf/dispatch [:open-modal :advanced-settings])
:image-props :i/settings
@@ -105,8 +112,8 @@
:blur? true
:image-props :i/light})]
[{:title (i18n/label :t/about)
:on-press not-implemented/alert
:on-press #(rf/dispatch [:open-modal :about-app])
:action :arrow}
{:title (i18n/label :t/status-help)
:on-press not-implemented/alert
:on-press #(rf/dispatch [:open-modal :help-center])
:action :arrow}]])
@@ -454,10 +454,10 @@
(re-frame/reg-fx :activity-center/update-seen-state
(fn []
(json-rpc/call [{:method "wakuext_hasUnseenActivityCenterNotifications"
:params []
:on-success [:activity-center/update-seen-state-success]
:on-error [:activity-center/update-seen-state-error]}])))
(json-rpc/call {:method "wakuext_hasUnseenActivityCenterNotifications"
:params []
:on-success [:activity-center/update-seen-state-success]
:on-error [:activity-center/update-seen-state-error]})))
(rf/defn update-seen-state-success
{:events [:activity-center/update-seen-state-success]}
@@ -60,7 +60,7 @@
(def empty-cards (repeat 6 {:type shell.constants/empty-card}))
(defn jump-to-list
[switcher-cards shell-margin]
[switcher-cards]
(let [data (if (seq switcher-cards) switcher-cards empty-cards)]
[:<>
[rn/flat-list
@@ -70,7 +70,7 @@
:header (jump-to-text)
:ref #(reset! state/jump-to-list-ref %)
:num-columns 2
:column-wrapper-style {:margin-horizontal shell-margin
:column-wrapper-style {:margin-horizontal 20
:justify-content :space-between
:margin-bottom 16}
:style style/jump-to-list
@@ -89,9 +89,7 @@
(defn view
[]
(let [switcher-cards (rf/sub [:shell/sorted-switcher-cards])
width (rf/sub [:dimensions/window-width])
top (safe-area/get-top)
shell-margin (/ (- width (* 2 shell.constants/switcher-card-size)) 3)]
top (safe-area/get-top)]
[theme/provider {:theme :dark}
[rn/view
{:style {:top 0
@@ -100,7 +98,7 @@
:bottom -1
:position :absolute
:background-color colors/neutral-100}}
[jump-to-list switcher-cards shell-margin]
[jump-to-list switcher-cards]
[top-nav-blur-overlay top]
[common.top-nav/view
{:jump-to? true
@@ -12,22 +12,23 @@
:community-channel colors/white})
(defn base-container
[background-color]
{:width 160
:height 160
[background-color card-size]
{:width card-size
:height card-size
:border-radius 16
:overflow :hidden
:background-color (colors/alpha background-color 0.4)})
(defn empty-card
[]
[card-size]
(merge
(base-container nil)
(base-container nil card-size)
{:background-color colors/neutral-95}))
(def secondary-container
{:width 160
:height 120
(defn secondary-container
[card-size]
{:width card-size
:height (- card-size 40)
:border-radius 16
:bottom 0
:position :absolute
@@ -220,7 +220,7 @@
[]
(let [card-ref (atom nil)]
(fn [{:keys [avatar-params title type customization-color
content banner id channel-id profile-customization-color]}]
content banner id channel-id profile-customization-color]} card-size]
(let [color-50 (colors/custom-color customization-color 50)]
[rn/touchable-opacity
{:on-press #(calculate-card-position-and-open-screen
@@ -230,13 +230,13 @@
channel-id)
:ref #(reset! card-ref %)
:active-opacity 1}
[rn/view {:style (style/base-container color-50)}
[rn/view {:style (style/base-container color-50 card-size)}
(when banner
[rn/image
{:source banner
:style {:width 160
:height 65}}])
[rn/view {:style style/secondary-container}
[rn/view {:style (style/secondary-container card-size)}
[quo/text
{:size :paragraph-1
:weight :semi-bold
@@ -284,8 +284,8 @@
[:<>])
(defn empty-card
[]
[rn/view {:style (style/empty-card)}])
[card-size]
[rn/view {:style (style/empty-card card-size)}])
;; Home Card
(defn communities-discover
@@ -294,32 +294,35 @@
(defn card
[{:keys [type] :as data}]
(cond
(= type shell.constants/empty-card) ; Placeholder
[empty-card]
(let [screen-width (:width (rn/get-window))
;; 2 column, 20px horizontal margin, 15px gap
card-size (/ (- screen-width 55) 2)]
(cond
(= type shell.constants/empty-card) ; Placeholder
[empty-card card-size]
;; Screens Card
(#{shell.constants/one-to-one-chat-card
shell.constants/private-group-chat-card
shell.constants/community-card
shell.constants/community-channel-card}
type)
[screens-card data]
;; Screens Card
(#{shell.constants/one-to-one-chat-card
shell.constants/private-group-chat-card
shell.constants/community-card
shell.constants/community-channel-card}
type)
[screens-card data card-size]
(= type shell.constants/browser-card) ; Browser Card
[browser-card data]
(= type shell.constants/browser-card) ; Browser Card
[browser-card data]
(= type shell.constants/wallet-card) ; Wallet Card
[wallet-card data]
(= type shell.constants/wallet-card) ; Wallet Card
[wallet-card data]
(= type shell.constants/wallet-collectible) ; Wallet Card
[wallet-collectible data]
(= type shell.constants/wallet-collectible) ; Wallet Card
[wallet-collectible data]
(= type shell.constants/wallet-graph) ; Wallet Card
[wallet-graph data]
(= type shell.constants/wallet-graph) ; Wallet Card
[wallet-graph data]
(= type shell.constants/communities-discover) ; Home Card
[communities-discover data]
(= type shell.constants/communities-discover) ; Home Card
[communities-discover data]
:else
nil))
:else
nil)))
@@ -1,6 +1,6 @@
(ns status-im.contexts.wallet.add-address-to-watch.component-spec
(ns status-im.contexts.wallet.add-account.add-address-to-watch.component-spec
(:require
[status-im.contexts.wallet.add-address-to-watch.view :as add-address-to-watch]
[status-im.contexts.wallet.add-account.add-address-to-watch.view :as add-address-to-watch]
status-im.contexts.wallet.events
[test-helpers.component :as h]))
@@ -1,6 +1,6 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.component-spec
(:require
[status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as confirm-address]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view :as confirm-address]
[test-helpers.component :as h]))
(h/describe "Add Watch Only Account Page"
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.style)
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.style)
(def container
{:flex 1})
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.view
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view
(:require
[clojure.string :as string]
[quo.core :as quo]
@@ -6,7 +6,7 @@
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
[status-im.contexts.wallet.add-address-to-watch.confirm-address.style :as style]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.style :as style]
[status-im.contexts.wallet.common.screen-base.create-or-edit-account.view :as
create-or-edit-account]
[utils.i18n :as i18n]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.accounts.add-account.address-to-watch.events
(ns status-im.contexts.wallet.add-account.add-address-to-watch.events
(:require [clojure.string :as string]
[status-im.contexts.wallet.common.utils :as utils]
[taoensso.timbre :as log]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.style)
(ns status-im.contexts.wallet.add-account.add-address-to-watch.style)
(def header-container {:padding-bottom 8})
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.view
(ns status-im.contexts.wallet.add-account.add-address-to-watch.view
(:require
[clojure.string :as string]
[quo.core :as quo]
@@ -7,7 +7,7 @@
[reagent.core :as reagent]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.constants :as constants]
[status-im.contexts.wallet.add-address-to-watch.style :as style]
[status-im.contexts.wallet.add-account.add-address-to-watch.style :as style]
[status-im.contexts.wallet.common.validation :as validation]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.debounce :as debounce]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.path-format-sheet.view
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.path-format-sheet.view
(:require
[quo.core :as quo]
[status-im.constants :as constants]
@@ -1,6 +1,7 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.style
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.style
(:require [quo.foundations.colors :as colors]))
(defn screen
[top]
{:flex 1
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.view
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.view
(:require
[clojure.string :as string]
[quo.core :as quo]
@@ -7,10 +7,10 @@
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.create-account.edit-derivation-path.path-format-sheet.view :as
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.path-format-sheet.view :as
path-format-sheet]
[status-im.contexts.wallet.create-account.edit-derivation-path.style :as style]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.style :as style]
[status-im.contexts.wallet.common.utils :as utils]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.security.core :as security]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.events
(ns status-im.contexts.wallet.add-account.create-account.events
(:require [camel-snake-kebab.extras :as cske]
[status-im.contexts.wallet.data-store :as data-store]
[utils.re-frame :as rf]
@@ -1,8 +1,8 @@
(ns status-im.contexts.wallet.create-account.events-test
(ns status-im.contexts.wallet.add-account.create-account.events-test
(:require
[cljs.test :refer-macros [deftest is]]
matcher-combinators.test
[status-im.contexts.wallet.create-account.events :as events]))
[status-im.contexts.wallet.add-account.create-account.events :as events]))
(deftest confirm-account-origin
(let [db {:wallet {:ui {:create-account {}}}}
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.style
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style
(:require
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view
(:require
[clojure.string :as string]
[native-module.core :as native-module]
@@ -7,7 +7,8 @@
[react-native.blur :as blur]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style :as
style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.check-your-backup.style)
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.style)
(def header-container
{:margin-horizontal 20
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.new-keypair.check-your-backup.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.view
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.contexts.wallet.create-account.new-keypair.check-your-backup.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.keypair-name.style)
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.style)
(def header-container
{:margin-horizontal 20
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.new-keypair.keypair-name.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.common.validation.general :as validators]
[status-im.contexts.wallet.create-account.new-keypair.keypair-name.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.select-keypair.style)
(ns status-im.contexts.wallet.add-account.create-account.select-keypair.style)
(def header-container
{:margin-bottom 8})
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.select-keypair.view
(ns status-im.contexts.wallet.add-account.create-account.select-keypair.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[react-native.core :as rn]
[status-im.constants :as constants]
[status-im.contexts.wallet.create-account.select-keypair.style :as style]
[status-im.contexts.wallet.add-account.create-account.select-keypair.style :as style]
[utils.address :as utils]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.style
(ns status-im.contexts.wallet.add-account.create-account.style
(:require
[quo.foundations.colors :as colors]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.utils)
(ns status-im.contexts.wallet.add-account.create-account.utils)
(defn prepare-new-keypair
[{:keys [new-keypair address account-name account-color emoji derivation-path]}]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.view
(ns status-im.contexts.wallet.add-account.create-account.view
(:require
[clojure.string :as string]
[quo.core :as quo]
@@ -11,9 +11,9 @@
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.common.standard-authentication.core :as standard-auth]
[status-im.constants :as constants]
[status-im.contexts.wallet.add-account.create-account.style :as style]
[status-im.contexts.wallet.add-account.create-account.utils :as create-account.utils]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.create-account.style :as style]
[status-im.contexts.wallet.create-account.utils :as create-account.utils]
[status-im.contexts.wallet.sheets.account-origin.view :as account-origin]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.events.collectibles
(ns status-im.contexts.wallet.collectible.events
(:require [camel-snake-kebab.extras :as cske]
[taoensso.timbre :as log]
[utils.ethereum.chain :as chain]
@@ -0,0 +1,22 @@
(ns status-im.contexts.wallet.common.wizard.events
(:require [status-im.contexts.wallet.send.flow-config :as wallet-flow]
[utils.re-frame :as rf]))
(defn- wizard-find-next-screen
[db flow-id current-screen]
(let [flow-config (case flow-id
:wallet-flow wallet-flow/steps
nil)]
(first (filter (fn [{:keys [skip-step? screen-id]}]
(and (not= screen-id current-screen)
(not (and (fn? skip-step?) (skip-step? db)))))
flow-config))))
(rf/reg-event-fx
:wallet/wizard-navigate-forward
(fn [{:keys [db]} [{:keys [current-screen flow-id start-flow?]}]]
(let [next-screen (wizard-find-next-screen db flow-id current-screen)]
{:fx [[:dispatch
(if start-flow?
[:open-modal (:screen-id next-screen)]
[:navigate-to-within-stack [(:screen-id next-screen) current-screen]])]]})))
@@ -4,11 +4,9 @@
[react-native.background-timer :as background-timer]
[react-native.platform :as platform]
[status-im.constants :as constants]
[status-im.contexts.wallet.accounts.add-account.address-to-watch.events]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.data-store :as data-store]
[status-im.contexts.wallet.db :as db]
[status-im.contexts.wallet.events.collectibles]
[status-im.contexts.wallet.item-types :as item-types]
[taoensso.timbre :as log]
[utils.collection]
@@ -3,9 +3,9 @@
[cljs.test :refer-macros [deftest is testing]]
matcher-combinators.test
[status-im.constants :as constants]
[status-im.contexts.wallet.collectible.events :as collectible-events]
[status-im.contexts.wallet.db :as db]
[status-im.contexts.wallet.events :as events]
[status-im.contexts.wallet.events.collectibles :as collectibles]))
[status-im.contexts.wallet.events :as events]))
(def address "0x2f88d65f3cb52605a54a833ae118fb1363acccd2")
@@ -47,7 +47,7 @@
:accounts {"0x1" {:collectibles (list collectible-1 collectible-2)}
"0x2" {:collectibles (list collectible-3)}
"0x3" {}}}}
result-db (:db (collectibles/flush-collectibles {:db db}))]
result-db (:db (collectible-events/flush-collectibles {:db db}))]
(is (match? result-db expected-db)))))
@@ -60,7 +60,7 @@
(let [expected-db {:wallet {:accounts {"0x1" {}
"0x2" {"some other stuff" "with any value"}
"0x3" {}}}}
effects (collectibles/clear-stored-collectibles {:db db})
effects (collectible-events/clear-stored-collectibles {:db db})
result-db (:db effects)]
(is (match? result-db expected-db))))))
@@ -72,7 +72,8 @@
:image-url "https://..."}
expected-db {:wallet {:last-collectible-details {:description "Pandaria"
:image-url "https://..."}}}
effects (collectibles/store-last-collectible-details {:db db} [last-collectible])
effects (collectible-events/store-last-collectible-details {:db db}
[last-collectible])
result-db (:db effects)]
(is (match? result-db expected-db)))))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.events.saved-addresses
(ns status-im.contexts.wallet.save-address.events
(:require
[status-im.constants :as constants]
[utils.re-frame :as rf]))
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.send.save-address.style)
(ns status-im.contexts.wallet.save-address.style)
(def title-input-container
{:padding-horizontal 20
@@ -1,11 +1,11 @@
(ns status-im.contexts.wallet.send.save-address.view
(ns status-im.contexts.wallet.save-address.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[quo.theme]
[react-native.core :as rn]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.wallet.send.save-address.style :as style]
[status-im.contexts.wallet.save-address.style :as style]
[status-im.contexts.wallet.sheets.network-preferences.view
:as network-preferences]
[utils.i18n :as i18n]
+2 -2
View File
@@ -4,6 +4,6 @@
[status-im.contexts.chat.messenger.messages.content.audio.component-spec]
[status-im.contexts.communities.actions.community-options.component-spec]
[status-im.contexts.shell.share.wallet.component-spec]
[status-im.contexts.wallet.add-address-to-watch.component-spec]
[status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec]
[status-im.contexts.wallet.add-account.add-address-to-watch.component-spec]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.component-spec]
[status-im.contexts.wallet.send.input-amount.component-spec]))
+4 -2
View File
@@ -29,8 +29,10 @@
status-im.contexts.shell.qr-reader.events
status-im.contexts.shell.share.events
status-im.contexts.syncing.events
status-im.contexts.wallet.common.wizard
status-im.contexts.wallet.create-account.events
status-im.contexts.wallet.add-account.add-address-to-watch.events
status-im.contexts.wallet.add-account.create-account.events
status-im.contexts.wallet.collectible.events
status-im.contexts.wallet.common.wizard.events
status-im.contexts.wallet.effects
status-im.contexts.wallet.events
status-im.contexts.wallet.send.events
+13 -11
View File
@@ -60,24 +60,26 @@
[status-im.contexts.wallet.account.edit-account.view :as wallet-edit-account]
[status-im.contexts.wallet.account.share-address.view :as wallet-share-address]
[status-im.contexts.wallet.account.view :as wallet-accounts]
[status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view :as
wallet-confirm-address-to-watch]
[status-im.contexts.wallet.add-address-to-watch.view :as wallet-add-address-to-watch]
[status-im.contexts.wallet.add-account.add-address-to-watch.view :as wallet-add-address-to-watch]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.view :as
wallet-edit-derivation-path]
[status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view :as
wallet-backup-recovery-phrase]
[status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.view :as
wallet-check-your-backup]
[status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.view :as
wallet-keypair-name]
[status-im.contexts.wallet.add-account.create-account.select-keypair.view :as wallet-select-keypair]
[status-im.contexts.wallet.add-account.create-account.view :as wallet-create-account]
[status-im.contexts.wallet.bridge.bridge-to.view :as wallet-bridge-to]
[status-im.contexts.wallet.bridge.input-amount.view :as wallet-bridge-input-amount]
[status-im.contexts.wallet.bridge.select-asset.view :as wallet-bridge-select-asset]
[status-im.contexts.wallet.collectible.view :as wallet-collectible]
[status-im.contexts.wallet.common.scan-account.view :as wallet-scan-address]
[status-im.contexts.wallet.create-account.edit-derivation-path.view :as wallet-edit-derivation-path]
[status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.view :as
wallet-backup-recovery-phrase]
[status-im.contexts.wallet.create-account.new-keypair.check-your-backup.view :as
wallet-check-your-backup]
[status-im.contexts.wallet.create-account.new-keypair.keypair-name.view :as wallet-keypair-name]
[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.save-address.view :as wallet-save-address]
[status-im.contexts.wallet.send.from.view :as wallet-select-from]
[status-im.contexts.wallet.send.save-address.view :as wallet-save-address]
[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.select-collectible-amount.view :as wallet-select-collectible-amount]
+1 -2
View File
@@ -54,7 +54,6 @@
(defn screen
[screen-key]
(reagent.core/reactify-component
(fn []
(let [screen-details (get (if js/goog.DEBUG
@@ -110,7 +109,7 @@
sheet])]]))
functional-compiler))
(def toasts (reagent/reactify-component toasts/toasts))
(def toasts (reagent/reactify-component toasts/toasts functional-compiler))
(def alert-banner
(reagent/reactify-component
-6
View File
@@ -122,12 +122,6 @@
(fn [{:keys [preferred-name]}]
preferred-name))
(re-frame/reg-sub
:profile/image
:<- [:profile/profile-with-image]
(fn [profile]
(profile.utils/photo profile)))
(re-frame/reg-sub
:multiaccount/default-account
:<- [:wallet/accounts]
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.3",
"commit-sha1": "b744ff4386751bd3e7cb8e30164678a8d557fbc2",
"src-sha256": "1yj76khas4g8xbgp2ymr1hwga662hsjmzpgb95x34vl42hdpirns"
"version": "chore/community-channel-endpoint",
"commit-sha1": "b710fa3e2e661973d5a5636868b8af0fa1de807d",
"src-sha256": "05pcda0sms16qs5dygmcwk9z3acxvfgkfjh5p4ybkh6q9cwwddwp"
}
@@ -268,7 +268,7 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
self.community_name = "open community"
self.community_name = "Open community"
self.channel_name = 'general'
self.home_1.create_community(community_type="open")
self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name)
@@ -407,7 +407,7 @@ class TestActivityMultipleDevicePRTwo(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
self.community_name = "open community"
self.community_name = "Open community"
self.channel_name = 'general'
self.home_1.create_community(community_type="open")
self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name)
@@ -468,7 +468,7 @@ class TestActivityMultipleDevicePRTwo(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
community_name = 'closed community'
community_name = 'Closed community'
self.channel_name = "dogs"
self.home_1.create_community(community_type="closed")
self.home_1.reopen_app()
@@ -25,7 +25,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.home = self.sign_in.create_user(username=self.username)
self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button)
self.community_name = "closed community"
self.community_name = "Closed community"
self.channel_name = "cats"
self.community = self.home.create_community(community_type="closed")
@@ -307,7 +307,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
self.community_name = "open community"
self.community_name = "Open community"
self.channel_name = 'general'
self.home_1.create_community(community_type="open")
self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name)
@@ -828,7 +828,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
self.community_name = "open community"
self.community_name = "Open community"
self.channel_name = 'general'
self.home_1.create_community(community_type="open")
@@ -1004,7 +1004,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Device 1 creates a closed community")
self.home_1.create_community(community_type="closed")
community_name = "closed community"
community_name = "Closed community"
self.community_1.share_community(community_name, self.username_2)
self.community_1.get_to_community_channel_from_home(community_name, "general")
control_message_general_chat = "this message should be visible to the user before joining"
@@ -1104,7 +1104,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Device 1 creates open community")
self.home_1.create_community(community_type="open")
community_name = "open community"
community_name = "Open community"
self.community_1.share_community(community_name, self.username_2)
self.community_1.get_to_community_channel_from_home(community_name, "general")
control_message_general_chat = "this message should be visible to the user before joining"
@@ -17,7 +17,7 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
self.home = self.sign_in.create_user(username=self.username)
self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button)
self.community_name = "open community"
self.community_name = "Open community"
self.channel_name = "general"
self.community = self.home.create_community(community_type="open")
self.profile_view = self.home.get_profile_view()