Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f86483d7cf | ||
|
|
f6ac99647e | ||
|
|
655a6fa124 |
@@ -1,98 +0,0 @@
|
||||
(ns quo2.components.drawers.drawer-top.component-spec
|
||||
(:require [test-helpers.component :as h]
|
||||
[quo2.core :as quo]))
|
||||
|
||||
(h/describe "drawer top tests"
|
||||
(h/test "component renders in default type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :default}])
|
||||
(h/is-truthy (h/get-by-text "Title")))
|
||||
|
||||
(h/test "component renders in default + description type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :default
|
||||
:description "Description"}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-text "Description")))
|
||||
|
||||
(h/test "component renders in info type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :info}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-label-text :info-icon)))
|
||||
|
||||
(h/test "component renders in info + description type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:description "Description"
|
||||
:type :info}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-text "Description"))
|
||||
(h/is-truthy (h/get-by-label-text :info-icon)))
|
||||
|
||||
(h/test "component renders in context-tag type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :context-tag
|
||||
:community-name "Coinbase"}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-label-text :context-tag-wrapper)))
|
||||
|
||||
(h/test "component renders in context-tag + button type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :context-tag
|
||||
:button-icon :i/placeholder
|
||||
:community-name "Coinbase"}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-label-text :button-icon))
|
||||
(h/is-truthy (h/get-by-label-text :context-tag-wrapper)))
|
||||
|
||||
(h/test "component renders in account type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:type :account
|
||||
:account-avatar-emoji "🍿"
|
||||
:networks [:ethereum]
|
||||
:description "0x62b...0a5"
|
||||
:customization-color :purple}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-text "0x62b...0a5"))
|
||||
(h/is-truthy (h/get-by-label-text :account-avatar)))
|
||||
|
||||
(h/test "component renders in keypair type when keycard? is false"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:keycard? false
|
||||
:icon-avatar :i/placeholder
|
||||
:type :keypair}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(-> (h/expect (h/get-by-translation-text :on-device))
|
||||
(.toBeTruthy)))
|
||||
|
||||
(h/test "component renders in keypair type when keycard? is true"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:keycard? true
|
||||
:icon-avatar :i/placeholder
|
||||
:type :keypair}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(-> (h/expect (h/get-by-translation-text :on-keycard))
|
||||
(.toBeTruthy)))
|
||||
|
||||
(h/test "component renders in default-keypair type"
|
||||
(h/render [quo/drawer-top
|
||||
{:title "Title"
|
||||
:description "0x62b...0a5"
|
||||
:type :default-keypair}])
|
||||
(h/is-truthy (h/get-by-text "Title"))
|
||||
(h/is-truthy (h/get-by-label-text :default-keypair-text)))
|
||||
|
||||
(h/test "component renders in label type"
|
||||
(h/render [quo/drawer-top
|
||||
{:label "label"
|
||||
:type :label}])
|
||||
(h/is-truthy (h/get-by-text "label"))))
|
||||
@@ -1,31 +0,0 @@
|
||||
(ns quo2.components.drawers.drawer-top.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def container
|
||||
{:padding-horizontal 20
|
||||
:padding-bottom 12
|
||||
:flex-direction :row})
|
||||
|
||||
(def body-container
|
||||
{:flex 1})
|
||||
|
||||
(defn description
|
||||
[theme blur?]
|
||||
{:color (if blur?
|
||||
colors/white-opa-40
|
||||
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})
|
||||
|
||||
(def left-container
|
||||
{:margin-right 8
|
||||
:justify-content :center})
|
||||
|
||||
(defn network-text-color
|
||||
[network]
|
||||
{:color (colors/custom-color network)})
|
||||
|
||||
(def row
|
||||
{:flex-direction :row
|
||||
:align-items :center})
|
||||
|
||||
(def keycard-icon
|
||||
{:margin-left 4})
|
||||
@@ -1,204 +0,0 @@
|
||||
(ns quo2.components.drawers.drawer-top.view
|
||||
(:require [quo2.theme :as quo.theme]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.drawers.drawer-top.style :as style]
|
||||
[quo2.components.buttons.button.view :as button]
|
||||
[quo2.components.tags.context-tag.view :as context-tag]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.icon :as icons]
|
||||
[quo2.components.avatars.account-avatar.view :as account-avatar]
|
||||
[quo2.components.avatars.icon-avatar :as icon-avatar]
|
||||
[quo2.components.avatars.user-avatar.view :as user-avatar]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(defn- left-image
|
||||
[{:keys [type customization-color account-avatar-emoji icon-avatar profile-picture]}]
|
||||
(case type
|
||||
:account [account-avatar/view
|
||||
{:customization-color customization-color
|
||||
:size 32
|
||||
:emoji account-avatar-emoji
|
||||
:type :default}]
|
||||
:keypair [icon-avatar/icon-avatar
|
||||
{:icon icon-avatar
|
||||
:border? true
|
||||
:color :neutral}]
|
||||
|
||||
:default-keypair [user-avatar/user-avatar
|
||||
{:size :small
|
||||
:status-indicator? false
|
||||
:profile-picture profile-picture}]
|
||||
nil))
|
||||
|
||||
(defn- network-view
|
||||
[network]
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :regular
|
||||
:style (style/network-text-color network)}
|
||||
(str (subs (name network) 0 3) ":")])
|
||||
|
||||
(defn- keypair-subtitle
|
||||
[{:keys [theme blur? keycard?]}]
|
||||
[rn/view {:style style/row}
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :regular
|
||||
:style (style/description theme blur?)}
|
||||
(if keycard?
|
||||
(i18n/label :t/on-keycard)
|
||||
(i18n/label :t/on-device))]
|
||||
(when keycard?
|
||||
[icons/icon
|
||||
:i/keycard-card
|
||||
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)
|
||||
:size 16
|
||||
:container-style style/keycard-icon}])])
|
||||
|
||||
(defn- acocunt-subtitle
|
||||
[{:keys [networks theme blur? description]}]
|
||||
[rn/view {:style style/row}
|
||||
(for [network networks]
|
||||
^{:key (str network)}
|
||||
[network-view network])
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :regular
|
||||
:style (style/description theme blur?)}
|
||||
description]])
|
||||
|
||||
(defn- default-keypair-subtitle
|
||||
[{:keys [description theme blur?]}]
|
||||
[text/text
|
||||
{:accessibility-label :default-keypair-text
|
||||
:size :paragraph-2
|
||||
:weight :regular
|
||||
:style (style/description theme blur?)}
|
||||
(str description " · " (i18n/label :t/on-device))])
|
||||
|
||||
(defn- context-tag-subtitle
|
||||
[{:keys [community-logo community-name]}]
|
||||
[rn/view
|
||||
{:accessibility-label :context-tag-wrapper
|
||||
:style {:flex-wrap :wrap}}
|
||||
[context-tag/view
|
||||
{:type :community
|
||||
:community-name community-name
|
||||
:community-logo community-logo
|
||||
:size 24}]])
|
||||
|
||||
(defn- description-subtitle
|
||||
[{:keys [theme blur? description]}]
|
||||
[text/text
|
||||
{:size :paragraph-1
|
||||
:weight :regular
|
||||
:style (style/description theme blur?)}
|
||||
description])
|
||||
|
||||
(defn- subtitle
|
||||
[{:keys [type theme blur? keycard? networks description community-name community-logo]}]
|
||||
(cond
|
||||
(= :keypair type)
|
||||
[keypair-subtitle
|
||||
{:theme theme
|
||||
:blur? blur?
|
||||
:keycard? keycard?}]
|
||||
|
||||
(= :account type)
|
||||
[acocunt-subtitle
|
||||
{:networks networks
|
||||
:theme theme
|
||||
:blur? blur?
|
||||
:description description}]
|
||||
|
||||
(= :default-keypair type)
|
||||
[default-keypair-subtitle
|
||||
{:description description
|
||||
:theme theme
|
||||
:blur? blur?}]
|
||||
|
||||
(= :context-tag type)
|
||||
[context-tag-subtitle
|
||||
{:community-logo community-logo
|
||||
:community-name community-name}]
|
||||
|
||||
(and (not= :label type) description)
|
||||
[description-subtitle
|
||||
{:theme theme
|
||||
:blur? blur?
|
||||
:description description}]))
|
||||
|
||||
(defn- right-icon
|
||||
[{:keys [theme type on-button-press on-button-long-press button-disabled? button-icon]}]
|
||||
(cond
|
||||
(= :info type)
|
||||
[icons/icon
|
||||
:i/info
|
||||
{:accessibility-label :info-icon
|
||||
:size 20
|
||||
:color (colors/theme-colors colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)}]
|
||||
(and (= :context-tag type) button-icon)
|
||||
[button/button
|
||||
{:accessibility-label :button-icon
|
||||
:on-press on-button-press
|
||||
:on-long-press on-button-long-press
|
||||
:disabled? button-disabled?
|
||||
:type :primary
|
||||
:size 24
|
||||
:icon-only? true}
|
||||
button-icon]))
|
||||
|
||||
(defn- left-title
|
||||
[{:keys [type label title theme blur?]}]
|
||||
(case type
|
||||
:label [text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/description theme blur?)}
|
||||
label]
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:weight :semi-bold}
|
||||
title]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [title type theme description blur? community-name community-logo button-icon on-button-press
|
||||
on-button-long-press
|
||||
button-disabled? account-avatar-emoji customization-color icon-avatar
|
||||
profile-picture keycard? networks label]}]
|
||||
[rn/view {:style style/container}
|
||||
[rn/view {:style style/left-container}
|
||||
[left-image
|
||||
{:type type
|
||||
:customization-color customization-color
|
||||
:account-avatar-emoji account-avatar-emoji
|
||||
:icon-avatar icon-avatar
|
||||
:profile-picture profile-picture}]]
|
||||
[rn/view {:style style/body-container}
|
||||
[left-title
|
||||
{:type type
|
||||
:label label
|
||||
:title title
|
||||
:theme theme
|
||||
:blur? blur?}]
|
||||
[subtitle
|
||||
{:type type
|
||||
:theme theme
|
||||
:blur? blur?
|
||||
:keycard? keycard?
|
||||
:networks networks
|
||||
:description description
|
||||
:community-name community-name
|
||||
:community-logo community-logo}]]
|
||||
[right-icon
|
||||
{:theme theme
|
||||
:type type
|
||||
:on-button-press on-button-press
|
||||
:on-button-long-press on-button-long-press
|
||||
:button-disabled? button-disabled?
|
||||
:button-icon button-icon}]])
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
@@ -79,14 +79,13 @@
|
||||
state :default}
|
||||
:as props}]
|
||||
[rn/view
|
||||
{:style (merge (style/container {:theme theme
|
||||
:type type
|
||||
:size size
|
||||
:state state
|
||||
:blur? blur?
|
||||
:customization-color customization-color})
|
||||
container-style)
|
||||
:accessibility-label :context-tag}
|
||||
{:style (merge (style/container {:theme theme
|
||||
:type type
|
||||
:size size
|
||||
:state state
|
||||
:blur? blur?
|
||||
:customization-color customization-color})
|
||||
container-style)}
|
||||
(case type
|
||||
:default
|
||||
[tag-skeleton {:theme theme :size size :text full-name}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
(ns quo2.components.wallet.transaction-summary.component-spec
|
||||
(:require [quo2.components.wallet.transaction-summary.view :as transaction-summary]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "Transaction summary"
|
||||
(h/test "default render"
|
||||
(h/render [transaction-summary/view {}])
|
||||
(h/is-truthy (h/query-by-label-text :transaction-summary)))
|
||||
|
||||
(h/test "incorrect setting doesn't crash render"
|
||||
(h/render [transaction-summary/view {:transaction :unknown}])
|
||||
(h/is-truthy (h/query-by-label-text :transaction-summary)))
|
||||
|
||||
(h/test "icon displayed"
|
||||
(h/render [transaction-summary/view {:transaction :send}])
|
||||
(h/is-truthy (h/query-by-label-text :header-icon)))
|
||||
|
||||
(h/test "Context tag rendered"
|
||||
(h/render [transaction-summary/view
|
||||
{:transaction :send
|
||||
:first-tag {:size 24
|
||||
:type :token
|
||||
:token-name "SNT"
|
||||
:amount 1500}}])
|
||||
(h/is-truthy (h/query-by-label-text :context-tag))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
(ns quo2.components.wallet.transaction-summary.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn container
|
||||
[theme]
|
||||
{:border-radius 16
|
||||
:padding-top 9
|
||||
:padding-bottom 8
|
||||
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)
|
||||
:border-width 1})
|
||||
|
||||
(def transaction-header-container
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:margin-bottom 9
|
||||
:padding-horizontal 12})
|
||||
|
||||
(defn transaction-header
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:margin-left 4})
|
||||
|
||||
(defn prop-text
|
||||
[theme]
|
||||
{:margin-right 4
|
||||
:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
|
||||
(def prop-tag
|
||||
{:margin-right 4})
|
||||
|
||||
(def icon-container
|
||||
{:width 20
|
||||
:height 20
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def content
|
||||
{:margin-bottom 8
|
||||
:padding-horizontal 12})
|
||||
|
||||
(def content-line
|
||||
{:flex-direction :row
|
||||
:margin-top 4
|
||||
:align-items :center})
|
||||
|
||||
(defn icon-color
|
||||
[theme]
|
||||
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))
|
||||
|
||||
(defn divider
|
||||
[theme]
|
||||
{:height 1
|
||||
:margin-vertical 4
|
||||
:background-color (colors/theme-colors colors/neutral-10 colors/neutral-80 theme)})
|
||||
|
||||
(defn extra-info-header
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
||||
|
||||
(defn extra-info-content
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
|
||||
(def extra-info-container
|
||||
{:margin-horizontal 12})
|
||||
|
||||
(def extras-container
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:margin-top 4})
|
||||
@@ -1,123 +0,0 @@
|
||||
(ns quo2.components.wallet.transaction-summary.view
|
||||
(:require [quo2.theme :as quo.theme]
|
||||
[quo2.components.wallet.transaction-summary.style :as style]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.components.icon :as icon]
|
||||
[quo2.components.tags.context-tag.view :as context-tag]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(def transaction-translation
|
||||
{:send (i18n/label :t/send)
|
||||
:swap (i18n/label :t/swap)
|
||||
:bridge (i18n/label :t/bridge)})
|
||||
|
||||
(def transaction-icon
|
||||
{:send :i/send
|
||||
:swap :i/swap
|
||||
:bridge :i/bridge})
|
||||
|
||||
(defn transaction-header
|
||||
[{:keys [transaction
|
||||
theme]
|
||||
:or {transaction :send}}]
|
||||
(let [icon (transaction-icon transaction)
|
||||
translation (transaction transaction-translation)]
|
||||
[rn/view
|
||||
{:style style/transaction-header-container}
|
||||
[rn/view {:style style/icon-container}
|
||||
(when icon
|
||||
[icon/icon icon
|
||||
{:color (style/icon-color theme)
|
||||
:accessibility-label :header-icon}])]
|
||||
(when translation
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-1
|
||||
:style (style/transaction-header theme)}
|
||||
translation])]))
|
||||
|
||||
(defn prop-text
|
||||
[label theme]
|
||||
[text/text
|
||||
{:weight :regular
|
||||
:size :paragraph-2
|
||||
:style (style/prop-text theme)}
|
||||
(i18n/label label)])
|
||||
|
||||
(defn prop-tag
|
||||
[props]
|
||||
[rn/view {:style style/prop-tag}
|
||||
[context-tag/view (assoc props :size 24)]])
|
||||
|
||||
(defn extra-info
|
||||
[{:keys [header content theme]}]
|
||||
[rn/view {:style style/extra-info-container}
|
||||
[text/text
|
||||
{:weight :regular
|
||||
:size :paragraph-2
|
||||
:style (style/extra-info-header theme)}
|
||||
header]
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:style (style/extra-info-content theme)}
|
||||
content]])
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [theme first-tag second-tag third-tag fourth-tag second-tag-prefix
|
||||
third-tag-prefix fourth-tag-prefix fifth-tag max-fees
|
||||
nonce input-data]
|
||||
:as props}]
|
||||
[rn/view
|
||||
{:style (style/container theme)
|
||||
:accessibility-label :transaction-summary}
|
||||
[transaction-header props]
|
||||
[rn/view {:style style/content}
|
||||
[rn/view {:style style/content-line}
|
||||
(when first-tag [prop-tag first-tag])
|
||||
(when second-tag-prefix [prop-text second-tag-prefix theme])
|
||||
(when second-tag [prop-tag second-tag])]
|
||||
[rn/view {:style style/content-line}
|
||||
(when third-tag-prefix [prop-text third-tag-prefix theme])
|
||||
(when third-tag [prop-tag third-tag])
|
||||
(when fourth-tag-prefix [prop-text fourth-tag-prefix theme])
|
||||
(when fourth-tag [prop-tag fourth-tag])
|
||||
(when fifth-tag [prop-tag fifth-tag])]]
|
||||
[rn/view {:style (style/divider theme)}]
|
||||
[rn/view {:style style/extras-container}
|
||||
[extra-info
|
||||
{:header (i18n/label :t/max-fees)
|
||||
:content max-fees
|
||||
:theme theme}]
|
||||
[extra-info
|
||||
{:header (i18n/label :t/nonce)
|
||||
:content nonce
|
||||
:theme theme}]
|
||||
[extra-info
|
||||
{:header (i18n/label :t/input-data)
|
||||
:content input-data
|
||||
:theme theme}]]])
|
||||
|
||||
(def view
|
||||
"Properties:
|
||||
- :transaction - type of transaction`. Possible values:
|
||||
- :send
|
||||
- :swap
|
||||
- :bridge
|
||||
|
||||
- :first-tag - props for context tag component that will be first on the first line
|
||||
- :second-tag - props for context tag component that will be second on the first line
|
||||
- :third-tag - props for context tag component that will be first on the second line
|
||||
- :fourth-tag - props for context tag component that will be second on the second line
|
||||
- :fifth-tag - props for context tag component that will be second on the second line
|
||||
|
||||
- :second-tag-prefix - translation keyword to be used with label before second context tag
|
||||
- :third-tag-prefix - translation keyword to be used with label before third context tag
|
||||
- :fourth-tag-prefix - translation keyword to be used with label before fourth context tag
|
||||
|
||||
- :max-fees - string
|
||||
- :nonce - digit
|
||||
- :input data - string
|
||||
"
|
||||
(quo.theme/with-theme view-internal))
|
||||
@@ -40,7 +40,6 @@
|
||||
quo2.components.drawers.action-drawers.view
|
||||
quo2.components.drawers.documentation-drawers.view
|
||||
quo2.components.drawers.drawer-buttons.view
|
||||
quo2.components.drawers.drawer-top.view
|
||||
quo2.components.drawers.permission-context.view
|
||||
quo2.components.dropdowns.dropdown
|
||||
quo2.components.dropdowns.network-dropdown.view
|
||||
@@ -127,7 +126,6 @@
|
||||
quo2.components.wallet.progress-bar.view
|
||||
quo2.components.wallet.summary-info.view
|
||||
quo2.components.wallet.token-input.view
|
||||
quo2.components.wallet.transaction-summary.view
|
||||
quo2.components.wallet.wallet-activity.view
|
||||
quo2.components.wallet.wallet-overview.view
|
||||
[quo2.components.graph.interactive-graph.view :as interactive-graph]))
|
||||
@@ -202,7 +200,6 @@
|
||||
(def action-drawer quo2.components.drawers.action-drawers.view/action-drawer)
|
||||
(def documentation-drawers quo2.components.drawers.documentation-drawers.view/view)
|
||||
(def drawer-buttons quo2.components.drawers.drawer-buttons.view/view)
|
||||
(def drawer-top quo2.components.drawers.drawer-top.view/view)
|
||||
(def permission-context quo2.components.drawers.permission-context.view/view)
|
||||
|
||||
;;;; Dropdowns
|
||||
@@ -346,4 +343,3 @@
|
||||
(def token-input quo2.components.wallet.token-input.view/view)
|
||||
(def wallet-overview quo2.components.wallet.wallet-overview.view/view)
|
||||
(def wallet-activity quo2.components.wallet.wallet-activity.view/view)
|
||||
(def transaction-summary quo2.components.wallet.transaction-summary.view/view)
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
[quo2.components.drawers.action-drawers.component-spec]
|
||||
[quo2.components.drawers.documentation-drawers.component-spec]
|
||||
[quo2.components.drawers.drawer-buttons.component-spec]
|
||||
[quo2.components.drawers.drawer-top.component-spec]
|
||||
[quo2.components.drawers.permission-context.component-spec]
|
||||
[quo2.components.dropdowns.network-dropdown.component-spec]
|
||||
[quo2.components.gradient.gradient-cover.component-spec]
|
||||
@@ -72,6 +71,5 @@
|
||||
[quo2.components.wallet.progress-bar.component-spec]
|
||||
[quo2.components.wallet.summary-info.component-spec]
|
||||
[quo2.components.wallet.token-input.component-spec]
|
||||
[quo2.components.wallet.transaction-summary.component-spec]
|
||||
[quo2.components.wallet.wallet-overview.component-spec]
|
||||
[quo2.components.wallet.wallet-activity.component-spec]))
|
||||
|
||||
@@ -222,18 +222,6 @@
|
||||
:magenta {50 "#EC266C"
|
||||
60 "#BD1E56"}})
|
||||
|
||||
;;;; Networks
|
||||
|
||||
(def networks
|
||||
{:ethereum "#758EEB"
|
||||
:optimism "#E76E6E"
|
||||
:arbitrum "#6BD5F0"
|
||||
:zkSync "#9FA0FE"
|
||||
:hermez "#EB8462"
|
||||
:xDai "#3FC0BD"
|
||||
:polygon "#AD71F3"
|
||||
:unknown "#EEF2F5"})
|
||||
|
||||
(def colors-map
|
||||
(merge {:primary {50 primary-50 ;; User can also use primary color as customisation color
|
||||
60 primary-60}
|
||||
@@ -253,12 +241,7 @@
|
||||
60 danger-60}
|
||||
:success {50 success-50
|
||||
60 success-60}}
|
||||
customization
|
||||
networks))
|
||||
|
||||
(defn hex-string?
|
||||
[s]
|
||||
(and (string? s) (string/starts-with? s "#")))
|
||||
customization))
|
||||
|
||||
(def custom-color
|
||||
"(custom-color color suffix opacity)
|
||||
@@ -267,20 +250,18 @@
|
||||
opacity 0-100 (optional)"
|
||||
(memoize
|
||||
(fn
|
||||
([color]
|
||||
(custom-color color nil nil))
|
||||
([color suffix]
|
||||
(custom-color color suffix nil))
|
||||
([color suffix opacity]
|
||||
(let [hex? (not (keyword? color))
|
||||
color (if (hex-string? (get colors-map color))
|
||||
(get colors-map color)
|
||||
(get-in colors-map [color suffix]))]
|
||||
(let [hex? (not (keyword? color))
|
||||
color-keyword (keyword color)
|
||||
base-color (get-in colors-map
|
||||
[color-keyword suffix])]
|
||||
(cond
|
||||
(and opacity hex?) (alpha color (/ opacity 100))
|
||||
opacity (alpha color (/ opacity 100))
|
||||
opacity (alpha base-color (/ opacity 100))
|
||||
hex? color
|
||||
:else color))))))
|
||||
:else base-color))))))
|
||||
|
||||
(defn custom-color-by-theme
|
||||
"(custom-color-by-theme color suffix-light suffix-dark opacity-light opacity-dark)
|
||||
@@ -318,3 +299,15 @@
|
||||
(defn dark?
|
||||
[]
|
||||
(theme/dark?))
|
||||
|
||||
;;;; Networks
|
||||
|
||||
(def networks
|
||||
{:ethereum "#758EEB"
|
||||
:optimism "#E76E6E"
|
||||
:arbitrum "#6BD5F0"
|
||||
:zkSync "#9FA0FE"
|
||||
:hermez "#EB8462"
|
||||
:xDai "#3FC0BD"
|
||||
:polygon "#AD71F3"
|
||||
:unknown "#EEF2F5"})
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
{:align-items :flex-start}))
|
||||
|
||||
(def name-container
|
||||
{:justify-content :center})
|
||||
{:flex-direction :row
|
||||
:align-items :center})
|
||||
|
||||
(def bio
|
||||
{:margin-top 8})
|
||||
|
||||
@@ -1,19 +1,42 @@
|
||||
(ns status-im2.contexts.communities.discover.events
|
||||
(:require [camel-snake-kebab.core :as csk]
|
||||
[clojure.string :as string]
|
||||
[taoensso.timbre :as log]
|
||||
(:require [taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def commmunity-keys-renamed
|
||||
{:requestedAccessAt :requested-access-at
|
||||
:fileSize :file-size
|
||||
:communityTokensMetadata :community-tokens-metadata
|
||||
:activeMembersCount :active-members-count
|
||||
:unknownCommunities :unknown-communities
|
||||
:canRequestAccess :can-request-access?
|
||||
:adminSettings :admin-settings
|
||||
:canManageUsers :can-manage-users?
|
||||
:categoryID :category-id
|
||||
:canPost :can-post?
|
||||
:isControlNode :is-control-node?
|
||||
:pinMessageAllMembersEnabled :pin-message-all-members-enabled
|
||||
:isMember :is-member?
|
||||
:canDeleteMessageForEveryone :can-delete-message-for-everyone?
|
||||
:tokenPermissions :token-permissions
|
||||
:muteTill :mute-till
|
||||
:contractCommunities :contract-communities
|
||||
:banList :ban-list
|
||||
:keyUid :key-uid
|
||||
:memberRole :member-role
|
||||
:introMessage :intro-message
|
||||
:contractFeaturedCommunities :contract-featured-communities
|
||||
:canJoin :can-join?
|
||||
:outroMessage :outro-message
|
||||
:resizeTarget :resize-target})
|
||||
|
||||
(defn rename-contract-community-key
|
||||
[k]
|
||||
(let [s (name k)
|
||||
lower-cased (csk/->kebab-case-string s)
|
||||
starts-with-digit? (re-matches #"^\d.*" s)
|
||||
predicate? (some #(string/starts-with? lower-cased %)
|
||||
["can-" "is-"])]
|
||||
existing-rename (k commmunity-keys-renamed)]
|
||||
(cond starts-with-digit? s
|
||||
predicate? (keyword (str lower-cased "?"))
|
||||
:else (keyword lower-cased))))
|
||||
existing-rename existing-rename
|
||||
:else (keyword s))))
|
||||
|
||||
(defn rename-contract-community-keys
|
||||
[m]
|
||||
@@ -43,4 +66,3 @@
|
||||
:params []
|
||||
:on-success #(rf/dispatch [:fetched-contract-communities %])
|
||||
:on-error #(log/error "failed to fetch contract communities" %)}]})
|
||||
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
|
||||
(deftest rename-contract-community-key-test
|
||||
(are [i e] (= (events/rename-contract-community-key i) e)
|
||||
:foo :foo
|
||||
:fooBar :foo-bar
|
||||
:fooBarBaz :foo-bar-baz
|
||||
:isFoo :is-foo?
|
||||
:isFooBar :is-foo-bar?
|
||||
:canFoo :can-foo?
|
||||
:canFooBar :can-foo-bar?
|
||||
:0x025d27e58 "0x025d27e58"
|
||||
:093b4684-92f0 "093b4684-92f0"
|
||||
:3f9e77b8-97c7 "3f9e77b8-97c7"))
|
||||
:requestedAccessAt :requested-access-at
|
||||
:canDeleteMessageForEveryone :can-delete-message-for-everyone?
|
||||
:name :name
|
||||
:0x025d27e58 "0x025d27e58"
|
||||
:093b4684-92f0 "093b4684-92f0"
|
||||
:3f9e77b8-97c7 "3f9e77b8-97c7"))
|
||||
|
||||
(deftest rename-contract-community-keys-test
|
||||
(are [i e] (= (events/rename-contract-community-keys i) e)
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
(ns status-im2.contexts.quo-preview.drawers.drawer-top
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.re-frame :as rf]
|
||||
[react-native.core :as rn]
|
||||
[status-im.multiaccounts.core :as multiaccounts]))
|
||||
|
||||
(def descriptor
|
||||
[{:type :select
|
||||
:key :type
|
||||
:options [{:key :default}
|
||||
{:key :default-keypair}
|
||||
{:key :account}
|
||||
{:key :keypair}
|
||||
{:key :info}
|
||||
{:key :context-tag}
|
||||
{:key :label}]}
|
||||
{:type :select
|
||||
:key :button-icon
|
||||
:options [{:key :i/placeholder}
|
||||
{:key nil
|
||||
:value "null"}]}
|
||||
{:key :blur?
|
||||
:type :boolean}
|
||||
{:key :keycard?
|
||||
:type :boolean}
|
||||
{:key :title
|
||||
:type :text}
|
||||
{:key :description
|
||||
:type :text}
|
||||
{:key :community-name
|
||||
:type :text}
|
||||
{:key :label
|
||||
:type :text}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [account (rf/sub [:profile/multiaccount])
|
||||
state (reagent/atom
|
||||
{:blur? false
|
||||
:title "Title"
|
||||
:type :default
|
||||
:label "Drawer label"
|
||||
:keycard? true
|
||||
:networks [:ethereum]
|
||||
:description "0x62b...0a5"
|
||||
:button-icon :i/placeholder
|
||||
:community-name "Coinbase"
|
||||
:community-logo (resources/mock-images :coinbase)
|
||||
:account-avatar-emoji "🍿"
|
||||
:customization-color :purple
|
||||
:icon-avatar :i/placeholder
|
||||
:on-button-press #(js/alert "on press")
|
||||
:on-button-long-press #(js/alert "on long press")
|
||||
:profile-picture (multiaccounts/displayed-photo account)})]
|
||||
(fn []
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn [] [quo/drawer-top @state])
|
||||
:theme (:theme @state)}])}
|
||||
"See in bottom sheet"]
|
||||
[rn/view {:style {:margin-top 20}}
|
||||
[quo/drawer-top @state]]])))
|
||||
@@ -45,7 +45,6 @@
|
||||
[status-im2.contexts.quo-preview.drawers.action-drawers :as action-drawers]
|
||||
[status-im2.contexts.quo-preview.drawers.documentation-drawers :as documenation-drawers]
|
||||
[status-im2.contexts.quo-preview.drawers.drawer-buttons :as drawer-buttons]
|
||||
[status-im2.contexts.quo-preview.drawers.drawer-top :as drawer-top]
|
||||
[status-im2.contexts.quo-preview.drawers.permission-drawers :as permission-drawers]
|
||||
[status-im2.contexts.quo-preview.dropdowns.dropdown :as dropdown]
|
||||
[status-im2.contexts.quo-preview.dropdowns.network-dropdown :as network-dropdown]
|
||||
@@ -130,7 +129,6 @@
|
||||
[status-im2.contexts.quo-preview.wallet.summary-info :as summary-info]
|
||||
[status-im2.contexts.quo-preview.wallet.token-input :as token-input]
|
||||
[status-im2.contexts.quo-preview.wallet.wallet-activity :as wallet-activity]
|
||||
[status-im2.contexts.quo-preview.wallet.transaction-summary :as transaction-summary]
|
||||
[status-im2.contexts.quo-preview.wallet.wallet-overview :as wallet-overview]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -211,8 +209,6 @@
|
||||
:component documenation-drawers/view}
|
||||
{:name :drawer-buttons
|
||||
:component drawer-buttons/view}
|
||||
{:name :drawer-top
|
||||
:component drawer-top/view}
|
||||
{:name :permission-drawers
|
||||
:component permission-drawers/view}]
|
||||
:dropdowns [{:name :dropdown
|
||||
@@ -391,8 +387,6 @@
|
||||
:component token-input/preview}
|
||||
{:name :wallet-activity
|
||||
:component wallet-activity/view}
|
||||
{:name :transaction-summary
|
||||
:component transaction-summary/view}
|
||||
{:name :wallet-overview
|
||||
:component wallet-overview/preview-wallet-overview}]
|
||||
:keycard [{:name :keycard-component
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
(ns status-im2.contexts.quo-preview.wallet.transaction-summary
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[quo2.foundations.resources :as quo.resources]))
|
||||
|
||||
(def asset-snt
|
||||
{:size 24
|
||||
:type :token
|
||||
:token-name "SNT"
|
||||
:amount 1500
|
||||
:token-logo (quo.resources/get-token :snt)})
|
||||
|
||||
(def asset-dai
|
||||
{:size 24
|
||||
:type :token
|
||||
:token-name "DAI"
|
||||
:amount 2400
|
||||
:token-logo (quo.resources/get-token :dai)})
|
||||
|
||||
(def asset-collectible
|
||||
{:size 24
|
||||
:type :collectible
|
||||
:collectible (resources/mock-images :collectible)
|
||||
:collectible-name "Collectible"
|
||||
:collectible-number "123"})
|
||||
|
||||
(def trip-to-vegas
|
||||
{:size 24
|
||||
:type :account
|
||||
:account-name "Trip to Vegas"
|
||||
:emoji "🤑"})
|
||||
|
||||
(def piggy-bank
|
||||
{:size 24
|
||||
:type :account
|
||||
:account-name "Piggy bank"
|
||||
:emoji "🐷"})
|
||||
|
||||
(def aretha-gosling
|
||||
{:size 24
|
||||
:type :default
|
||||
:full-name "Aretha Gosling"
|
||||
:profile-picture (resources/mock-images :user-picture-female2)})
|
||||
|
||||
(def james-bond
|
||||
{:size 24
|
||||
:type :default
|
||||
:full-name "James Bond"
|
||||
:profile-picture (resources/mock-images :user-picture-male4)})
|
||||
|
||||
(def mainnet
|
||||
{:size 24
|
||||
:type :network
|
||||
:network-logo (quo.resources/get-network :ethereum)
|
||||
:network-name "Mainnet"})
|
||||
|
||||
(def optimism
|
||||
{:size 24
|
||||
:type :network
|
||||
:network-logo (quo.resources/get-network :optimism)
|
||||
:network-name "Optimism"})
|
||||
|
||||
(def arbitrum
|
||||
{:size 24
|
||||
:type :network
|
||||
:network-logo (quo.resources/get-network :arbitrum)
|
||||
:network-name "Arbitrum"})
|
||||
|
||||
(def multinetwork
|
||||
{:size 24
|
||||
:type :multinetwork
|
||||
:networks [(quo.resources/get-network :ethereum)
|
||||
(quo.resources/get-network :arbitrum)
|
||||
(quo.resources/get-network :optimism)]})
|
||||
|
||||
(def moonpay
|
||||
{:size 24
|
||||
:type :network
|
||||
:network-logo (quo.resources/get-network :ethereum)
|
||||
:network-name "Moonpay"})
|
||||
|
||||
(def binance
|
||||
{:size 24
|
||||
:type :network
|
||||
:network-logo (quo.resources/get-network :ethereum)
|
||||
:network-name "Binance"})
|
||||
|
||||
(def context-tags
|
||||
[{:key asset-snt
|
||||
:value "SNT"}
|
||||
{:key asset-dai
|
||||
:value "UNK"}
|
||||
{:key asset-collectible
|
||||
:value "Collectible"}
|
||||
{:key trip-to-vegas
|
||||
:value "Account: Trip to Vegas"}
|
||||
{:key piggy-bank
|
||||
:value "Account: Piggy bank"}
|
||||
{:key aretha-gosling
|
||||
:value "Person: Aretha Gosling"}
|
||||
{:key james-bond
|
||||
:value "Person: James Bond"}
|
||||
{:key mainnet
|
||||
:value "Network: Mainnet"}
|
||||
{:key optimism
|
||||
:value "Network: Optimism"}
|
||||
{:key arbitrum
|
||||
:value "Network: Arbitrum"}
|
||||
{:key multinetwork
|
||||
:value "Network: Multinetwork"}
|
||||
{:key moonpay
|
||||
:value "Market: Moonpay"}
|
||||
{:key binance
|
||||
:value "Market: Binance"}])
|
||||
|
||||
(def prefixes
|
||||
[{:key :t/to
|
||||
:value "To"}
|
||||
{:key :t/in
|
||||
:value "In"}
|
||||
{:key :t/via
|
||||
:value "Via"}
|
||||
{:key :t/from
|
||||
:value "From"}
|
||||
{:key :t/on
|
||||
:value "On"}
|
||||
{:key :t/at
|
||||
:value "At"}])
|
||||
|
||||
(def descriptor
|
||||
|
||||
(concat
|
||||
[{:key :transaction
|
||||
:type :select
|
||||
:options [{:key :send}
|
||||
{:key :swap}
|
||||
{:key :bridge}]}
|
||||
{:label "Slot 1"
|
||||
:key :first-tag
|
||||
:type :select
|
||||
:options context-tags}
|
||||
{:label "Slot 2 prefix"
|
||||
:key :second-tag-prefix
|
||||
:type :select
|
||||
:options prefixes}
|
||||
{:label "Slot 2"
|
||||
:key :second-tag
|
||||
:type :select
|
||||
:options context-tags}
|
||||
{:label "Slot 3 prefix"
|
||||
:key :third-tag-prefix
|
||||
:type :select
|
||||
:options prefixes}
|
||||
{:label "Slot 3"
|
||||
:key :third-tag
|
||||
:type :select
|
||||
:options context-tags}
|
||||
{:label "Slot 4 prefix"
|
||||
:key :fourth-tag-prefix
|
||||
:type :select
|
||||
:options prefixes}
|
||||
{:label "Slot 4"
|
||||
:key :fourth-tag
|
||||
:type :select
|
||||
:options context-tags}
|
||||
{:label "Slot 5"
|
||||
:key :fifth-tag
|
||||
:type :select
|
||||
:options context-tags}
|
||||
{:key :max-fees
|
||||
:type :text}
|
||||
{:key :nonce
|
||||
:type :number}
|
||||
{:key :input-data
|
||||
:type :text}]))
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [component-state (reagent/atom {:transaction :send
|
||||
:first-tag asset-snt
|
||||
:second-tag-prefix :t/from
|
||||
:second-tag piggy-bank
|
||||
:third-tag-prefix nil
|
||||
:third-tag aretha-gosling
|
||||
:fourth-tag-prefix :t/via
|
||||
:fourth-tag mainnet
|
||||
:fifth-tag optimism
|
||||
:max-fees "€55.57"
|
||||
:nonce 26
|
||||
:input-data "Hello from Porto"})]
|
||||
(fn []
|
||||
[preview/preview-container
|
||||
{:state component-state
|
||||
:descriptor descriptor
|
||||
:show-blur-background? true
|
||||
:component-container-style {:align-self :center}}
|
||||
[quo/transaction-summary
|
||||
(merge {:on-press #(js/alert "Dropdown pressed")}
|
||||
@component-state)]])))
|
||||
@@ -51,12 +51,10 @@
|
||||
(let [~args [sub-name#]]
|
||||
(restore-app-db
|
||||
(fn []
|
||||
;; Do not warn about subscriptions being used in non-reactive contexts.
|
||||
(with-redefs [re-frame.interop/debug-enabled? false]
|
||||
~@(clojure.walk/postwalk-replace
|
||||
{'cljs.test/testing `testing-subscription
|
||||
'testing `testing-subscription}
|
||||
body))))))))
|
||||
~@(clojure.walk/postwalk-replace
|
||||
{'cljs.test/testing `testing-subscription
|
||||
'testing `testing-subscription}
|
||||
body)))))))
|
||||
|
||||
(defmacro use-log-fixture
|
||||
"Register log fixture which allows inspecting all calls to `taoensso.timbre/log`.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.166.8",
|
||||
"commit-sha1": "eda1f5482b371ffa72c1ee87f77a229546d9c842",
|
||||
"src-sha256": "16b4wkph3kqngxlfwwsvssmlyvyikvbmg87vw32gpg7yqrf36xyl"
|
||||
"version": "v0.166.9+hotfix.1",
|
||||
"commit-sha1": "7e9ceea743bf1766c1eb40024342d92a0e93ad9e",
|
||||
"src-sha256": "0zj1f2pmjfk4nhdlbm3b6k2xx6n5rd1lqvfmca77cnf6jl2cg5qd"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import random
|
||||
import time
|
||||
from datetime import timedelta
|
||||
|
||||
import emoji
|
||||
@@ -890,7 +891,6 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
channel_1_element.click()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.xfail(reason="Message can be missed after unblock: https://github.com/status-im/status-mobile/issues/16873")
|
||||
@marks.testrail_id(702894)
|
||||
def test_community_contact_block_unblock_offline(self):
|
||||
for i, channel in enumerate([self.channel_1, self.channel_2]):
|
||||
|
||||
@@ -382,7 +382,7 @@ class TestActivityMultipleDevicePRTwo(MultipleSharedDeviceTestCase):
|
||||
self.home_2.chats_tab.click()
|
||||
self.chat_2 = self.home_2.get_chat(self.username_1).click()
|
||||
self.chat_2.chat_element_by_text(community_name).view_community_button.wait_and_click(sec=60)
|
||||
self.community_2.join_community(open_community=False)
|
||||
self.community_2.join_community()
|
||||
for home in self.home_1, self.home_2:
|
||||
home.navigate_back_to_home_view()
|
||||
home.communities_tab.click()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.2 KiB |
@@ -359,7 +359,7 @@ class HomeView(BaseView):
|
||||
if self.toast_content_element.is_element_displayed(10):
|
||||
self.toast_content_element.wait_for_invisibility_of_element()
|
||||
if self.notifications_unread_badge.is_element_displayed(30):
|
||||
self.open_activity_center_button.click_until_presence_of_element(self.close_activity_centre)
|
||||
self.open_activity_center_button.click()
|
||||
chat_element = ActivityCenterElement(self.driver, username[:25])
|
||||
try:
|
||||
if action == 'accept':
|
||||
|
||||
@@ -697,7 +697,6 @@
|
||||
"Sorry the code was incorrect, please enter it again"
|
||||
],
|
||||
"initialization": "Initialization",
|
||||
"input-data": "Input data",
|
||||
"install": "↓ Install",
|
||||
"intro-message1": "Welcome to Status!\nTap this message to set your password and get started.",
|
||||
"intro-privacy-policy-note1": "Status does not collect or profit from your personal data. By continuing, you agree with the ",
|
||||
@@ -1832,7 +1831,6 @@
|
||||
"pinned-by": "Pinned by",
|
||||
"pin-limit-reached": "Pin limit reached. Unpin a previous message first.",
|
||||
"max-fee": "Max fee",
|
||||
"max-fees": "Max fees",
|
||||
"max-priority-fee": "Max priority fee",
|
||||
"miners-higher-fee": "Miners will likely inlcude your transaction earlier if you pay a higher fee.",
|
||||
"gas-amount-limit": "Gas amount limit",
|
||||
|
||||
Reference in New Issue
Block a user