Compare commits

..
8 changed files with 12 additions and 113 deletions
-57
View File
@@ -1,57 +0,0 @@
(ns quo2.components.counter
(:require [quo.theme :as theme]
[quo.react-native :as rn]
[quo2.components.text :as text]
[quo2.foundations.colors :as colors]))
(def themes
{:light {:default colors/primary-50
:secondary colors/black-opa-5
:grey colors/neutral-30}
:dark {:default colors/primary-60
:secondary colors/white-opa-10
:grey colors/neutral-70}})
(defn get-color [key]
(get-in themes [(theme/get-theme) key]))
(defn counter
"type: default, secondary, grey
outline: true, false
value: integer"
[{:keys [type outline]} value]
(let [type (or type :default)
text-color (if (or
(= (theme/get-theme) :dark)
(and
(= type :default)
(not outline)))
colors/white
colors/black)
value (if (integer? value)
value
(js/parseInt value))
label (if (> value 99)
"99+"
(str value))
width (case (count label)
1 16
2 20
28)]
[rn/view {:style (cond-> {:align-items :center
:justify-content :center
:border-radius 6
:width width
:height 16}
outline
(merge {:border-width 1
:border-color (get-color (or type :default))})
(not outline)
(assoc :background-color (get-color (or type :default)))
(> value 99)
(assoc :padding-left 0.5))}
[text/text {:weight :medium
:size :label
:style {:color text-color}} label]]))
+2 -2
View File
@@ -18,7 +18,7 @@
(def label {:font-size 11
:line-height 15.62
:letter-spacing -0.055})
:letter-spacing 0.5})
(def font-regular {:font-family "Inter-Regular"}) ; 400
@@ -28,4 +28,4 @@
(def font-bold {:font-family "Inter-Bold"}) ; 700
(def monospace {:font-family "InterStatus-Regular"})
(def monospace {:font-family "InterStatus-Regular"})
-40
View File
@@ -1,40 +0,0 @@
(ns quo2.screens.counter
(:require [quo.react-native :as rn]
[quo.previews.preview :as preview]
[reagent.core :as reagent]
[quo2.components.counter :as quo2]
[quo.design-system.colors :as colors]))
(def descriptor [{:label "Type:"
:key :type
:type :select
:options [{:key :default
:value "Default"}
{:key :secondary
:value "Secondary"}
{:key :grey
:value "Gray"}]}
{:label "Outline?:"
:key :outline
:type :boolean}
{:label "Value"
:key :value
:type :text}])
(defn cool-preview []
(let [state (reagent/atom {:value 5 :type :default})]
(fn []
[rn/view {:margin-bottom 50
:padding 16}
[preview/customizer state descriptor]
[rn/view {:padding-vertical 60
:align-items :center}
[quo2/counter @state (:value @state)]]])))
(defn preview-counter []
[rn/view {:background-color (:ui-background @colors/theme)
:flex 1}
[rn/flat-list {:flex 1
:keyboardShouldPersistTaps :always
:header [cool-preview]
:key-fn str}]])
+2 -6
View File
@@ -6,7 +6,6 @@
[quo2.screens.button :as button]
[quo2.screens.text :as text]
[quo2.screens.tabs :as tabs]
[quo2.screens.counter :as counter]
[quo2.screens.segmented :as segmented]
[quo.core :as quo]))
@@ -21,10 +20,7 @@
:component tabs/preview-tabs}
{:name :quo2-segmented
:insets {:top false}
:component segmented/preview-segmented}
{:name :quo2-counter
:insets {:top false}
:component counter/preview-counter}])
:component segmented/preview-segmented}])
(defn theme-switcher []
[rn/view {:style {:flex-direction :row
@@ -64,4 +60,4 @@
(def main-screens [{:name :quo2-preview
:insets {:top false}
:component main-screen}])
:component main-screen}])
+1 -1
View File
@@ -143,13 +143,13 @@
{:events [::initialize-wallet]}
[{:keys [db] :as cofx} accounts tokens custom-tokens
favourites scan-all-tokens? new-account?]
(check-invalid-ens cofx)
(fx/merge
cofx
{:db (assoc db :multiaccount/accounts
(rpc->accounts accounts))
;; NOTE: Local notifications should be enabled only after wallet was started
::enable-local-notifications nil}
(check-invalid-ens)
(wallet/initialize-tokens tokens custom-tokens)
(wallet/initialize-favourites favourites)
(wallet/get-pending-transactions)
+1 -1
View File
@@ -28,7 +28,7 @@ pytest_config_global = dict()
test_suite_data = TestSuiteData()
appium_container = AppiumContainer()
common_password = 'qwerty1234'
common_password = 'qwerty'
unique_password = 'unique' + get_current_time()
pin = '121212'
puk = '000000000000'
@@ -187,14 +187,14 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
error = "Can create multiaccount when"
self.sign_in.just_fyi('Checking case when %s' % cases[0])
self.sign_in.create_password_input.send_keys('12345677')
self.sign_in.create_password_input.send_keys('123456')
self.sign_in.next_button.click()
if self.sign_in.maybe_later_button.is_element_displayed(10):
self.driver.fail('%s %s' % (error, cases[0]))
self.sign_in.just_fyi('Checking case when %s' % cases[1])
self.sign_in.create_password_input.send_keys('12345677')
[field.send_keys('12345677') for field in (self.sign_in.create_password_input, self.sign_in.confirm_your_password_input)]
self.sign_in.create_password_input.send_keys('123456')
[field.send_keys('123456') for field in (self.sign_in.create_password_input, self.sign_in.confirm_your_password_input)]
self.sign_in.confirm_your_password_input.delete_last_symbols(1)
self.sign_in.create_password_input.delete_last_symbols(1)
self.sign_in.next_button.click()
@@ -202,8 +202,8 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.driver.fail('%s %s' % (error, cases[1]))
self.sign_in.just_fyi("Checking case %s" % cases[2])
self.sign_in.create_password_input.send_keys('12345654')
self.sign_in.confirm_your_password_input.send_keys('12345677')
self.sign_in.create_password_input.send_keys('1234565')
self.sign_in.confirm_your_password_input.send_keys('1234567')
if not self.sign_in.element_by_translation_id("password_error1").is_element_displayed():
self.errors.append("'%s' is not shown" % self.sign_in.get_translation_by_key("password_error1"))
self.sign_in.create_password_input.set_value(common_password)
@@ -94,7 +94,7 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.just_fyi("Checking basic validation when adding multiaccount")
if self.wallet.get_account_by_name(account_name).is_element_displayed():
self.drivers[0].fail('Account is added without password')
self.wallet.enter_your_password_input.send_keys('00000000')
self.wallet.enter_your_password_input.send_keys('000000')
self.wallet.add_account_generate_account_button.click()
if not self.wallet.element_by_text_part('Password seems to be incorrect').is_element_displayed():
self.drivers[0].fail("Incorrect password validation is not performed")