-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
231 changed files
with
3,657 additions
and
3,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ The team members for the initial wallet team are: | |
- @ulisesmac | ||
- @erikseppanen | ||
- @mmilad75 | ||
- @tumanov-alex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/quo2/components/buttons/wallet_button/component_spec.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(ns quo2.components.buttons.wallet-button.component-spec | ||
(:require [quo2.components.buttons.wallet-button.view :as wallet-button] | ||
[test-helpers.component :as h])) | ||
|
||
(h/describe "button tests" | ||
(h/test "default render of wallet button component" | ||
(h/render [wallet-button/view | ||
{:icon :i/placeholder | ||
:accessibility-label "test-button"}]) | ||
(h/is-truthy (h/get-by-label-text "test-button"))) | ||
|
||
(h/test "button on-press works" | ||
(let [event (h/mock-fn)] | ||
(h/render [wallet-button/view | ||
{:icon :i/placeholder | ||
:on-press event | ||
:accessibility-label "test-button"}]) | ||
(h/fire-event :press (h/get-by-label-text "test-button")) | ||
(h/was-called event))) | ||
|
||
(h/test "button on-press disabled when disabled" | ||
(let [event (h/mock-fn)] | ||
(h/render [wallet-button/view | ||
{:icon :i/placeholder | ||
:on-press event | ||
:accessibility-label "test-button" | ||
:disabled? true}]) | ||
(h/fire-event :press (h/get-by-label-text "test-button")) | ||
(h/was-not-called event))) | ||
|
||
(h/test "button on-long-press works" | ||
(let [event (h/mock-fn)] | ||
(h/render [wallet-button/view | ||
{:icon :i/placeholder | ||
:on-long-press event | ||
:accessibility-label "test-button"}]) | ||
(h/fire-event :long-press (h/get-by-label-text "test-button")) | ||
(h/was-called event)))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(ns quo2.components.buttons.wallet-button.style | ||
(:require [quo2.foundations.colors :as colors])) | ||
|
||
(defn get-border-color | ||
[{:keys [pressed? theme]}] | ||
(if (= pressed? true) | ||
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme) | ||
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))) | ||
|
||
(defn main | ||
[{:keys [pressed? theme disabled?]}] | ||
{:border-color (get-border-color {:pressed? pressed? | ||
:theme theme}) | ||
:border-width 1 | ||
:border-radius 10 | ||
:width 32 | ||
:height 32 | ||
:justify-content :center | ||
:align-items :center | ||
:opacity (when disabled? 0.3)}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(ns quo2.components.buttons.wallet-button.view | ||
(:require | ||
[quo2.components.buttons.wallet-button.style :as style] | ||
[quo2.components.icon :as quo2.icons] | ||
[quo2.foundations.colors :as colors] | ||
[quo2.theme :as theme] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent])) | ||
|
||
(defn- view-internal | ||
[] | ||
(let [pressed? (reagent/atom false)] | ||
(fn | ||
[{:keys [on-press on-long-press disabled? icon accessibility-label container-style theme]}] | ||
[rn/pressable | ||
{:accessibility-label (or accessibility-label :wallet-button) | ||
:on-press on-press | ||
:on-press-in #(reset! pressed? true) | ||
:on-press-out #(reset! pressed? nil) | ||
:on-long-press on-long-press | ||
:disabled disabled? | ||
:style (merge (style/main {:pressed? @pressed? | ||
:theme theme | ||
:disabled? disabled?}) | ||
container-style)} | ||
[quo2.icons/icon icon | ||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)}]]))) | ||
|
||
(def view (theme/with-theme view-internal)) |
11 changes: 11 additions & 0 deletions
11
src/quo2/components/buttons/wallet_ctas/component_spec.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns quo2.components.buttons.wallet-ctas.component-spec | ||
(:require [test-helpers.component :as h] | ||
[quo2.components.buttons.wallet-ctas.view :as wallet-ctas])) | ||
|
||
(h/describe "Wallet CTAs test" | ||
(h/test "Buttons render" | ||
(h/render [wallet-ctas/view]) | ||
(h/is-truthy (h/get-by-label-text :buy)) | ||
(h/is-truthy (h/get-by-label-text :send)) | ||
(h/is-truthy (h/get-by-label-text :receive)) | ||
(h/is-truthy (h/get-by-label-text :bridge)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns quo2.components.buttons.wallet-ctas.style) | ||
|
||
(def container | ||
{:padding-top 24 | ||
:padding-bottom 12 | ||
:padding-horizontal 20 | ||
:flex-direction :row | ||
:justify-content :center | ||
:flex 1 | ||
:max-height 106}) | ||
|
||
(def button-container | ||
{:padding-vertical 8 | ||
:width 77.75 | ||
:justify-content :center | ||
:align-items :center}) |
Oops, something went wrong.