Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04a8ae9959 | ||
|
|
5148a3c748 | ||
|
|
8701f3545d | ||
|
|
26eeb43569 | ||
|
|
4d7b1baace | ||
|
|
89c2b1c818 | ||
|
|
17df7a0d35 | ||
|
|
0552713143 | ||
|
|
3223c71526 | ||
|
|
914604bbe4 | ||
|
|
821e39a562 | ||
|
|
4cef868eab | ||
|
|
34f7a48503 |
@@ -27,3 +27,4 @@ The team members for the initial wallet team are:
|
||||
- @ulisesmac
|
||||
- @erikseppanen
|
||||
- @mmilad75
|
||||
- @tumanov-alex
|
||||
|
||||
@@ -15,19 +15,11 @@ rec {
|
||||
];
|
||||
|
||||
inputsFrom = [
|
||||
release
|
||||
(release {})
|
||||
androidShell
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||
|
||||
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
|
||||
|
||||
# required by some makefile targets
|
||||
export STATUS_GO_ANDROID_LIBDIR=${status-go}
|
||||
|
||||
# check if node modules changed and if so install them
|
||||
$STATUS_MOBILE_HOME/nix/scripts/node_modules.sh ${deps.nodejs-patched}
|
||||
'';
|
||||
|
||||
@@ -30,6 +30,9 @@ let
|
||||
# Pass secretsFile for POKT_TOKEN to jsbundle build
|
||||
builtJsBundle = jsbundle { inherit secretsFile; };
|
||||
|
||||
# Map ANDROID_ABI_INCLUDE to status-go targets
|
||||
androidAbiIncludeSplit = lib.splitString ";" androidAbiInclude;
|
||||
|
||||
|
||||
envFileName =
|
||||
if androidAbiInclude == "x86" then ".env.e2e"
|
||||
@@ -77,20 +80,25 @@ in stdenv.mkDerivation rec {
|
||||
ANDROID_ABI_SPLIT = androidAbiSplit;
|
||||
ANDROID_ABI_INCLUDE = androidAbiInclude;
|
||||
|
||||
# Android SDK/NDK for use by Gradle
|
||||
ANDROID_SDK_ROOT = "${androidPkgs.sdk}";
|
||||
ANDROID_NDK_ROOT = "${androidPkgs.ndk}";
|
||||
|
||||
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
|
||||
NODE_OPTIONS = "--openssl-legacy-provider";
|
||||
|
||||
# Used by the Android Gradle build script in android/build.gradle
|
||||
STATUS_GO_ANDROID_LIBDIR = status-go;
|
||||
|
||||
phases = [
|
||||
"unpackPhase" "secretsPhase" "buildPhase" "checkPhase" "installPhase"
|
||||
"shellHook" "unpackPhase" "secretsPhase" "buildPhase" "checkPhase" "installPhase"
|
||||
];
|
||||
|
||||
# We use shellHook as a single place to setup env vars for both build derivation and shell
|
||||
shellHook = ''
|
||||
# Used by the Android Gradle build script in android/build.gradle
|
||||
export STATUS_GO_ANDROID_LIBDIR=${ status-go { abis = androidAbiIncludeSplit; } }
|
||||
|
||||
# Android SDK/NDK for use by Gradle
|
||||
export ANDROID_SDK_ROOT="${androidPkgs.sdk}"
|
||||
export ANDROID_NDK_ROOT="${androidPkgs.ndk}"
|
||||
|
||||
export STATUS_NIX_MAVEN_REPO="${deps.gradle}"
|
||||
'';
|
||||
|
||||
unpackPhase = ''
|
||||
cp -ar $src/. ./
|
||||
chmod u+w -R ./
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ let
|
||||
# helpers for use with target argument
|
||||
ios = targets.mobile.ios.shell;
|
||||
android = targets.mobile.android.shell;
|
||||
status-go = targets.status-go.mobile.android;
|
||||
status-go = targets.status-go.mobile.android {};
|
||||
};
|
||||
|
||||
# for merging the default shell with others
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
{ callPackage, meta, source, goBuildLdFlags }:
|
||||
|
||||
{
|
||||
android = callPackage ./build.nix {
|
||||
android = {abis ? [ "armeabi-v7a" "arm64-v8a" "x86" ]}: callPackage ./build.nix {
|
||||
platform = "android";
|
||||
platformVersion = "23";
|
||||
targets = [ "android/arm" "android/arm64" "android/386" ];
|
||||
# Hide different arch naming in gomobile from Android builds.
|
||||
targets = let
|
||||
abiMap = {
|
||||
"armeabi-v7a" = "android/arm";
|
||||
"arm64-v8a" = "android/arm64";
|
||||
"x86" = "android/386";
|
||||
"x86_64" = "android/amd64";
|
||||
};
|
||||
in map (arch: abiMap."${arch}") abis;
|
||||
outputFileName = "status-go-${source.shortRev}.aar";
|
||||
inherit meta source goBuildLdFlags;
|
||||
};
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -4,7 +4,10 @@
|
||||
{:padding-top 24
|
||||
:padding-bottom 12
|
||||
:padding-horizontal 20
|
||||
:flex-direction :row})
|
||||
:flex-direction :row
|
||||
:justify-content :center
|
||||
:flex 1
|
||||
:max-height 106})
|
||||
|
||||
(def button-container
|
||||
{:padding-vertical 8
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
(ns quo2.components.dividers.divider-label
|
||||
(:require [quo2.components.icon :as icons]
|
||||
[quo2.components.markdown.text :as markdown.text]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(def chevron-icon-container-width 20)
|
||||
|
||||
(def chevron-icon-container-height 20)
|
||||
|
||||
(defn themed-view
|
||||
"label -> string
|
||||
chevron-position -> :left, :right
|
||||
chevron-icon -> keyword
|
||||
on-press -> function
|
||||
padding-bottom -> number
|
||||
counter-value -> number
|
||||
increase-padding-top? -> boolean
|
||||
blur? -> boolean
|
||||
theme -> theme value passed from with-theme HOC"
|
||||
[{:keys [label
|
||||
chevron-position
|
||||
chevron-icon
|
||||
counter-value
|
||||
increase-padding-top?
|
||||
padding-bottom
|
||||
blur?
|
||||
container-style
|
||||
on-press
|
||||
theme]}]
|
||||
(let [dark? (= :dark theme)
|
||||
border-and-counter-bg-color (if dark?
|
||||
(if blur? colors/white-opa-5 colors/neutral-70)
|
||||
colors/neutral-10)
|
||||
padding-top (if increase-padding-top? 16 8)
|
||||
text-and-icon-color (if dark? colors/neutral-40 colors/neutral-50)
|
||||
counter-text-color (if dark? colors/white colors/neutral-100)]
|
||||
[rn/touchable-without-feedback {:on-press on-press}
|
||||
[rn/view
|
||||
{:accessible true
|
||||
:accessibility-label :divider-label
|
||||
:style (merge {:border-top-width 1
|
||||
:border-top-color border-and-counter-bg-color
|
||||
:padding-top padding-top
|
||||
:padding-bottom padding-bottom
|
||||
:padding-left 16
|
||||
:padding-right 16
|
||||
:align-items :center
|
||||
:flex-direction :row}
|
||||
container-style)}
|
||||
(when (= chevron-position :left)
|
||||
[rn/view
|
||||
{:test-ID :divider-label-icon-left
|
||||
:style {:margin-right 4}}
|
||||
[icons/icon
|
||||
(or chevron-icon :i/chevron-down)
|
||||
{:color text-and-icon-color
|
||||
:width chevron-icon-container-width
|
||||
:height chevron-icon-container-height}]])
|
||||
[markdown.text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style {:color text-and-icon-color
|
||||
:flex 1}}
|
||||
label]
|
||||
(when (= chevron-position :right)
|
||||
[rn/view {:test-ID :divider-label-icon-right}
|
||||
[icons/icon
|
||||
(or chevron-icon :i/chevron-down)
|
||||
{:color text-and-icon-color
|
||||
:size chevron-icon-container-width}]])
|
||||
(when (pos? counter-value)
|
||||
[rn/view
|
||||
{:style {:border-radius 6
|
||||
:height 16
|
||||
:width (case (count counter-value)
|
||||
1 16
|
||||
2 20
|
||||
28)
|
||||
:background-color border-and-counter-bg-color
|
||||
:align-items :center
|
||||
:justify-content :center}}
|
||||
[markdown.text/text
|
||||
{:size :label
|
||||
:weight :medium
|
||||
:style {:color counter-text-color}}
|
||||
counter-value]])]]))
|
||||
|
||||
(def divider-label (theme/with-theme themed-view))
|
||||
@@ -0,0 +1,20 @@
|
||||
(ns quo2.components.dividers.divider-label.component-spec
|
||||
(:require [quo2.components.dividers.divider-label.view :as divider-label]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "Divider Label"
|
||||
(h/test "default render"
|
||||
(h/render [divider-label/view "Welcome"])
|
||||
(h/is-truthy (h/query-by-label-text :divider-label)))
|
||||
(h/test "with label"
|
||||
(h/render [divider-label/view {:tight? true} "Welcome"])
|
||||
(h/is-truthy (h/query-by-text "Welcome")))
|
||||
(h/test "with label & counter value"
|
||||
(h/render [divider-label/view {:tight? true :counter? true :counter-value 5} "Public"])
|
||||
(h/is-truthy (h/query-by-text "Public"))
|
||||
(h/is-truthy (h/query-by-text "5")))
|
||||
(h/test "on-press event"
|
||||
(let [on-press (h/mock-fn)]
|
||||
(h/render [divider-label/view {:tight? false :on-press on-press} "General"])
|
||||
(h/fire-event :press (h/query-by-label-text :divider-label))
|
||||
(h/was-called on-press))))
|
||||
@@ -0,0 +1,39 @@
|
||||
(ns quo2.components.dividers.divider-label.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn- get-border-color
|
||||
[blur? theme]
|
||||
(colors/theme-colors (if blur? colors/neutral-80-opa-5 colors/neutral-10)
|
||||
(if blur? colors/white-opa-5 colors/neutral-90)
|
||||
theme))
|
||||
|
||||
(defn get-content-color
|
||||
[blur? theme]
|
||||
(colors/theme-colors (if blur? colors/neutral-80-opa-70 colors/neutral-50)
|
||||
(if blur? colors/white-opa-70 colors/neutral-40)
|
||||
theme))
|
||||
|
||||
(defn container
|
||||
[blur? tight? chevron theme]
|
||||
{:border-top-width 1
|
||||
:border-top-color (get-border-color blur? theme)
|
||||
:padding-top (if tight? 6 14)
|
||||
:padding-bottom 7
|
||||
:padding-left (if (= :left chevron) 16 20)
|
||||
:padding-right 20
|
||||
:align-items :center
|
||||
:flex-direction :row})
|
||||
|
||||
(defn content
|
||||
[chevron]
|
||||
{:flex-direction (if (= chevron :right)
|
||||
:row-reverse
|
||||
:row)
|
||||
:align-items :center
|
||||
:height 20
|
||||
:flex 1})
|
||||
|
||||
(defn text
|
||||
[blur? theme]
|
||||
{:color (get-content-color blur? theme)
|
||||
:flex 1})
|
||||
@@ -0,0 +1,60 @@
|
||||
(ns quo2.components.dividers.divider-label.view
|
||||
(:require [quo2.components.markdown.text :as text]
|
||||
[quo2.components.dividers.divider-label.style :as style]
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.counter.counter.view :as counter]
|
||||
[quo2.components.icon :as icons]))
|
||||
|
||||
(defn- view-internal
|
||||
"Options:
|
||||
- `counter?` (default: nil) - Display a counter on the right side of the divider.
|
||||
- `counter-value` (default: nil) - Number to display if counter? is true.
|
||||
- `chevron` nil/:right/:left (default: nil) - Display a chevron on the left or right side of the divider.
|
||||
- `chevron-icon` (default: :i/chevron-right) - Icon to display when chevron is :left/:right.
|
||||
- `tight?` (default: true) - Use a tighter padding.
|
||||
- `blur?` (default: nil) - Use a blur background.
|
||||
- `theme` - Theme value from with-theme HOC.
|
||||
- `on-press` - Function called when the divider is pressed.
|
||||
- `container-style` - Style applied to the container view.
|
||||
|
||||
label - String or markdown text component to display in the divider label."
|
||||
[{:keys [counter?
|
||||
counter-value
|
||||
chevron
|
||||
chevron-icon
|
||||
tight?
|
||||
blur?
|
||||
theme
|
||||
on-press
|
||||
container-style]
|
||||
:or {tight? true}}
|
||||
label]
|
||||
[rn/pressable
|
||||
{:on-press on-press
|
||||
:accessibility-label :divider-label
|
||||
:style (merge (style/container blur? tight? chevron theme)
|
||||
container-style)}
|
||||
[rn/view
|
||||
{:style (style/content chevron)}
|
||||
(when chevron
|
||||
[icons/icon (or chevron-icon :i/chevron-right)
|
||||
{:color (style/get-content-color blur? theme)
|
||||
:container-style {(if (= chevron :right)
|
||||
:margin-left
|
||||
:margin-right)
|
||||
2}}])
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/text blur? theme)}
|
||||
label]]
|
||||
(when counter?
|
||||
[counter/view
|
||||
{:type (if blur? :secondary :grey)
|
||||
:container-style {:margin-left 2}}
|
||||
counter-value])])
|
||||
|
||||
(defn view
|
||||
([_ _] (quo.theme/with-theme view-internal))
|
||||
([label] [view {} label]))
|
||||
@@ -1,45 +0,0 @@
|
||||
(ns quo2.components.dividers.divider-label-component-spec
|
||||
(:require ["@testing-library/react-native" :as rtl]
|
||||
[quo2.components.dividers.divider-label :as divider-label]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn render-divider-label
|
||||
([]
|
||||
(render-divider-label {}))
|
||||
([opts]
|
||||
(rtl/render (reagent/as-element [divider-label/divider-label opts]))))
|
||||
|
||||
(js/global.test "default render of divider-label component"
|
||||
(fn []
|
||||
(render-divider-label)
|
||||
(-> (js/expect (rtl/screen.getByLabelText "divider-label"))
|
||||
(.toBeTruthy))))
|
||||
|
||||
(js/global.test "render divider-label component with a label"
|
||||
(fn []
|
||||
(render-divider-label {:label :hello})
|
||||
(-> (js/expect (rtl/screen.getByText "hello"))
|
||||
(.toBeTruthy))))
|
||||
|
||||
(js/global.test "render divider-label component with a counter-value"
|
||||
(fn []
|
||||
(render-divider-label {:label :hello
|
||||
:counter-value "1"})
|
||||
(-> (js/expect (rtl/screen.getByText "1"))
|
||||
(.toBeTruthy))))
|
||||
|
||||
(js/global.test "divider-label chevron icon renders to the left when set"
|
||||
(fn []
|
||||
(render-divider-label {:label :hello
|
||||
:counter-value "1"
|
||||
:chevron-position :left})
|
||||
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-left"))
|
||||
(.toBeTruthy))))
|
||||
|
||||
(js/global.test "divider-label chevron icon renders to the right when set"
|
||||
(fn []
|
||||
(render-divider-label {:label :hello
|
||||
:counter-value "1"
|
||||
:chevron-position :right})
|
||||
(-> (js/expect (rtl/screen.getByTestId "divider-label-icon-right"))
|
||||
(.toBeTruthy))))
|
||||
@@ -23,10 +23,11 @@
|
||||
:margin-horizontal 12
|
||||
:flex-direction :row})
|
||||
|
||||
(def left-icon
|
||||
(defn left-icon
|
||||
[sub-label?]
|
||||
{:height 20
|
||||
:margin-top :auto
|
||||
:margin-bottom :auto
|
||||
:margin-top (if sub-label? 10 :auto)
|
||||
:margin-bottom (when-not sub-label? :auto)
|
||||
:margin-right 12
|
||||
:width 20})
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
[rn/view
|
||||
{:accessibility-label :left-icon-for-action
|
||||
:accessible true
|
||||
:style style/left-icon}
|
||||
:style (style/left-icon sub-label)}
|
||||
[icon/icon icon
|
||||
{:color (or icon-color (get-icon-color danger? theme))
|
||||
:size 20}]]
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
(ns quo2.components.dropdowns.network-dropdown.component-spec
|
||||
(:require [quo2.components.dropdowns.network-dropdown.view :as network-dropdown]
|
||||
[quo2.foundations.resources :as quo.resources]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(def ^:private networks-list
|
||||
[{:source (quo.resources/get-network :ethereum)}
|
||||
{:source (quo.resources/get-network :optimism)}
|
||||
{:source (quo.resources/get-network :arbitrum)}])
|
||||
|
||||
(h/describe "Network dropdown"
|
||||
(h/test "default render"
|
||||
(h/render [network-dropdown/view {:state :default}
|
||||
networks-list])
|
||||
(h/is-truthy (h/query-by-label-text :network-dropdown)))
|
||||
|
||||
(h/test "Should call :on-press in enabled state"
|
||||
(let [on-press (h/mock-fn)]
|
||||
(h/render [network-dropdown/view
|
||||
{:state :default
|
||||
:on-press on-press}
|
||||
networks-list])
|
||||
(h/is-truthy (h/query-by-label-text :network-dropdown))
|
||||
(h/fire-event :press (h/query-by-label-text :network-dropdown))
|
||||
(h/was-called on-press)))
|
||||
|
||||
(h/test "Should not call :on-press in disabled state"
|
||||
(let [on-press (h/mock-fn)]
|
||||
(h/render [network-dropdown/view
|
||||
{:state :disabled
|
||||
:on-press on-press}
|
||||
networks-list])
|
||||
(h/is-truthy (h/query-by-label-text :network-dropdown))
|
||||
(h/fire-event :press (h/query-by-label-text :network-dropdown))
|
||||
(h/was-not-called on-press))))
|
||||
@@ -0,0 +1,24 @@
|
||||
(ns quo2.components.dropdowns.network-dropdown.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn container-border-color
|
||||
[{:keys [state blur? theme pressed?]}]
|
||||
(let [default-color (if blur?
|
||||
colors/neutral-80-opa-5
|
||||
(colors/theme-colors colors/neutral-30 colors/neutral-70 theme))
|
||||
active-color (if blur?
|
||||
colors/neutral-80-opa-10
|
||||
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme))]
|
||||
(condp = state
|
||||
:disabled default-color
|
||||
:default (if pressed? active-color default-color))))
|
||||
|
||||
(defn dropdown-container
|
||||
[{:keys [state] :as props}]
|
||||
{:border-width 1
|
||||
:border-radius 10
|
||||
:padding-horizontal 8
|
||||
:padding-vertical 6
|
||||
:opacity (if (= state :disabled) 0.3 1)
|
||||
:border-color (container-border-color props)
|
||||
:align-items :center})
|
||||
@@ -0,0 +1,26 @@
|
||||
(ns quo2.components.dropdowns.network-dropdown.view
|
||||
(:require [quo2.theme :as quo.theme]
|
||||
[quo2.components.dropdowns.network-dropdown.style :as style]
|
||||
[react-native.core :as rn]
|
||||
[quo2.components.list-items.preview-list :as preview-list]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn- internal-view
|
||||
[_ _]
|
||||
(let [pressed? (reagent/atom false)]
|
||||
(fn
|
||||
[{:keys [on-press state] :as props} networks]
|
||||
[rn/pressable
|
||||
{:style (style/dropdown-container (merge props {:pressed? @pressed?}))
|
||||
:accessibility-label :network-dropdown
|
||||
:disabled (= state :disabled)
|
||||
:on-press on-press
|
||||
:on-press-in (fn [] (reset! pressed? true))
|
||||
:on-press-out (fn [] (reset! pressed? false))}
|
||||
[preview-list/preview-list
|
||||
{:type :network
|
||||
:list-size (count networks)
|
||||
:size 20}
|
||||
networks]])))
|
||||
|
||||
(def view (quo.theme/with-theme internal-view))
|
||||
@@ -24,3 +24,8 @@
|
||||
{:color colors/white}))
|
||||
|
||||
(def button-container {:margin-top 20})
|
||||
|
||||
(def image-placeholder
|
||||
{:width 80
|
||||
:height 80
|
||||
:background-color colors/danger})
|
||||
|
||||
@@ -7,14 +7,16 @@
|
||||
[quo2.theme :as theme]))
|
||||
|
||||
(defn- empty-state-internal
|
||||
[{:keys [customization-color image title description blur?]
|
||||
[{:keys [customization-color image title description blur? placeholder? container-style]
|
||||
upper-button :upper-button
|
||||
lower-button :lower-button
|
||||
:or {customization-color :blue}}]
|
||||
[rn/view {:style styles/container}
|
||||
[fast-image/fast-image
|
||||
{:style styles/image
|
||||
:source image}]
|
||||
[rn/view {:style (merge styles/container container-style)}
|
||||
(if placeholder?
|
||||
[rn/view {:style styles/image-placeholder}]
|
||||
[fast-image/fast-image
|
||||
{:style styles/image
|
||||
:source image}])
|
||||
[rn/view {:style styles/text-container}
|
||||
[text/text
|
||||
{:style (styles/title blur?)
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(def gradient-background
|
||||
{:height 294
|
||||
:justify-content :flex-end})
|
||||
{:height 294
|
||||
:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0})
|
||||
|
||||
(def x-axis-label-text-style ; We need this to remove unnecessary bottom spacing from graph
|
||||
{:margin-bottom -3
|
||||
|
||||
@@ -37,11 +37,12 @@
|
||||
:style style/illustration}
|
||||
[text/text {:style {:color colors/white}}
|
||||
"Illustration here"]]
|
||||
[linear-gradient/linear-gradient
|
||||
{:colors gradient-colors
|
||||
:start {:x 0 :y 1}
|
||||
:end {:x 0 :y 0}
|
||||
:style style/gradient-background}
|
||||
[rn/view
|
||||
[linear-gradient/linear-gradient
|
||||
{:colors gradient-colors
|
||||
:start {:x 0 :y 1}
|
||||
:end {:x 0 :y 0}
|
||||
:style style/gradient-background}]
|
||||
[rn/view {:accessibility-label :line-chart}
|
||||
[charts/line-chart
|
||||
{:height 96
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
(ns quo2.components.list-items.dapp.component-spec
|
||||
(:require [quo2.components.list-items.dapp.view :as dapp]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(def props
|
||||
{:dapp {:avatar nil
|
||||
:name "Coingecko"
|
||||
:value "coingecko.com"}
|
||||
:state :default
|
||||
:action :icon
|
||||
:blur? false
|
||||
:customization-color :blue})
|
||||
|
||||
(h/describe
|
||||
"dApp component test"
|
||||
(h/test "default render"
|
||||
(h/render [dapp/view props])
|
||||
(h/is-truthy (h/get-by-text (:name (:dapp props))))
|
||||
(h/is-truthy (h/get-by-text (:value (:dapp props)))))
|
||||
(h/test "on-press event"
|
||||
(let [mock-fn (h/mock-fn)]
|
||||
(h/render [dapp/view (assoc props :on-press-icon mock-fn)])
|
||||
(h/fire-event :press (h/get-by-test-id "dapp-component-icon"))
|
||||
(h/was-called mock-fn))))
|
||||
@@ -0,0 +1,47 @@
|
||||
(ns quo2.components.list-items.dapp.style
|
||||
(:require [quo2.foundations.colors :as colors]))
|
||||
|
||||
(defn get-background-color
|
||||
[{:keys [pressed? state blur? customization-color theme]}]
|
||||
(cond
|
||||
(and pressed? (= theme :dark) blur?) colors/white-opa-5
|
||||
|
||||
pressed? (colors/theme-colors
|
||||
(colors/custom-color customization-color 50 5)
|
||||
(colors/custom-color customization-color 60 5)
|
||||
theme)
|
||||
|
||||
(and (= state :active) (= theme :dark) blur?) colors/white-opa-10
|
||||
|
||||
(= state :active) (colors/theme-colors
|
||||
(colors/custom-color customization-color 50 10)
|
||||
(colors/custom-color customization-color 60 10)
|
||||
theme)
|
||||
|
||||
:else :transparent))
|
||||
|
||||
(defn container
|
||||
[props]
|
||||
{:flex 1
|
||||
:padding-horizontal 12
|
||||
:padding-vertical 8
|
||||
:border-radius 12
|
||||
:background-color (get-background-color props)
|
||||
:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:align-items :center})
|
||||
|
||||
(def container-info
|
||||
{:flex-direction :row
|
||||
:align-items :center})
|
||||
|
||||
(def user-info
|
||||
{:margin-left 8})
|
||||
|
||||
(defn style-text-name
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||
|
||||
(defn style-text-value
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-50 colors/white theme)})
|
||||
@@ -0,0 +1,47 @@
|
||||
(ns quo2.components.list-items.dapp.view
|
||||
(:require [quo2.components.icon :as icons]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[react-native.fast-image :as fast-image]
|
||||
[quo2.components.list-items.dapp.style :as style]
|
||||
[quo2.theme :as quo.theme]
|
||||
[reagent.core :as reagent]))
|
||||
|
||||
(defn- view-internal
|
||||
[]
|
||||
(let [pressed? (reagent/atom false)]
|
||||
(fn [{:keys [dapp action on-press on-press-icon theme] :as props}]
|
||||
[rn/pressable
|
||||
{:style (style/container (assoc props :pressed? @pressed?))
|
||||
:on-press on-press
|
||||
:on-press-in #(reset! pressed? true)
|
||||
:on-press-out #(reset! pressed? false)}
|
||||
[rn/view {:style style/container-info}
|
||||
[fast-image/fast-image
|
||||
{:source (:avatar dapp)
|
||||
:style {:width 32 :height 32}}]
|
||||
[rn/view {:style style/user-info}
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-1
|
||||
:style (style/style-text-name theme)}
|
||||
(:name dapp)]
|
||||
[text/text
|
||||
{:weight :regular
|
||||
:size :paragraph-2
|
||||
:style (style/style-text-value theme)}
|
||||
(:value dapp)]]]
|
||||
(when (= action :icon)
|
||||
[rn/pressable
|
||||
{:on-press on-press-icon
|
||||
:testID "dapp-component-icon"}
|
||||
[icons/icon :i/options
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)
|
||||
:accessibility-label :icon}]])])))
|
||||
|
||||
(def view
|
||||
(quo.theme/with-theme view-internal))
|
||||
@@ -21,6 +21,12 @@
|
||||
:hole-size 26
|
||||
:hole-x 19
|
||||
:hole-y -1}
|
||||
20 {:border-radius {:circular 10 :rounded 8}
|
||||
:hole-radius {:circular 11 :rounded 9}
|
||||
:margin-left -4
|
||||
:hole-size 22
|
||||
:hole-x 15
|
||||
:hole-y -1}
|
||||
16 {:border-radius {:circular 8 :rounded 8}
|
||||
:hole-radius {:circular 9 :rounded 9}
|
||||
:margin-left -4
|
||||
@@ -32,19 +38,19 @@
|
||||
(defn avatar
|
||||
[item type size border-radius]
|
||||
(case type
|
||||
:user [user-avatar/user-avatar
|
||||
(merge {:ring? false
|
||||
:status-indicator? false
|
||||
:size (case size
|
||||
32 :small
|
||||
24 :xs
|
||||
16 :xxxs)}
|
||||
item)]
|
||||
(:photo :collectible) [fast-image/fast-image
|
||||
{:source (:source item)
|
||||
:style {:width size
|
||||
:height size
|
||||
:border-radius border-radius}}]))
|
||||
:user [user-avatar/user-avatar
|
||||
(merge {:ring? false
|
||||
:status-indicator? false
|
||||
:size (case size
|
||||
32 :small
|
||||
24 :xs
|
||||
16 :xxxs)}
|
||||
item)]
|
||||
(:photo :collectible :network) [fast-image/fast-image
|
||||
{:source (:source item)
|
||||
:style {:width size
|
||||
:height size
|
||||
:border-radius border-radius}}]))
|
||||
|
||||
(defn list-item
|
||||
[index type size item list-size margin-left
|
||||
@@ -115,7 +121,7 @@
|
||||
(defn- preview-list-internal
|
||||
"[preview-list opts items]
|
||||
opts
|
||||
{:type :user/:community/:account/:token/:collectible/:dapp
|
||||
{:type :user/:community/:account/:token/:collectible/:dapp/:network
|
||||
:size 32/24/16
|
||||
:list-size override items count in overflow label (optional)
|
||||
:transparent? overflow-label transparent?}
|
||||
|
||||
@@ -6,22 +6,26 @@
|
||||
:flex-direction :row
|
||||
:align-items :center})
|
||||
|
||||
(def middle-dot-nickname
|
||||
{:color colors/neutral-50
|
||||
(defn middle-dot-nickname
|
||||
[]
|
||||
{:color (colors/theme-colors colors/neutral-40 colors/neutral-50)
|
||||
:margin-horizontal 4})
|
||||
|
||||
(def chat-key-text
|
||||
{:color colors/neutral-50
|
||||
(defn chat-key-text
|
||||
[]
|
||||
{:color (colors/theme-colors colors/neutral-40 colors/neutral-50)
|
||||
:margin-left 8})
|
||||
|
||||
(def middle-dot-chat-key
|
||||
{:color colors/neutral-50
|
||||
(defn middle-dot-chat-key
|
||||
[]
|
||||
{:color (colors/theme-colors colors/neutral-40 colors/neutral-50)
|
||||
:margin-left 4})
|
||||
|
||||
(def icon-container
|
||||
{:margin-left 4})
|
||||
|
||||
(defn time-text
|
||||
[ens?]
|
||||
{:color colors/neutral-50
|
||||
:margin-left (if ens? 8 4)})
|
||||
[verified?]
|
||||
{:color (colors/theme-colors colors/neutral-40 colors/neutral-50)
|
||||
:padding-top 1
|
||||
:margin-left (if verified? 8 4)})
|
||||
|
||||
@@ -9,26 +9,33 @@
|
||||
(def middle-dot "·")
|
||||
|
||||
(defn author
|
||||
[{:keys [primary-name secondary-name style short-chat-key time-str contact? verified? untrustworthy?]}]
|
||||
[{:keys [primary-name secondary-name style short-chat-key time-str contact? verified? untrustworthy?
|
||||
muted? size]
|
||||
:or {size 13}}]
|
||||
[rn/view {:style (merge style/container style)}
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-2
|
||||
:number-of-lines 1
|
||||
:style {:color (colors/theme-colors colors/neutral-100 colors/white)}}
|
||||
{:weight :semi-bold
|
||||
:size (if (= size 15) :paragraph-1 :paragraph-2)
|
||||
:number-of-lines 1
|
||||
:accessibility-label :author-primary-name
|
||||
:style {:color (if muted?
|
||||
colors/neutral-50
|
||||
(colors/theme-colors colors/neutral-100 colors/white))}}
|
||||
primary-name]
|
||||
(when (not (string/blank? secondary-name))
|
||||
[:<>
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
{:size :label
|
||||
:number-of-lines 1
|
||||
:style style/middle-dot-nickname}
|
||||
:style (style/middle-dot-nickname)}
|
||||
middle-dot]
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-2
|
||||
:number-of-lines 1
|
||||
:style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}}
|
||||
{:weight :medium
|
||||
:size :label
|
||||
:number-of-lines 1
|
||||
:accessibility-label :author-secondary-name
|
||||
:style {:padding-top 1
|
||||
:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}}
|
||||
secondary-name]])
|
||||
(when contact?
|
||||
[icons/icon :main-icons2/contact
|
||||
@@ -51,14 +58,14 @@
|
||||
{:monospace true
|
||||
:size :label
|
||||
:number-of-lines 1
|
||||
:style style/chat-key-text}
|
||||
:style (style/chat-key-text)}
|
||||
short-chat-key])
|
||||
(when (and (not verified?) time-str)
|
||||
(when (and (not verified?) time-str short-chat-key)
|
||||
[text/text
|
||||
{:monospace true
|
||||
:size :label
|
||||
:number-of-lines 1
|
||||
:style style/middle-dot-chat-key}
|
||||
:style (style/middle-dot-chat-key)}
|
||||
middle-dot])
|
||||
(when time-str
|
||||
[text/text
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
(defn- user-account
|
||||
[{:keys [state name balance percentage-value loading? amount customization-color type emoji metrics?
|
||||
theme]}]
|
||||
theme on-press]}]
|
||||
(let [watch-only? (= :watch-only type)
|
||||
empty? (= :empty type)
|
||||
account-amount (if (= :empty state) "€0.00" amount)
|
||||
@@ -59,44 +59,45 @@
|
||||
:type type
|
||||
:theme theme
|
||||
:metrics? metrics?}]
|
||||
[:<>
|
||||
[rn/view {:style (style/card customization-color watch-only? metrics? theme)}
|
||||
[rn/view {:style style/profile-container}
|
||||
[rn/view {:style {:padding-bottom 2 :margin-right 2}}
|
||||
[text/text {:style style/emoji} emoji]]
|
||||
[rn/view {:style style/watch-only-container}
|
||||
[rn/pressable
|
||||
{:style (style/card customization-color watch-only? metrics? theme)
|
||||
:on-press on-press}
|
||||
[rn/view {:style style/profile-container}
|
||||
[rn/view {:style {:padding-bottom 2 :margin-right 2}}
|
||||
[text/text {:style style/emoji} emoji]]
|
||||
[rn/view {:style style/watch-only-container}
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/account-name watch-only? theme)}
|
||||
account-name]
|
||||
(when watch-only? [icon/icon :reveal {:color colors/neutral-50 :size 12}])]]
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:weight :semi-bold
|
||||
:style (style/account-value watch-only? theme)}
|
||||
balance]
|
||||
(when metrics?
|
||||
[rn/view {:style style/metrics-container}
|
||||
[text/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/account-name watch-only? theme)}
|
||||
account-name]
|
||||
(when watch-only? [icon/icon :reveal {:color colors/neutral-50 :size 12}])]]
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:weight :semi-bold
|
||||
:style (style/account-value watch-only? theme)}
|
||||
balance]
|
||||
(when metrics?
|
||||
[rn/view {:style style/metrics-container}
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-2
|
||||
:accessibility-label :metrics
|
||||
:style (style/metrics watch-only? theme)}
|
||||
account-percentage]
|
||||
(when (not empty?)
|
||||
[:<>
|
||||
[rn/view (style/separator watch-only? theme)]
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-2
|
||||
:style (style/metrics watch-only? theme)} account-amount]
|
||||
[rn/view {:style {:margin-left 4}}
|
||||
[icon/icon :positive
|
||||
{:color (if (and watch-only? (not (colors/dark?)))
|
||||
colors/neutral-50
|
||||
colors/white-opa-70)
|
||||
:size 16}]]])])]])))
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-2
|
||||
:accessibility-label :metrics
|
||||
:style (style/metrics watch-only? theme)}
|
||||
account-percentage]
|
||||
(when (not empty?)
|
||||
[:<>
|
||||
[rn/view (style/separator watch-only? theme)]
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
:size :paragraph-2
|
||||
:style (style/metrics watch-only? theme)} account-amount]
|
||||
[rn/view {:style {:margin-left 4}}
|
||||
[icon/icon :positive
|
||||
{:color (colors/theme-colors (if watch-only? colors/neutral-50 colors/white-opa-70)
|
||||
colors/white-opa-70
|
||||
theme)
|
||||
:size 16}]]])])])))
|
||||
|
||||
(defn- add-account-view
|
||||
[{:keys [on-press customization-color theme metrics?]}]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{:padding-top 24
|
||||
:padding-horizontal 20
|
||||
:padding-bottom 20
|
||||
:height 78
|
||||
:height 130
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
(defn- loading-state
|
||||
[color]
|
||||
[:<>
|
||||
[rn/view
|
||||
{:style {:height 130
|
||||
:align-items :center}}
|
||||
[rn/view
|
||||
(style/loading-bar-margin-bottom {:color color
|
||||
:width 104
|
||||
@@ -99,7 +101,9 @@
|
||||
{:style style/account-overview-wrapper}
|
||||
(if (= :loading state)
|
||||
[loading-state (colors/theme-colors colors/neutral-5 colors/neutral-90 theme)]
|
||||
[:<>
|
||||
[rn/view
|
||||
{:style {:height 130
|
||||
:align-items :center}}
|
||||
[account-details account-name account theme]
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
|
||||
+7
-3
@@ -33,7 +33,7 @@
|
||||
quo2.components.counter.counter.view
|
||||
quo2.components.counter.step.view
|
||||
quo2.components.dividers.date
|
||||
quo2.components.dividers.divider-label
|
||||
quo2.components.dividers.divider-label.view
|
||||
quo2.components.dividers.new-messages
|
||||
quo2.components.dividers.strength-divider.view
|
||||
quo2.components.drawers.action-drawers.view
|
||||
@@ -41,6 +41,7 @@
|
||||
quo2.components.drawers.drawer-buttons.view
|
||||
quo2.components.drawers.permission-context.view
|
||||
quo2.components.dropdowns.dropdown
|
||||
quo2.components.dropdowns.network-dropdown.view
|
||||
quo2.components.empty-state.empty-state.view
|
||||
quo2.components.gradient.gradient-cover.view
|
||||
quo2.components.graph.wallet-graph.view
|
||||
@@ -61,6 +62,7 @@
|
||||
quo2.components.list-items.account-list-card.view
|
||||
quo2.components.list-items.channel
|
||||
quo2.components.list-items.community.view
|
||||
quo2.components.list-items.dapp.view
|
||||
quo2.components.list-items.menu-item
|
||||
quo2.components.list-items.preview-list
|
||||
quo2.components.list-items.token-value.view
|
||||
@@ -109,8 +111,8 @@
|
||||
quo2.components.tags.tags
|
||||
quo2.components.tags.token-tag
|
||||
quo2.components.text-combinations.title.view
|
||||
quo2.components.wallet.account-overview.view
|
||||
quo2.components.wallet.account-card.view
|
||||
quo2.components.wallet.account-overview.view
|
||||
quo2.components.wallet.keypair.view
|
||||
quo2.components.wallet.network-amount.view
|
||||
quo2.components.wallet.network-bridge.view
|
||||
@@ -180,7 +182,7 @@
|
||||
(def step quo2.components.counter.step.view/view)
|
||||
|
||||
;;;; Dividers
|
||||
(def divider-label quo2.components.dividers.divider-label/divider-label)
|
||||
(def divider-label quo2.components.dividers.divider-label.view/view)
|
||||
(def new-messages quo2.components.dividers.new-messages/new-messages)
|
||||
(def divider-date quo2.components.dividers.date/date)
|
||||
(def strength-divider quo2.components.dividers.strength-divider.view/view)
|
||||
@@ -193,6 +195,7 @@
|
||||
|
||||
;;;; Dropdowns
|
||||
(def dropdown quo2.components.dropdowns.dropdown/dropdown)
|
||||
(def network-dropdown quo2.components.dropdowns.network-dropdown.view/view)
|
||||
|
||||
;;;; Empty State
|
||||
(def empty-state quo2.components.empty-state.empty-state.view/empty-state)
|
||||
@@ -233,6 +236,7 @@
|
||||
;;;; List items
|
||||
(def account-list-card quo2.components.list-items.account-list-card.view/view)
|
||||
(def channel-list-item quo2.components.list-items.channel/list-item)
|
||||
(def dapp quo2.components.list-items.dapp.view/view)
|
||||
(def menu-item quo2.components.list-items.menu-item/menu-item)
|
||||
(def preview-list quo2.components.list-items.preview-list/preview-list)
|
||||
(def user-list quo2.components.list-items.user-list/user-list)
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
[quo2.components.colors.color-picker.component-spec]
|
||||
[quo2.components.counter.counter.component-spec]
|
||||
[quo2.components.counter.step.component-spec]
|
||||
[quo2.components.dividers.divider-label-component-spec]
|
||||
[quo2.components.dividers.divider-label.component-spec]
|
||||
[quo2.components.dividers.strength-divider.component-spec]
|
||||
[quo2.components.drawers.action-drawers.component-spec]
|
||||
[quo2.components.drawers.documentation-drawers.component-spec]
|
||||
[quo2.components.drawers.drawer-buttons.component-spec]
|
||||
[quo2.components.drawers.permission-context.component-spec]
|
||||
[quo2.components.dropdowns.network-dropdown.component-spec]
|
||||
[quo2.components.gradient.gradient-cover.component-spec]
|
||||
[quo2.components.graph.wallet-graph.component-spec]
|
||||
[quo2.components.inputs.input.component-spec]
|
||||
@@ -35,6 +36,7 @@
|
||||
[quo2.components.links.url-preview-list.component-spec]
|
||||
[quo2.components.links.url-preview.component-spec]
|
||||
[quo2.components.list-items.community.component-spec]
|
||||
[quo2.components.list-items.dapp.component-spec]
|
||||
[quo2.components.list-items.token-value.component-spec]
|
||||
[quo2.components.markdown.text-component-spec]
|
||||
[quo2.components.markdown.list.component-spec]
|
||||
@@ -54,8 +56,8 @@
|
||||
[quo2.components.settings.category.component-spec]
|
||||
[quo2.components.share.share-qr-code.component-spec]
|
||||
[quo2.components.tags.status-tags-component-spec]
|
||||
[quo2.components.wallet.account-overview.component-spec]
|
||||
[quo2.components.wallet.account-card.component-spec]
|
||||
[quo2.components.wallet.account-overview.component-spec]
|
||||
[quo2.components.wallet.keypair.component-spec]
|
||||
[quo2.components.wallet.network-amount.component-spec]
|
||||
[quo2.components.wallet.network-bridge.component-spec]
|
||||
|
||||
@@ -28,3 +28,7 @@
|
||||
{:ethereum (js/require "../resources/images/tokens/mainnet/ETH-network.png")
|
||||
:optimism (js/require "../resources/images/tokens/mainnet/OP.png")
|
||||
:arbitrum (js/require "../resources/images/tokens/mainnet/ARB.png")})
|
||||
|
||||
(defn get-network
|
||||
[n]
|
||||
(get networks n))
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
(defn contacts-section-header
|
||||
[{:keys [title]}]
|
||||
[quo/divider-label {:label title}])
|
||||
[quo/divider-label title])
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
(defn view-profile-entry
|
||||
[chat-id]
|
||||
(entry {:icon :i/friend
|
||||
(entry {:icon :i/profile
|
||||
:label (i18n/label :t/view-profile)
|
||||
:on-press #(show-profile-action chat-id)
|
||||
:danger? false
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
[scroll-shared-value]
|
||||
(reanimated/interpolate scroll-shared-value [0 max-scroll] [0 (- max-scroll)] :clamp))
|
||||
|
||||
(defn- animated-card-translation-y-reverse
|
||||
[scroll-shared-value]
|
||||
(reanimated/interpolate scroll-shared-value [0 max-scroll] [0 (+ max-scroll)] :clamp))
|
||||
|
||||
(defn banner-card-blur-layer
|
||||
[scroll-shared-value]
|
||||
(reanimated/apply-animations-to-style
|
||||
@@ -30,13 +34,15 @@
|
||||
:height (+ (safe-area/get-top) 244)}))
|
||||
|
||||
(defn banner-card-hiding-layer
|
||||
[]
|
||||
{:z-index 2
|
||||
:position :absolute
|
||||
:top 0
|
||||
:right 0
|
||||
:left 0
|
||||
:padding-top (safe-area/get-top)})
|
||||
[scroll-shared-value]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:transform [{:translate-y (animated-card-translation-y-reverse scroll-shared-value)}]}
|
||||
{:z-index 2
|
||||
:position :absolute
|
||||
:top 0
|
||||
:right 0
|
||||
:left 0
|
||||
:padding-top (safe-area/get-top)}))
|
||||
|
||||
(def animated-banner-card-container {:overflow :hidden})
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
(oops/ocall! scroll-ref "scrollToOffset" #js {:offset 0})))
|
||||
|
||||
(defn- banner-card-blur-layer
|
||||
[scroll-shared-value]
|
||||
[scroll-shared-value child]
|
||||
(let [open-sheet? (-> (rf/sub [:bottom-sheet]) :sheets seq)]
|
||||
[reanimated/view {:style (style/banner-card-blur-layer scroll-shared-value)}
|
||||
[blur/view
|
||||
@@ -33,12 +33,13 @@
|
||||
:blur-type (theme/theme-value (if platform/ios? :light :xlight) :dark)
|
||||
:overlay-color (if open-sheet?
|
||||
(colors/theme-colors colors/white colors/neutral-95-opa-70)
|
||||
(theme/theme-value nil colors/neutral-95-opa-70))}]]))
|
||||
(theme/theme-value nil colors/neutral-95-opa-70))}
|
||||
child]]))
|
||||
|
||||
(defn- banner-card-hiding-layer
|
||||
[{:keys [title-props card-props scroll-shared-value]}]
|
||||
(let [customization-color (rf/sub [:profile/customization-color])]
|
||||
[rn/view {:style (style/banner-card-hiding-layer)}
|
||||
[reanimated/view {:style (style/banner-card-hiding-layer scroll-shared-value)}
|
||||
[common.home/top-nav {:type :grey}]
|
||||
[common.home/title-column (assoc title-props :customization-color customization-color)]
|
||||
[rn/view {:style style/animated-banner-card-container}
|
||||
@@ -65,8 +66,8 @@
|
||||
(defn animated-banner
|
||||
[{:keys [scroll-ref tabs selected-tab on-tab-change scroll-shared-value content customization-color]}]
|
||||
[:<>
|
||||
[:f> banner-card-blur-layer scroll-shared-value]
|
||||
[:f> banner-card-hiding-layer (assoc content :scroll-shared-value scroll-shared-value)]
|
||||
[:f> banner-card-blur-layer scroll-shared-value
|
||||
[:f> banner-card-hiding-layer (assoc content :scroll-shared-value scroll-shared-value)]]
|
||||
[:f> banner-card-tabs-layer
|
||||
{:scroll-shared-value scroll-shared-value
|
||||
:selected-tab selected-tab
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
(def mock-images
|
||||
{:diamond (js/require "../resources/images/mock2/diamond.png")
|
||||
:coinbase (js/require "../resources/images/mock2/coinbase.png")
|
||||
:coin-gecko (js/require "../resources/images/mock2/coin-gecko.png")
|
||||
:collectible (js/require "../resources/images/mock2/collectible.png")
|
||||
:contact (js/require "../resources/images/mock2/contact.png")
|
||||
:community-banner (js/require "../resources/images/mock2/community-banner.png")
|
||||
|
||||
@@ -3,22 +3,13 @@
|
||||
|
||||
(defn container
|
||||
[]
|
||||
{:margin-top 8
|
||||
:margin-horizontal 8
|
||||
{:margin-horizontal 8
|
||||
:padding-vertical 8
|
||||
:padding-horizontal 12
|
||||
:border-radius 12
|
||||
:flex-direction :row
|
||||
:align-items :center})
|
||||
|
||||
(defn timestamp
|
||||
[muted?]
|
||||
{:color (if muted?
|
||||
colors/neutral-50
|
||||
(colors/theme-colors colors/neutral-50 colors/neutral-40))
|
||||
:margin-top 3
|
||||
:margin-left 8})
|
||||
|
||||
(def chat-data-container
|
||||
{:flex 1
|
||||
:margin-left 8
|
||||
|
||||
@@ -167,36 +167,6 @@
|
||||
:accessibility-label :chat-message-text}
|
||||
preview-text]))
|
||||
|
||||
|
||||
(defn verified-or-contact-icon
|
||||
[{:keys [ens-verified added?]}]
|
||||
(if ens-verified
|
||||
[rn/view {:style {:margin-left 5 :margin-top 4}}
|
||||
[quo/icon :i/verified
|
||||
{:no-color true
|
||||
:size 12
|
||||
:color (colors/theme-colors colors/success-50 colors/success-60)}]]
|
||||
(when added?
|
||||
[rn/view {:style {:margin-left 5 :margin-top 4}}
|
||||
[quo/icon :i/contact
|
||||
{:no-color true
|
||||
:size 12
|
||||
:color (colors/theme-colors colors/primary-50 colors/primary-60)}]])))
|
||||
|
||||
(defn name-view
|
||||
[display-name contact timestamp muted?]
|
||||
[rn/view {:style {:flex-direction :row}}
|
||||
[quo/text
|
||||
{:weight :semi-bold
|
||||
:accessibility-label :chat-name-text
|
||||
:style {:color (when muted? colors/neutral-50)}}
|
||||
display-name]
|
||||
[verified-or-contact-icon contact]
|
||||
[quo/text
|
||||
{:size :label
|
||||
:style (style/timestamp muted?)}
|
||||
(datetime/to-short-str timestamp)]])
|
||||
|
||||
(defn avatar-view
|
||||
[{:keys [contact chat-id full-name color muted?]}]
|
||||
(if contact ; `contact` is passed when it's not a group chat
|
||||
@@ -244,13 +214,14 @@
|
||||
unviewed-messages-count])]))
|
||||
|
||||
(defn chat-list-item
|
||||
[{:keys [chat-id group-chat color name timestamp last-message muted]
|
||||
[{:keys [chat-id group-chat color name last-message timestamp muted]
|
||||
:as item}]
|
||||
(let [display-name (if group-chat
|
||||
name
|
||||
(first (rf/sub [:contacts/contact-two-names-by-identity chat-id])))
|
||||
contact (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))]
|
||||
(let [[primary-name secondary-name]
|
||||
(if group-chat
|
||||
[name ""]
|
||||
(rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
||||
{:keys [ens-verified added?] :as contact} (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))]
|
||||
[rn/touchable-opacity
|
||||
{:style (style/container)
|
||||
:on-press (open-chat chat-id)
|
||||
@@ -259,10 +230,17 @@
|
||||
[avatar-view
|
||||
{:contact contact
|
||||
:chat-id chat-id
|
||||
:full-name display-name
|
||||
:full-name primary-name
|
||||
:color color
|
||||
:muted? muted}]
|
||||
[rn/view {:style style/chat-data-container}
|
||||
[name-view display-name contact timestamp muted]
|
||||
[quo/author
|
||||
{:primary-name primary-name
|
||||
:secondary-name secondary-name
|
||||
:size 15
|
||||
:verified? ens-verified
|
||||
:contact? added?
|
||||
:muted? muted
|
||||
:time-str (datetime/to-short-str timestamp)}]
|
||||
[last-message-preview group-chat last-message muted]]
|
||||
[notification item]]))
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
[{:keys [title]}]
|
||||
(when-not (= title no-title)
|
||||
[quo/divider-label
|
||||
{:label title
|
||||
:container-style style/divider}]))
|
||||
{:container-style style/divider}
|
||||
title]))
|
||||
|
||||
(defn key-fn
|
||||
[item index]
|
||||
|
||||
@@ -83,14 +83,10 @@
|
||||
:on-layout #(on-category-layout name (int (layout-y %)))}
|
||||
(when-not (= constants/empty-category-id category-id)
|
||||
[quo/divider-label
|
||||
{:container-style {:padding-left 16
|
||||
:padding-right 20
|
||||
:padding-top 6 ; Because of border width of 1
|
||||
:padding-bottom 7}
|
||||
:label name
|
||||
:on-press #(collapse-category community-id category-id collapsed?)
|
||||
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
|
||||
:chevron-position :left}])
|
||||
{:on-press #(collapse-category community-id category-id collapsed?)
|
||||
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
|
||||
:chevron :left}
|
||||
name])
|
||||
(when-not collapsed?
|
||||
(into [rn/view {:style {:padding-horizontal 8 :padding-bottom 8}}]
|
||||
(map #(channel-chat-item community-id community-color %))
|
||||
@@ -296,8 +292,8 @@
|
||||
:blur-type :transparent
|
||||
:overlay-color :transparent}
|
||||
[quo/divider-label
|
||||
{:label label
|
||||
:chevron-position :left}]])))
|
||||
{:chevron :left}
|
||||
label]])))
|
||||
|
||||
(defn page-nav-right-section-buttons
|
||||
[id]
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.account-avatar
|
||||
(:require [quo2.components.avatars.account-avatar.view :as account-avatar]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "default"}
|
||||
{:key :watch-only
|
||||
:value "watch only"}]}
|
||||
{:label "Size"
|
||||
:key :size
|
||||
:options [{:key :default}
|
||||
{:key :watch-only}]}
|
||||
{:key :size
|
||||
:type :select
|
||||
:options [{:key 16
|
||||
:value "16"}
|
||||
@@ -35,29 +29,12 @@
|
||||
:type :text}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:customization-color :purple
|
||||
:size 80
|
||||
:emoji "🍑"
|
||||
:type :default})]
|
||||
(fn []
|
||||
[rn/view
|
||||
{:style {:margin-bottom 50
|
||||
:padding 16}}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 60
|
||||
:align-items :center}}
|
||||
[account-avatar/view @state]]])))
|
||||
|
||||
(defn preview-account-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:flex 1
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95)}}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/account-avatar @state]])))
|
||||
|
||||
@@ -1,34 +1,26 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.channel-avatar
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size:"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key :size/l :value "Large"}
|
||||
{:key :default :value "Default"}]}
|
||||
{:label "Emoji:"
|
||||
:key :emoji
|
||||
:type :text}
|
||||
{:label "Full name:"
|
||||
:key :full-name
|
||||
:type :text}
|
||||
{:key :default}]}
|
||||
{:key :emoji
|
||||
:type :text}
|
||||
{:key :full-name
|
||||
:type :text}
|
||||
(preview/customization-color-option)
|
||||
{:label "Locked state:"
|
||||
:key :locked-state
|
||||
{:key :locked-state
|
||||
:type :select
|
||||
:options [{:key :not-set
|
||||
:value "Not set"}
|
||||
{:key :unlocked
|
||||
:value "Unlocked"}
|
||||
{:key :locked
|
||||
:value "Locked"}]}])
|
||||
:options [{:key :not-set}
|
||||
{:key :unlocked}
|
||||
{:key :locked}]}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:size :size/l
|
||||
:locked-state :not-set
|
||||
@@ -42,26 +34,8 @@
|
||||
:unlocked false
|
||||
:locked true
|
||||
nil)]
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}}
|
||||
[quo/channel-avatar
|
||||
(assoc @state
|
||||
:locked? locked?
|
||||
:customization-color customization-color)]]]]))))
|
||||
|
||||
(defn preview-channel-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/channel-avatar
|
||||
(assoc @state
|
||||
:locked? locked?
|
||||
:customization-color customization-color)]]))))
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.group-avatar
|
||||
(:require [quo2.core :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key :size/s-20
|
||||
:value "20"}
|
||||
@@ -20,40 +17,21 @@
|
||||
:value "48"}
|
||||
{:key :size/s-80
|
||||
:value "80"}]}
|
||||
{:label "Avatar"
|
||||
{:label "Avatar:"
|
||||
:key :picture?
|
||||
:type :boolean}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(def avatar (resources/get-mock-image :photo1))
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:theme :light
|
||||
:customization-color :blue
|
||||
(let [state (reagent/atom {:customization-color :blue
|
||||
:size :size/s-20
|
||||
:picture? false})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}}
|
||||
(let [{:keys [picture?]} @state
|
||||
params (if picture? (assoc @state :picture avatar) @state)]
|
||||
[quo2/group-avatar params])]]])))
|
||||
|
||||
(defn preview-group-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white
|
||||
colors/neutral-90)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/group-avatar
|
||||
(cond-> @state
|
||||
(:picture? @state)
|
||||
(assoc :picture avatar))]])))
|
||||
|
||||
@@ -1,59 +1,27 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.icon-avatar
|
||||
(:require [quo2.components.avatars.icon-avatar :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.components.avatars.icon-avatar :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key :small
|
||||
:value "Small"}
|
||||
{:key :medium
|
||||
:value "Medium"}
|
||||
{:key :big
|
||||
:value "Big"}]}
|
||||
{:label "Icon"
|
||||
:key :icon
|
||||
:options [{:key :small}
|
||||
{:key :medium}
|
||||
{:key :big}]}
|
||||
{:key :icon
|
||||
:type :select
|
||||
:options [{:key :main-icons/placeholder20
|
||||
:options [{:key :i/placeholder20
|
||||
:value "Placeholder"}
|
||||
{:key :main-icons/wallet
|
||||
:value "Wallet"}
|
||||
{:key :main-icons/play
|
||||
:value "Play"}]}
|
||||
{:label "Color"
|
||||
:key :color
|
||||
:type :select
|
||||
:options (map
|
||||
(fn [c]
|
||||
{:key c
|
||||
:value c})
|
||||
(keys colors/customization))}])
|
||||
{:key :i/wallet}
|
||||
{:key :i/play}]}
|
||||
(preview/customization-color-option {:key :color})])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:size :big
|
||||
:icon :main-icons/placeholder20
|
||||
:icon :i/placeholder20
|
||||
:color :primary})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo2/icon-avatar @state]]]])))
|
||||
|
||||
(defn preview-icon-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/icon-avatar @state]])))
|
||||
|
||||
@@ -1,48 +1,29 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.user-avatar
|
||||
(:require [quo2.components.avatars.user-avatar.view :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.components.avatars.user-avatar.view :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size:"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key :big
|
||||
:value "Big"}
|
||||
{:key :medium
|
||||
:value "Medium"}
|
||||
{:key :small
|
||||
:value "Small"}
|
||||
{:key :xs
|
||||
:value "x Small"}
|
||||
{:key :xxs
|
||||
:value "xx Small"}
|
||||
{:key :xxxs
|
||||
:value "xxx Small"}]}
|
||||
{:label "Customization color:"
|
||||
:key :customization-color
|
||||
:type :select
|
||||
:options (map (fn [[color-kw _]]
|
||||
{:key color-kw
|
||||
:value (name color-kw)})
|
||||
colors/customization)}
|
||||
{:label "Online status"
|
||||
:key :online?
|
||||
:type :boolean}
|
||||
{:label "Status Indicator"
|
||||
:key :status-indicator?
|
||||
:type :boolean}
|
||||
:options [{:key :big}
|
||||
{:key :medium}
|
||||
{:key :small}
|
||||
{:key :xs}
|
||||
{:key :xxs}
|
||||
{:key :xxxs}]}
|
||||
(preview/customization-color-option)
|
||||
{:key :online?
|
||||
:type :boolean}
|
||||
{:key :status-indicator?
|
||||
:type :boolean}
|
||||
{:label "Identicon Ring (applies only when there's no profile picture)"
|
||||
:key :ring?
|
||||
:type :boolean}
|
||||
{:label "Full name separated by space"
|
||||
:key :full-name
|
||||
:type :text}
|
||||
{:label "Profile Picture"
|
||||
:key :profile-picture
|
||||
{:key :full-name
|
||||
:type :text}
|
||||
{:key :profile-picture
|
||||
:type :select
|
||||
:options [{:value "None"
|
||||
:key nil}
|
||||
@@ -51,7 +32,7 @@
|
||||
{:value "pedro.eth"
|
||||
:key (resources/get-mock-image :user-picture-male4)}]}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:full-name "A Y"
|
||||
:status-indicator? true
|
||||
@@ -59,23 +40,5 @@
|
||||
:size :medium
|
||||
:customization-color :blue})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view {:flex 1}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}
|
||||
[quo2/user-avatar @state]]]])))
|
||||
|
||||
(defn preview-user-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/user-avatar @state]])))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
(ns status-im2.contexts.quo-preview.avatars.wallet-user-avatar
|
||||
(:require [quo2.components.avatars.wallet-user-avatar :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.components.avatars.wallet-user-avatar :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
@@ -12,46 +10,21 @@
|
||||
{:label "Last name"
|
||||
:key :l-name
|
||||
:type :text}
|
||||
{:label "Size"
|
||||
:key :size
|
||||
{:key :size
|
||||
:type :select
|
||||
:options [{:key :small
|
||||
:value "Small"}
|
||||
{:key :medium
|
||||
:value "Medium"}
|
||||
{:key :large
|
||||
:value "Large"}
|
||||
:options [{:key :small}
|
||||
{:key :medium}
|
||||
{:key :large}
|
||||
{:key :x-large
|
||||
:value "X Large"}]}
|
||||
{:label "Color"
|
||||
:key :color
|
||||
:type :select
|
||||
:options (map
|
||||
(fn [c]
|
||||
{:key c
|
||||
:value c})
|
||||
(keys colors/customization))}])
|
||||
(preview/customization-color-option {:key :color})])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:first-name "empty"
|
||||
:last-name "name"
|
||||
:size :x-large
|
||||
:color :indigo})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[quo2/wallet-user-avatar @state]]]])))
|
||||
|
||||
(defn preview-wallet-user-avatar
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/wallet-user-avatar @state]])))
|
||||
|
||||
@@ -1,46 +1,22 @@
|
||||
(ns status-im2.contexts.quo-preview.banners.banner
|
||||
(:require [quo2.core :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "message"
|
||||
:key :latest-pin-text
|
||||
:type :text}
|
||||
{:label "number of messages"
|
||||
:key :pins-count
|
||||
:type :text}
|
||||
{:label "hide pin icon?"
|
||||
:key :hide-pin?
|
||||
:type :boolean}
|
||||
])
|
||||
[{:key :latest-pin-text
|
||||
:type :text}
|
||||
{:key :pins-count
|
||||
:type :text}
|
||||
{:key :hide-pin?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom
|
||||
{:hide-pin? false
|
||||
:pins-count 2
|
||||
:latest-pin-text "Be respectful of fellow community members, even if they"})]
|
||||
(let [state (reagent/atom {:hide-pin? false
|
||||
:pins-count 2
|
||||
:latest-pin-text
|
||||
"Be respectful of fellow community members, even if they"})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view {:flex 1}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}
|
||||
[quo2/banner @state]]]])))
|
||||
|
||||
(defn preview-banner
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/banner @state]])))
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
(ns status-im2.contexts.quo-preview.bottom-sheet.bottom-sheet
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Show handle:"
|
||||
:key :show-handle?
|
||||
:type :boolean}
|
||||
{:label "Backdrop dismiss:"
|
||||
:key :backdrop-dismiss?
|
||||
:type :boolean}
|
||||
{:label "Expendable:"
|
||||
:key :expandable?
|
||||
:type :boolean}
|
||||
{:label "Disable drag:"
|
||||
:key :disable-drag?
|
||||
:type :boolean}])
|
||||
|
||||
(defn bottom-sheet-content
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:justify-content :center
|
||||
:align-items :center}}
|
||||
[quo/button {:on-press #(do (re-frame/dispatch [:hide-bottom-sheet]))} "Close bottom sheet"]
|
||||
|
||||
[quo/text {:style {:padding-top 20}} "Hello world!"]])
|
||||
|
||||
(defn cool-preview
|
||||
[]
|
||||
(let [state (reagent/atom {:show-handle? true
|
||||
:backdrop-dismiss? true
|
||||
:expandable? true
|
||||
:disable-drag? false})
|
||||
on-bottom-sheet-open (fn []
|
||||
(re-frame/dispatch [:show-bottom-sheet
|
||||
(merge
|
||||
{:content bottom-sheet-content}
|
||||
@state)]))]
|
||||
(fn []
|
||||
[rn/view
|
||||
{:style {:margin-bottom 50
|
||||
:padding 16}}
|
||||
[preview/customizer state descriptor]
|
||||
[:<>
|
||||
[rn/view
|
||||
{:style {:align-items :center
|
||||
:padding 16}}
|
||||
|
||||
[quo/button {:on-press on-bottom-sheet-open} "Open bottom sheet"]]]])))
|
||||
|
||||
(defn preview-bottom-sheet
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
@@ -1,33 +1,22 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.button
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[status-im2.common.resources :as resources]))
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :primary
|
||||
:value "Primary"}
|
||||
{:key :positive
|
||||
:value "Positive"}
|
||||
{:key :grey
|
||||
:value "Grey"}
|
||||
{:key :dark-grey
|
||||
:value "Dark Grey"}
|
||||
{:key :outline
|
||||
:value "Outline"}
|
||||
{:key :ghost
|
||||
:value "Ghost"}
|
||||
{:key :danger
|
||||
:value "Danger"}
|
||||
{:key :black
|
||||
:value "Black"}]}
|
||||
{:label "Size:"
|
||||
:key :size
|
||||
:options [{:key :primary}
|
||||
{:key :positive}
|
||||
{:key :grey}
|
||||
{:key :dark-grey}
|
||||
{:key :outline}
|
||||
{:key :ghost}
|
||||
{:key :danger}
|
||||
{:key :black}]}
|
||||
{:key :size
|
||||
:type :select
|
||||
:options [{:key 56
|
||||
:value "56"}
|
||||
@@ -37,40 +26,25 @@
|
||||
:value "32"}
|
||||
{:key 24
|
||||
:value "24"}]}
|
||||
{:label "Background:"
|
||||
:key :background
|
||||
{:key :background
|
||||
:type :select
|
||||
:options [{:key :blur
|
||||
:value "Blur"}
|
||||
{:key :photo
|
||||
:value "Photo"}]}
|
||||
{:label "Icon Only?:"
|
||||
:key :icon-only?
|
||||
:type :boolean}
|
||||
{:label "show icon-top "
|
||||
:key :icon-top
|
||||
:type :boolean}
|
||||
{:label "show icon-right"
|
||||
:key :icon-right
|
||||
:type :boolean}
|
||||
{:label "show icon-left"
|
||||
:key :icon-left
|
||||
:type :boolean}
|
||||
{:label "Disabled?:"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "Label"
|
||||
:key :label
|
||||
:type :text}
|
||||
{:label "Customization color:"
|
||||
:key :customization-color
|
||||
:type :select
|
||||
:options (map (fn [color]
|
||||
(let [k (get color :name)]
|
||||
{:key k :value k}))
|
||||
(quo/picker-colors))}])
|
||||
:options [{:key :blur}
|
||||
{:key :photo}]}
|
||||
{:key :icon-only?
|
||||
:type :boolean}
|
||||
{:key :icon-top
|
||||
:type :boolean}
|
||||
{:key :icon-right
|
||||
:type :boolean}
|
||||
{:key :icon-left
|
||||
:type :boolean}
|
||||
{:key :disabled?
|
||||
:type :boolean}
|
||||
{:key :label
|
||||
:type :text}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:label "Press Me"
|
||||
:size 40
|
||||
@@ -82,46 +56,31 @@
|
||||
icon-top (reagent/cursor state [:icon-top])
|
||||
icon-only? (reagent/cursor state [:icon-only?])]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view {:flex 1}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}
|
||||
(when (= :photo (:background @state))
|
||||
[rn/image
|
||||
{:source (resources/get-mock-image :community-cover)
|
||||
:style {:position :absolute
|
||||
:top 0
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0}}])
|
||||
[quo/button
|
||||
(merge (dissoc @state
|
||||
:theme
|
||||
:customization-color
|
||||
:icon-left
|
||||
:icon-right)
|
||||
{:background (:background @state)
|
||||
:on-press #(println "Hello world!")}
|
||||
(when (= :primary (:type @state)) {:customization-color (:customization-color @state)})
|
||||
(when @icon-top
|
||||
{:icon-top :i/placeholder})
|
||||
(when @icon-left
|
||||
{:icon-left :i/placeholder})
|
||||
(when @icon-right
|
||||
{:icon-right :i/placeholder}))
|
||||
(if @icon-only? :i/placeholder @label)]]]])))
|
||||
|
||||
(defn preview-button
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:align-items :center}}
|
||||
(when (= :photo (:background @state))
|
||||
[rn/image
|
||||
{:source (resources/get-mock-image :community-cover)
|
||||
:style {:position :absolute
|
||||
:top 0
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0}}])
|
||||
[quo/button
|
||||
(merge (dissoc @state
|
||||
:theme
|
||||
:customization-color
|
||||
:icon-left
|
||||
:icon-right)
|
||||
{:background (:background @state)
|
||||
:on-press #(println "Hello world!")}
|
||||
(when (= :primary (:type @state)) {:customization-color (:customization-color @state)})
|
||||
(when @icon-top
|
||||
{:icon-top :i/placeholder})
|
||||
(when @icon-left
|
||||
{:icon-left :i/placeholder})
|
||||
(when @icon-right
|
||||
{:icon-right :i/placeholder}))
|
||||
(if @icon-only? :i/placeholder @label)]])))
|
||||
|
||||
@@ -1,49 +1,24 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.composer-button
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as quo2.theme]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[status-im2.common.resources :as resources]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Blur?:"
|
||||
:key :blur?
|
||||
:type :boolean}
|
||||
{:label "Disabled?:"
|
||||
:key :disabled?
|
||||
:type :boolean}])
|
||||
[{:key :blur?
|
||||
:type :boolean}
|
||||
{:key :disabled?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:icon :i/placeholder
|
||||
:blur? false
|
||||
:on-press #(js/alert "pressed")
|
||||
:on-long-press #(js/alert "long pressed")})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:flex 1 :padding-bottom 20}
|
||||
[rn/view {:height 200}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:flex 1
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
(when (:blur? @state)
|
||||
[rn/image
|
||||
{:source (if (= :light (quo2.theme/get-theme))
|
||||
(resources/get-mock-image :community-cover)
|
||||
(resources/get-mock-image :dark-blur-bg))
|
||||
:style {:position :absolute
|
||||
:top 200
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0}}])
|
||||
[quo/composer-button @state]]]])))
|
||||
|
||||
(defn preview-composer-button
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}
|
||||
[cool-preview]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/composer-button @state]])))
|
||||
|
||||
@@ -1,55 +1,31 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.dynamic-button
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :jump-to
|
||||
:value "Jump To"}
|
||||
{:key :mention
|
||||
:value "Mention"}
|
||||
{:key :notification-down
|
||||
:value "Notification Down"}
|
||||
{:key :notification-up
|
||||
:value "Notification Up"}
|
||||
{:key :search
|
||||
:value "Search"}
|
||||
{:key :search-with-label
|
||||
:value "Search With Label"}
|
||||
{:key :scroll-to-bottom
|
||||
:value "Bottom"}]}
|
||||
{:label "Count"
|
||||
:key :count
|
||||
:type :text}])
|
||||
:options [{:key :jump-to}
|
||||
{:key :mention}
|
||||
{:key :notification-down}
|
||||
{:key :notification-up}
|
||||
{:key :search}
|
||||
{:key :search-with-label}
|
||||
{:key :scroll-to-bottom}]}
|
||||
{:key :count
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:count "5"
|
||||
:type :jump-to
|
||||
:labels {:jump-to (i18n/label :t/jump-to)
|
||||
:search-with-label (i18n/label :t/back)}})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo/dynamic-button @state]]]])))
|
||||
|
||||
(defn preview-dynamic-button
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:align-items :center}}
|
||||
[quo/dynamic-button @state]])))
|
||||
|
||||
@@ -1,59 +1,34 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.predictive-keyboard
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :error :value "Error"}
|
||||
{:key :empty :value "Empty"}
|
||||
{:key :info :value "Info"}
|
||||
{:key :words :value "Words"}]}
|
||||
{:label "Text"
|
||||
:key :text
|
||||
:type :text}
|
||||
{:label "Blur"
|
||||
:key :blur?
|
||||
:type :boolean}])
|
||||
:options [{:key :error}
|
||||
{:key :empty}
|
||||
{:key :info}
|
||||
{:key :words}]}
|
||||
{:key :text
|
||||
:type :text}
|
||||
{:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:type :info :text "Enter 12, 18 or 24 words separated by a space"})
|
||||
(let [state (reagent/atom {:type :info
|
||||
:text "Enter 12, 18 or 24 words separated by a space"})
|
||||
blur? (reagent/cursor state [:blur?])]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
(when @blur?
|
||||
[blur/view
|
||||
{:style {:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:top 0
|
||||
:bottom 0
|
||||
:background-color colors/neutral-80-opa-70}
|
||||
:overlay-color :transparent}])
|
||||
[rn/view {:padding-vertical 60 :align-items :center}
|
||||
[quo/predictive-keyboard
|
||||
(merge @state
|
||||
{:words ["label" "label" "labor" "ladder" "lady" "lake"]
|
||||
:on-press #(js/alert (str "Pressed: " %))})]]]]])))
|
||||
|
||||
(defn preview-predictive-keyboard
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? @blur?
|
||||
:blur-container-style {:background-color colors/neutral-80-opa-70}
|
||||
:blur-view-props {:overlay-color :transparent}}
|
||||
[quo/predictive-keyboard
|
||||
(merge @state
|
||||
{:words ["label" "label" "labor" "ladder" "lady" "lake"]
|
||||
:on-press #(js/alert (str "Pressed: " %))})]])))
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.slide-button
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size:"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key :large
|
||||
:value "Large"}
|
||||
{:key :small
|
||||
:value "Small"}]}
|
||||
{:label "Disabled:"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "Custom Color"
|
||||
:key :color
|
||||
:type :select
|
||||
:options (map (fn [color]
|
||||
(let [k (get color :name)]
|
||||
{:key k :value k}))
|
||||
(quo/picker-colors))}])
|
||||
:options [{:key :large}
|
||||
{:key :small}]}
|
||||
{:key :disabled?
|
||||
:type :boolean}
|
||||
(preview/customization-color-option {:key :color})])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:disabled? false
|
||||
:color :blue
|
||||
@@ -34,34 +22,20 @@
|
||||
size (reagent/cursor state [:size])
|
||||
complete? (reagent/atom false)]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:padding-horizontal 40
|
||||
:align-items :center}
|
||||
(if (not @complete?)
|
||||
[quo/slide-button
|
||||
{:track-text "We gotta slide"
|
||||
:track-icon :face-id
|
||||
:customization-color @color
|
||||
:size @size
|
||||
:disabled? @disabled?
|
||||
:on-complete (fn []
|
||||
(js/setTimeout (fn [] (reset! complete? true))
|
||||
1000)
|
||||
(js/alert "I don't wanna slide anymore"))}]
|
||||
[quo/button {:on-press (fn [] (reset! complete? false))}
|
||||
"Try again"])]]])))
|
||||
|
||||
(defn preview-slide-button
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:align-items :center}}
|
||||
(if (not @complete?)
|
||||
[quo/slide-button
|
||||
{:track-text "We gotta slide"
|
||||
:track-icon :face-id
|
||||
:customization-color @color
|
||||
:size @size
|
||||
:disabled? @disabled?
|
||||
:on-complete (fn []
|
||||
(js/setTimeout (fn [] (reset! complete? true))
|
||||
1000)
|
||||
(js/alert "I don't wanna slide anymore"))}]
|
||||
[quo/button {:on-press (fn [] (reset! complete? false))}
|
||||
"Try again"])])))
|
||||
|
||||
@@ -1,35 +1,19 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.wallet-button
|
||||
(:require
|
||||
[quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Disabled?:"
|
||||
:key :disabled?
|
||||
:type :boolean}])
|
||||
[{:key :disabled? :type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:icon :i/placeholder
|
||||
:on-press #(js/alert "pressed")
|
||||
:on-long-press #(js/alert "long pressed")})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:flex 1 :padding-bottom 20}
|
||||
[rn/view {:height 200}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:flex 1
|
||||
:align-items :center
|
||||
:justify-content :center}
|
||||
[quo/wallet-button @state]]]])))
|
||||
|
||||
(defn preview
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}
|
||||
[cool-preview]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:align-items :center}}
|
||||
[quo/wallet-button @state]])))
|
||||
|
||||
@@ -1,30 +1,12 @@
|
||||
(ns status-im2.contexts.quo-preview.buttons.wallet-ctas
|
||||
(:require
|
||||
[quo2.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]))
|
||||
(:require [quo2.core :as quo]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:buy-action #(js/alert "Buy button pressed")
|
||||
:send-action #(js/alert "Send button pressed")
|
||||
:receive-action #(js/alert "Receive button pressed")
|
||||
:bridge-action #(js/alert "Bridge button pressed")})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view
|
||||
{:style {:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}}
|
||||
[quo/wallet-ctas @state]]]])))
|
||||
|
||||
(defn preview
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:flex 1}}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {}
|
||||
[quo/wallet-ctas
|
||||
{:buy-action #(js/alert "Buy button pressed")
|
||||
:send-action #(js/alert "Send button pressed")
|
||||
:receive-action #(js/alert "Receive button pressed")
|
||||
:bridge-action #(js/alert "Bridge button pressed")}]])
|
||||
|
||||
@@ -1,42 +1,26 @@
|
||||
(ns status-im2.contexts.quo-preview.calendar.calendar
|
||||
(:require [status-im2.contexts.quo-preview.preview :as preview]
|
||||
[react-native.core :as rn]
|
||||
[utils.datetime :as dt]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.datetime :as datetime]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Start Date"
|
||||
:key :start-date
|
||||
:type :text}
|
||||
{:label "End Date"
|
||||
:key :end-date
|
||||
:type :text}])
|
||||
[{:key :start-date
|
||||
:type :text}
|
||||
{:key :end-date
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:start-date nil :end-date nil})
|
||||
range (reagent/atom {:start-date nil :end-date nil})]
|
||||
(fn
|
||||
[]
|
||||
[rn/touchable-without-feedback
|
||||
{:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:style {:padding 19 :flex-grow 2}}
|
||||
[quo/calendar
|
||||
{:start-date (:start-date @range)
|
||||
:end-date (:end-date @range)
|
||||
:on-change (fn [new-range]
|
||||
(reset! state
|
||||
{:start-date (dt/format-date (:start-date new-range))
|
||||
:end-date (dt/format-date (:end-date new-range))})
|
||||
(reset! range new-range))}]]]])))
|
||||
|
||||
(defn preview-calendar
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[cool-preview]])
|
||||
(fn []
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/calendar
|
||||
{:start-date (:start-date @range)
|
||||
:end-date (:end-date @range)
|
||||
:on-change (fn [new-range]
|
||||
(reset! state
|
||||
{:start-date (datetime/format-date (:start-date new-range))
|
||||
:end-date (datetime/format-date (:end-date new-range))})
|
||||
(reset! range new-range))}]])))
|
||||
|
||||
@@ -1,45 +1,21 @@
|
||||
(ns status-im2.contexts.quo-preview.calendar.calendar-day
|
||||
(:require [status-im2.contexts.quo-preview.preview :as preview]
|
||||
[react-native.core :as rn]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "State:"
|
||||
:key :state
|
||||
[(preview/customization-color-option)
|
||||
{:key :state
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :selected
|
||||
:value "Selected"}
|
||||
{:key :disabled
|
||||
:value "Disabled"}
|
||||
{:key :today
|
||||
:value "Today"}]}])
|
||||
:options [{:key :default}
|
||||
{:key :selected}
|
||||
{:key :disabled}
|
||||
{:key :today}]}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom
|
||||
{:state :default})]
|
||||
(fn
|
||||
[]
|
||||
[rn/touchable-without-feedback
|
||||
{:on-press rn/dismiss-keyboard!}
|
||||
[rn/view
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo/calendar-day (assoc @state :customization-color :blue) 12]]]])))
|
||||
|
||||
(defn preview-calendar-day
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
(let [state (reagent/atom {:state :default
|
||||
:customization-color :blue})]
|
||||
(fn []
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/calendar-day @state 12]])))
|
||||
|
||||
@@ -1,39 +1,16 @@
|
||||
(ns status-im2.contexts.quo-preview.calendar.calendar-year
|
||||
(:require [status-im2.contexts.quo-preview.preview :as preview]
|
||||
[react-native.core :as rn]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Selected?"
|
||||
:key :selected?
|
||||
:type :boolean}
|
||||
{:label "Disabled?"
|
||||
:key :disabled?
|
||||
:type :boolean}])
|
||||
[{:key :selected? :type :boolean}
|
||||
{:key :disabled? :type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:selected? false :disabled? false})]
|
||||
(fn
|
||||
[]
|
||||
[rn/touchable-without-feedback
|
||||
{:on-press rn/dismiss-keyboard!}
|
||||
[rn/view
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo/calendar-year @state "2023"]]]])))
|
||||
|
||||
(defn preview-calendar-year
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
(let [state (reagent/atom {:selected? false
|
||||
:disabled? false})]
|
||||
(fn []
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/calendar-year @state "2023"]])))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
(ns status-im2.contexts.quo-preview.code.snippet
|
||||
(:require [quo2.components.code.snippet :as snippet]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
@@ -69,25 +67,21 @@
|
||||
:text go-example}})
|
||||
|
||||
(def descriptor
|
||||
[{:label "Language:"
|
||||
:key :language
|
||||
[{:key :language
|
||||
:type :select
|
||||
:options [{:key :clojure
|
||||
:value :clojure}
|
||||
{:key :go
|
||||
:value :go}]}
|
||||
{:label "Max lines:"
|
||||
:key :max-lines
|
||||
:options [{:key :clojure}
|
||||
{:key :go}]}
|
||||
{:key :max-lines
|
||||
:type :select
|
||||
:options (map (fn [n]
|
||||
{:key n
|
||||
:value (str n " lines")})
|
||||
(range 0 41 5))}
|
||||
{:label "Syntax highlight:"
|
||||
{:label "Syntax highlight?"
|
||||
:key :syntax
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:language :clojure
|
||||
:max-lines 40
|
||||
@@ -99,25 +93,9 @@
|
||||
(js/parseInt max-lines)
|
||||
(when-not (js/Number.isNaN max-lines)
|
||||
max-lines))]
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 60
|
||||
:padding-horizontal 16}}
|
||||
[snippet/snippet
|
||||
{:language language
|
||||
:max-lines max-lines
|
||||
:on-copy-press #(js/alert %)}
|
||||
text]]]]))))
|
||||
|
||||
(defn preview-code-snippet
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/snippet
|
||||
{:language language
|
||||
:max-lines max-lines
|
||||
:on-copy-press #(js/alert %)}
|
||||
text]]))))
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
(ns status-im2.contexts.quo-preview.community.channel-actions
|
||||
(:require [react-native.core :as rn]
|
||||
[quo2.components.community.channel-actions :as channel-actions]))
|
||||
(:require [quo2.core :as quo]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn preview-channel-actions
|
||||
(defn view
|
||||
[]
|
||||
[rn/view {:flex 1}
|
||||
[rn/scroll-view {:style {:flex 1 :padding-horizontal 20}}
|
||||
[channel-actions/channel-actions
|
||||
[quo/channel-actions
|
||||
{:actions [{:big? true
|
||||
:label "Pinned Messages"
|
||||
:color :blue
|
||||
:icon :i/pin
|
||||
:counter-value 0}]}]
|
||||
[rn/view {:height 50}]
|
||||
[channel-actions/channel-actions
|
||||
[quo/channel-actions
|
||||
{:actions [{:label "Pinned Messages" :color :blue :icon :i/pin :counter-value 5}
|
||||
{:label "Mute chat" :color :blue :icon :i/muted}]}]
|
||||
[rn/view {:height 50}]
|
||||
[channel-actions/channel-actions
|
||||
[quo/channel-actions
|
||||
{:actions [{:big? true :label "Pinned Messages" :color :blue :icon :i/pin :counter-value 5}
|
||||
{:label "Mute chat" :color :blue :icon :i/muted}]}]
|
||||
[rn/view {:height 50}]
|
||||
[channel-actions/channel-actions
|
||||
[quo/channel-actions
|
||||
{:actions [{:label "Pinned Messages" :color :blue :icon :i/pin :counter-value 5}
|
||||
{:label "Mute chat" :color :blue :icon :i/muted}
|
||||
{:label "Something else" :color :blue :icon :i/placeholder}]}]]])
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
(ns status-im2.contexts.quo-preview.community.community-card-view
|
||||
(:require [quo.design-system.colors :as quo.colors]
|
||||
[quo2.components.community.community-card-view :as community-card-view]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(def community-data
|
||||
{:id "id"
|
||||
@@ -28,48 +26,22 @@
|
||||
:emoji (resources/get-image :podcasts)}]})
|
||||
|
||||
(def descriptor
|
||||
[{:label "Status:"
|
||||
:key :status
|
||||
[{:key :status
|
||||
:type :select
|
||||
:options [{:key :gated
|
||||
:value "Gated"}
|
||||
{:key :open
|
||||
:value "Open"}]}
|
||||
{:label "Locked?"
|
||||
:key :locked?
|
||||
:type :boolean}
|
||||
{:label "Loading?"
|
||||
:key :loading?
|
||||
:type :boolean}])
|
||||
:options [{:key :gated}
|
||||
{:key :open}]}
|
||||
{:key :locked?
|
||||
:type :boolean}
|
||||
{:key :loading?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:status :gated
|
||||
:locked? true
|
||||
:loading? false})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view
|
||||
{:flex 1
|
||||
:padding 16}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:justify-content :center}
|
||||
[community-card-view/view
|
||||
{:community (merge @state community-data)
|
||||
:loading? (:loading? @state)}]]]])))
|
||||
|
||||
(defn preview-community-card
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/neutral-5
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/community-card-view-item
|
||||
{:community (merge @state community-data)
|
||||
:loading? (:loading? @state)}]])))
|
||||
|
||||
@@ -1,70 +1,37 @@
|
||||
(ns status-im2.contexts.quo-preview.community.community-membership-list-view
|
||||
(:require [quo.previews.preview :as preview]
|
||||
[quo.react-native :as rn]
|
||||
[quo2.components.community.community-list-view :as community-list-view]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.community.data :as data]))
|
||||
[status-im2.contexts.quo-preview.community.data :as data]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Notifications:"
|
||||
:key :notifications
|
||||
[{:key :notifications
|
||||
:type :select
|
||||
:options [{:key :muted
|
||||
:value "Muted"}
|
||||
{:key :unread-mentions-count
|
||||
:value "Mention counts"}
|
||||
{:key :unread-messages-count
|
||||
:value "Unread messages"}]}
|
||||
{:label "Status:"
|
||||
:key :status
|
||||
:options [{:key :muted}
|
||||
{:key :unread-mentions-count}
|
||||
{:key :unread-messages-count}]}
|
||||
{:key :status
|
||||
:type :select
|
||||
:options [{:key :gated
|
||||
:value "Gated"}
|
||||
{:key :open
|
||||
:value "Open"}]}
|
||||
{:label "Locked:"
|
||||
:key :locked?
|
||||
:type :boolean}])
|
||||
:options [{:key :gated}
|
||||
{:key :open}]}
|
||||
{:key :locked?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [notifications (reagent/atom (:notifications nil))
|
||||
state (reagent/atom {:locked? true
|
||||
:notifications nil
|
||||
:status (if notifications
|
||||
:gated
|
||||
:open)})]
|
||||
(let [state (reagent/atom {:locked? true
|
||||
:notifications :muted
|
||||
:status :gated})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view
|
||||
{:flex 1
|
||||
:padding 16}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:justify-content :center}
|
||||
[community-list-view/communities-membership-list-item {}
|
||||
false
|
||||
(cond-> (merge @state data/community)
|
||||
(= :muted (:notifications @state))
|
||||
(assoc :muted? true)
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/communities-membership-list-item {}
|
||||
false
|
||||
(cond-> (merge @state data/community)
|
||||
(= :muted (:notifications @state))
|
||||
(assoc :muted? true)
|
||||
|
||||
(= :unread-mentions-count (:notifications @state))
|
||||
(assoc :unread-mentions-count 5)
|
||||
(= :unread-mentions-count (:notifications @state))
|
||||
(assoc :unread-mentions-count 5)
|
||||
|
||||
(= :unread-messages-count (:notifications @state))
|
||||
(assoc :unread-messages? true))]]]])))
|
||||
|
||||
(defn preview-community-list-view
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/neutral-5
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
(= :unread-messages-count (:notifications @state))
|
||||
(assoc :unread-messages? true))]])))
|
||||
|
||||
@@ -1,42 +1,17 @@
|
||||
(ns status-im2.contexts.quo-preview.community.discover-card
|
||||
(:require [quo.previews.preview :as preview]
|
||||
[quo.react-native :as rn]
|
||||
[quo2.components.community.banner.view :as discover-card]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Joined:"
|
||||
:key :joined?
|
||||
:type :boolean}])
|
||||
[{:key :title :type :text}
|
||||
{:key :description :type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:joined? :false})]
|
||||
(let [state (reagent/atom {:title "Discover"
|
||||
:description "Your favourite communities"
|
||||
:joined? false})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view
|
||||
{:flex 1
|
||||
:padding 16}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:justify-content :center}
|
||||
[discover-card/view
|
||||
{:joined? (:joined? @state)
|
||||
:title (i18n/label :t/discover)
|
||||
:description (i18n/label :t/favorite-communities)}]]]])))
|
||||
|
||||
(defn preview-discoverd-card
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/neutral-5
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/discover-card @state]])))
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
(ns status-im2.contexts.quo-preview.community.token-gating
|
||||
(:require
|
||||
[quo2.foundations.resources :as resources]
|
||||
[reagent.core :as reagent]
|
||||
[react-native.core :as rn]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[quo2.core :as quo]))
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.resources :as resources]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Tokens sufficient"
|
||||
[{:label "Tokens sufficient?"
|
||||
:key :sufficient?
|
||||
:type :boolean}
|
||||
{:label "Many tokens ?"
|
||||
:key :many-tokens?
|
||||
:type :boolean}
|
||||
{:label "Loading ?"
|
||||
:key :loading?
|
||||
:type :boolean}
|
||||
{:label "Сondition ?"
|
||||
:key :condition?
|
||||
:type :boolean}
|
||||
{:label "Padding ?"
|
||||
:key :padding?
|
||||
:type :boolean}])
|
||||
{:key :many-tokens?
|
||||
:type :boolean}
|
||||
{:key :loading?
|
||||
:type :boolean}
|
||||
{:key :condition?
|
||||
:type :boolean}
|
||||
{:key :padding?
|
||||
:type :boolean}])
|
||||
|
||||
(defn join-gate-options-base
|
||||
[sufficient? many-tokens? loading?]
|
||||
@@ -75,17 +69,12 @@
|
||||
loading?)])
|
||||
:padding? padding?}))
|
||||
|
||||
(def state
|
||||
(reagent/atom {:sufficient? false
|
||||
:many-tokens? false
|
||||
:condition? false
|
||||
:padding? false}))
|
||||
|
||||
(defn preview-token-gating
|
||||
(defn view
|
||||
[]
|
||||
(let [preview-props (get-mocked-props @state)]
|
||||
[rn/view {:flex 1}
|
||||
[rn/scroll-view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view {:padding-horizontal 20 :padding-vertical 20}
|
||||
[quo/token-requirement-list preview-props]]]))
|
||||
(let [state (reagent/atom {:sufficient? false
|
||||
:many-tokens? false
|
||||
:condition? false
|
||||
:padding? false})]
|
||||
(fn []
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/token-requirement-list (get-mocked-props @state)]])))
|
||||
|
||||
@@ -1,52 +1,23 @@
|
||||
(ns status-im2.contexts.quo-preview.counter.counter
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :secondary
|
||||
:value "Secondary"}
|
||||
{:key :grey
|
||||
:value "Grey"}
|
||||
{:key :outline
|
||||
:value "Outline"}]}
|
||||
{:label "Value"
|
||||
:key :value
|
||||
:type :text}
|
||||
{:label "Customization color:"
|
||||
:key :customization-color
|
||||
:type :select
|
||||
:options (map (fn [color]
|
||||
(let [k (get color :name)]
|
||||
{:key k :value k}))
|
||||
(quo/picker-colors))}])
|
||||
:options [{:key :default}
|
||||
{:key :secondary}
|
||||
{:key :grey}
|
||||
{:key :outline}]}
|
||||
{:key :value
|
||||
:type :text}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:value 5 :type :default})]
|
||||
(let [state (reagent/atom {:value "5"
|
||||
:type :default})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo/counter @state (:value @state)]]]])))
|
||||
|
||||
(defn preview-counter
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/counter @state (:value @state)]])))
|
||||
|
||||
@@ -1,46 +1,28 @@
|
||||
(ns status-im2.contexts.quo-preview.counter.step
|
||||
(:require [quo2.core :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :neutral
|
||||
:value "Neutral (default)"}
|
||||
{:key :active
|
||||
:value "Active"}
|
||||
{:key :complete
|
||||
:value "Complete"}]}
|
||||
{:label "In blur view?"
|
||||
:key :in-blur-view?
|
||||
:type :boolean}
|
||||
{:label "Value"
|
||||
:key :value
|
||||
:type :text}])
|
||||
:options [{:key :neutral}
|
||||
{:key :active}
|
||||
{:key :complete}]}
|
||||
{:key :in-blur-view?
|
||||
:type :boolean}
|
||||
{:key :value
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:value 5 :type :neutral :in-blur-view? false})]
|
||||
(let [state (reagent/atom {:value "5"
|
||||
:type :neutral
|
||||
:in-blur-view? false})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo2/step @state (:value @state)]]]])))
|
||||
|
||||
(defn preview-step
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:in-blur-view? @state)
|
||||
:show-blur-background? (:in-blur-view? @state)}
|
||||
[quo/step @state (:value @state)]])))
|
||||
|
||||
@@ -1,33 +1,14 @@
|
||||
(ns status-im2.contexts.quo-preview.dividers.date
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Value"
|
||||
:key :label
|
||||
:type :text}])
|
||||
(defn cool-preview
|
||||
[{:key :label :type :text}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:label "Today"})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[quo/divider-date (@state :label)]]]])))
|
||||
|
||||
(defn preview-divider-date
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/divider-date (@state :label)]])))
|
||||
|
||||
@@ -4,26 +4,48 @@
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:type :text :key :label}
|
||||
{:type :text :key :counter-value}
|
||||
{:type :boolean :key :increase-padding-top?}
|
||||
{:type :boolean :key :blur?}
|
||||
{:key :chevron-position
|
||||
[{:key :label
|
||||
:type :text}
|
||||
{:key :chevron
|
||||
:type :select
|
||||
:options [{:key :left}
|
||||
{:key :right}]}])
|
||||
:options [{:key :left
|
||||
:value "Left"}
|
||||
{:key :right
|
||||
:value "Right"}
|
||||
{:key nil
|
||||
:value "None"}]}
|
||||
{:key :chevron-icon
|
||||
:type :select
|
||||
:options [{:key :i/chevron-down
|
||||
:value "Chevron Down"}
|
||||
{:key :i/chevron-right
|
||||
:value "Chevron Right"}]}
|
||||
{:key :tight?
|
||||
:type :boolean}
|
||||
{:key :counter?
|
||||
:type :boolean}
|
||||
{:key :counter-value
|
||||
:type :text}
|
||||
{:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:blur? false
|
||||
:chevron-position :left
|
||||
:counter-value "0"
|
||||
:increase-padding-top? true
|
||||
:label "Welcome"})]
|
||||
(let [state (reagent/atom {:label "Welcome"
|
||||
:chevron nil
|
||||
:chevron-icon nil
|
||||
:tight? true
|
||||
:counter? false
|
||||
:counter-value 0
|
||||
:blur? false})]
|
||||
(fn []
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/divider-label @state]])))
|
||||
[quo/divider-label
|
||||
(assoc @state
|
||||
:on-press
|
||||
#(js/alert "Divider label pressed!"))
|
||||
(:label @state)]])))
|
||||
|
||||
@@ -1,62 +1,30 @@
|
||||
(ns status-im2.contexts.quo-preview.dividers.new-messages
|
||||
(:require [quo2.components.dividers.new-messages :as new-messages]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Label"
|
||||
:key :label
|
||||
:type :text}
|
||||
{:label "Color"
|
||||
:key :color
|
||||
[{:key :label
|
||||
:type :text}
|
||||
{:key :color
|
||||
:type :select
|
||||
:options [{:key :primary
|
||||
:value "Primary"}
|
||||
{:key :purple
|
||||
:value "Purple"}
|
||||
{:key :indigo
|
||||
:value "Indigo"}
|
||||
{:key :turquoise
|
||||
:value "Turquoise"}
|
||||
{:key :blue
|
||||
:value "Blue"}
|
||||
{:key :green
|
||||
:value "Green"}
|
||||
{:key :yellow
|
||||
:value "yellow"}
|
||||
{:key :orange
|
||||
:value "Orange"}
|
||||
{:key :red
|
||||
:value "Red"}
|
||||
{:key :pink
|
||||
:value "Pink"}
|
||||
{:key :brown
|
||||
:value "Brown"}
|
||||
{:key :beige
|
||||
:value "Beige"}]}])
|
||||
(defn cool-preview
|
||||
:options [{:key :primary}
|
||||
{:key :purple}
|
||||
{:key :indigo}
|
||||
{:key :turquoise}
|
||||
{:key :blue}
|
||||
{:key :green}
|
||||
{:key :yellow}
|
||||
{:key :orange}
|
||||
{:key :red}
|
||||
{:key :pink}
|
||||
{:key :brown}
|
||||
{:key :beige}]}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:label (i18n/label :new-messages-header)
|
||||
(let [state (reagent/atom {:label "New messages"
|
||||
:color :primary})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[new-messages/new-messages @state]]]])))
|
||||
|
||||
(defn preview-new-messages
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/new-messages @state]])))
|
||||
|
||||
@@ -1,55 +1,28 @@
|
||||
(ns status-im2.contexts.quo-preview.dividers.strength-divider
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :very-weak
|
||||
:value "Very weak"}
|
||||
{:key :weak
|
||||
:value "Weak"}
|
||||
{:key :okay
|
||||
:value "Okay"}
|
||||
{:key :strong
|
||||
:value "Strong"}
|
||||
{:key :very-strong
|
||||
:value "Very strong"}
|
||||
{:key :alert
|
||||
:value "Alert"}
|
||||
{:key :info
|
||||
:value "Info"}]}
|
||||
{:label "Text(only works for info/alert)"
|
||||
:options [{:key :very-weak}
|
||||
{:key :weak}
|
||||
{:key :okay}
|
||||
{:key :strong}
|
||||
{:key :very-strong}
|
||||
{:key :alert}
|
||||
{:key :info}]}
|
||||
{:label "Text (only works for info/alert)"
|
||||
:key :text
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:text "Common password, shouldn’t be used"
|
||||
:type :alert})
|
||||
text (reagent/cursor state [:text])
|
||||
type (reagent/cursor state [:type])]
|
||||
:type :alert})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60 :background-color colors/neutral-95}
|
||||
[quo/strength-divider {:type @type} @text]]]])))
|
||||
|
||||
(defn preview-strength-divider
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/strength-divider
|
||||
{:type (:type @state)}
|
||||
(:text @state)]])))
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
(ns status-im2.contexts.quo-preview.drawers.action-drawers
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Muted?"
|
||||
:key :muted?
|
||||
:type :boolean}
|
||||
{:label "Mark as read disabled?"
|
||||
:key :mark-as-read-disabled?
|
||||
:type :boolean}
|
||||
{:label "Show red options?"
|
||||
:key :show-red-options?
|
||||
:type :boolean}
|
||||
{:label "Drawer theme"
|
||||
:key :theme
|
||||
[{:key :muted?
|
||||
:type :boolean}
|
||||
{:key :mark-as-read-disabled?
|
||||
:type :boolean}
|
||||
{:key :show-red-options?
|
||||
:type :boolean}
|
||||
{:key :theme
|
||||
:type :select
|
||||
:options [{:key :dark :value "Dark"}
|
||||
{:key :light :value "Light"}
|
||||
:options [{:key :dark}
|
||||
{:key :light}
|
||||
{:key nil :value "System"}]}])
|
||||
|
||||
(def options-with-consequences
|
||||
@@ -30,7 +25,7 @@
|
||||
:add-divider? true
|
||||
:on-press #(js/alert "clear history")}])
|
||||
|
||||
(defn render-action-sheet
|
||||
(defn action-sheet
|
||||
[state]
|
||||
[quo/action-drawer
|
||||
(cond->
|
||||
@@ -58,31 +53,17 @@
|
||||
(:show-red-options? @state)
|
||||
(conj options-with-consequences))])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:muted? true
|
||||
:show-red-options? true})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 400}
|
||||
[preview/customizer state descriptor]
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn [] [render-action-sheet state])
|
||||
:theme (:theme @state)}])}
|
||||
"See in bottom sheet"]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[render-action-sheet state]]]])))
|
||||
|
||||
(defn preview-action-drawers
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:nestedScrollEnabled true
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn (fn [_ index] (str "actions-drawers-" index))}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn [] [action-sheet state])
|
||||
:theme (:theme @state)}])}
|
||||
"See in bottom sheet"]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[action-sheet state]]])))
|
||||
|
||||
@@ -7,27 +7,23 @@
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Title"
|
||||
:key :title
|
||||
:type :text}
|
||||
{:label "Show button"
|
||||
:key :show-button?
|
||||
:type :boolean}
|
||||
{:label "Button label"
|
||||
:key :button-label
|
||||
:type :text}
|
||||
{:label "Shell"
|
||||
:key :shell?
|
||||
:type :boolean}])
|
||||
[{:key :title
|
||||
:type :text}
|
||||
{:key :show-button?
|
||||
:type :boolean}
|
||||
{:key :button-label
|
||||
:type :text}
|
||||
{:key :shell?
|
||||
:type :boolean}])
|
||||
|
||||
(defn documentation-content
|
||||
[override-theme]
|
||||
[quo/text {:style {:color (colors/theme-colors colors/neutral-100 colors/white override-theme)}}
|
||||
[theme]
|
||||
[quo/text {:style {:color (colors/theme-colors colors/neutral-100 colors/white theme)}}
|
||||
"Group chats are conversations of more than two people. To invite someone to a group chat, you need to have them on your Status contact list."])
|
||||
|
||||
(defn documentation-content-full
|
||||
[override-theme]
|
||||
(let [text-color (colors/theme-colors colors/neutral-100 colors/white override-theme)
|
||||
[theme]
|
||||
(let [text-color (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
text-style {:color text-color :margin-bottom 10}]
|
||||
[rn/view
|
||||
[quo/text {:style text-style}
|
||||
@@ -75,7 +71,7 @@
|
||||
[quo/text {:style text-style}
|
||||
"Group chats are always end-to-end encrypted with secure cryptographic keys. Only the group chat members will have access to the messages in it. Status doesn't have the keys and can't access any messages by design."]]))
|
||||
|
||||
(defn render-documenation-drawer
|
||||
(defn documenation-drawer
|
||||
[title show-button? button-label expanded? shell?]
|
||||
[quo/documentation-drawers
|
||||
{:title title
|
||||
@@ -88,45 +84,26 @@
|
||||
[documentation-content-full (when shell? :dark)]
|
||||
[documentation-content (when shell? :dark)])])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let
|
||||
[state
|
||||
(reagent/atom
|
||||
{:title "Create a group chat"
|
||||
:button-label "Read more"})
|
||||
title (reagent/cursor state [:title])
|
||||
show-button? (reagent/cursor state [:show-button?])
|
||||
button-label (reagent/cursor state [:button-label])
|
||||
shell? (reagent/cursor state [:shell?])
|
||||
expanded? (reagent/atom false)]
|
||||
(let [state (reagent/atom {:title "Create a group chat"
|
||||
:button-label "Read more"})
|
||||
title (reagent/cursor state [:title])
|
||||
show-button? (reagent/cursor state [:show-button?])
|
||||
button-label (reagent/cursor state [:button-label])
|
||||
shell? (reagent/cursor state [:shell?])
|
||||
expanded? (reagent/atom false)]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40
|
||||
:margin-bottom 20}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content (constantly [render-documenation-drawer @title
|
||||
@show-button?
|
||||
@button-label expanded? @shell?])
|
||||
:expandable? @show-button?
|
||||
:shell? @shell?
|
||||
:expanded? @expanded?}])}
|
||||
"Open drawer"]
|
||||
[render-documenation-drawer @title @show-button? @button-label expanded?]]]])))
|
||||
|
||||
(defn preview-documenation-drawers
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40
|
||||
:margin-bottom 20}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content (constantly [documenation-drawer @title
|
||||
@show-button?
|
||||
@button-label expanded? @shell?])
|
||||
:expandable? @show-button?
|
||||
:shell? @shell?
|
||||
:expanded? @expanded?}])}
|
||||
"Open drawer"]
|
||||
[documenation-drawer @title @show-button? @button-label expanded?]])))
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
(ns status-im2.contexts.quo-preview.drawers.drawer-buttons
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Top Heading"
|
||||
:key :top-heading
|
||||
:type :text}
|
||||
{:label "Top Sub heading"
|
||||
:key :top-sub-heading
|
||||
:type :text}
|
||||
{:label "Bottom heading"
|
||||
:key :bottom-heading
|
||||
:type :text}])
|
||||
[{:key :top-heading
|
||||
:type :text}
|
||||
{:key :top-sub-heading
|
||||
:type :text}
|
||||
{:key :bottom-heading
|
||||
:type :text}])
|
||||
|
||||
(defn text-with-link
|
||||
[]
|
||||
@@ -35,40 +31,20 @@
|
||||
:weight :semi-bold}
|
||||
"Terms of Use"]])
|
||||
|
||||
(defn render-drawer-buttons
|
||||
[state]
|
||||
[rn/view
|
||||
{:height 300
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95)}
|
||||
[quo/drawer-buttons
|
||||
{:container-style {:margin-left 40
|
||||
:margin-right 24}
|
||||
:top-card {:on-press #(js/alert "top card clicked")
|
||||
:heading (:top-heading @state)}
|
||||
:bottom-card {:on-press #(js/alert "bottom card clicked")
|
||||
:heading (:bottom-heading @state)}}
|
||||
(:top-sub-heading @state) [text-with-link]]])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:top-heading "Sign in "
|
||||
(let [state (reagent/atom {:top-heading "Sign in"
|
||||
:top-sub-heading "You already use Status"
|
||||
:bottom-heading "I’m new to Status"})]
|
||||
:bottom-heading "I'm new to Status"})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 400}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view {:padding-vertical 60}
|
||||
[render-drawer-buttons state]]]])))
|
||||
|
||||
(defn preview-drawer-buttons
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:nestedScrollEnabled true
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn :id}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:margin-top 40}}
|
||||
[quo/drawer-buttons
|
||||
{:top-card {:on-press #(js/alert "top card clicked")
|
||||
:heading (:top-heading @state)}
|
||||
:bottom-card {:on-press #(js/alert "bottom card clicked")
|
||||
:heading (:bottom-heading @state)}}
|
||||
(:top-sub-heading @state)
|
||||
[text-with-link]]])))
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
[react-native.core :as rn]
|
||||
[status-im2.common.resources :as resources]))
|
||||
|
||||
(def token-icon (resources/get-mock-image :status-logo))
|
||||
|
||||
(defn example-1
|
||||
[]
|
||||
[:<>
|
||||
@@ -13,14 +15,12 @@
|
||||
{:size 24
|
||||
:locked? false
|
||||
:tokens [{:id 1
|
||||
:group [{:id 1 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 2 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 3 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 4 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 5 :token-icon (resources/get-mock-image :status-logo)}]}]
|
||||
:background-color (colors/theme-colors
|
||||
colors/neutral-10
|
||||
colors/neutral-80)}]
|
||||
:group [{:id 1 :token-icon token-icon}
|
||||
{:id 2 :token-icon token-icon}
|
||||
{:id 3 :token-icon token-icon}
|
||||
{:id 4 :token-icon token-icon}
|
||||
{:id 5 :token-icon token-icon}]}]
|
||||
:background-color (colors/theme-colors colors/neutral-10 colors/neutral-80)}]
|
||||
[quo/text
|
||||
{:style {:margin-left 4
|
||||
:margin-right 4}} "Or"]
|
||||
@@ -28,14 +28,12 @@
|
||||
{:size 24
|
||||
:locked? false
|
||||
:tokens [{:id 1
|
||||
:group [{:id 1 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 2 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 3 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 4 :token-icon (resources/get-mock-image :status-logo)}
|
||||
{:id 5 :token-icon (resources/get-mock-image :status-logo)}]}]
|
||||
:background-color (colors/theme-colors
|
||||
colors/neutral-10
|
||||
colors/neutral-80)}]
|
||||
:group [{:id 1 :token-icon token-icon}
|
||||
{:id 2 :token-icon token-icon}
|
||||
{:id 3 :token-icon token-icon}
|
||||
{:id 4 :token-icon token-icon}
|
||||
{:id 5 :token-icon token-icon}]}]
|
||||
:background-color (colors/theme-colors colors/neutral-10 colors/neutral-80)}]
|
||||
[quo/text {:style {:margin-left 4}} "To post"]])
|
||||
|
||||
(defn example-2
|
||||
@@ -53,7 +51,7 @@
|
||||
[quo/icon :i/communities {:color (colors/theme-colors colors/neutral-100 colors/white)}]
|
||||
[quo/text {:style {:margin-right 4}} "Join community to post"]])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(fn []
|
||||
[:<>
|
||||
@@ -63,15 +61,3 @@
|
||||
[quo/permission-context [example-2] #(js/alert "drawer pressed")]]
|
||||
[rn/view {:margin-top 60}
|
||||
[quo/permission-context [example-3] #(js/alert "drawer pressed")]]]))
|
||||
|
||||
(defn preview-permission-drawers
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/neutral-20 colors/neutral-100)}
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:nested-scroll-enabled true
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn hash}]])
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
(ns status-im2.contexts.quo-preview.dropdowns.dropdown
|
||||
(:require [quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[quo2.core :as quo]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :primary
|
||||
:value "Primary"}
|
||||
{:key :secondary
|
||||
:value "Secondary"}
|
||||
{:key :grey
|
||||
:value "Grey"}
|
||||
{:key :dark-grey
|
||||
:value "Dark Grey"}
|
||||
{:key :outline
|
||||
:value "Outline"}
|
||||
{:key :ghost
|
||||
:value "Ghost"}
|
||||
{:key :danger
|
||||
:value "Danger"}
|
||||
{:key :positive
|
||||
:value "Positive"}]}
|
||||
{:label "Size:"
|
||||
:key :size
|
||||
:options [{:key :primary}
|
||||
{:key :secondary}
|
||||
{:key :grey}
|
||||
{:key :dark-grey}
|
||||
{:key :outline}
|
||||
{:key :ghost}
|
||||
{:key :danger}
|
||||
{:key :positive}]}
|
||||
{:key :size
|
||||
:type :select
|
||||
:options [{:key 56
|
||||
:value "56"}
|
||||
@@ -36,20 +24,17 @@
|
||||
:value "32"}
|
||||
{:key 24
|
||||
:value "24"}]}
|
||||
{:label "Icon:"
|
||||
:key :icon
|
||||
:type :boolean}
|
||||
{:key :icon
|
||||
:type :boolean}
|
||||
{:label "Before icon:"
|
||||
:key :before
|
||||
:type :boolean}
|
||||
{:label "Disabled:"
|
||||
:key :disabled
|
||||
:type :boolean}
|
||||
{:label "Label"
|
||||
:key :label
|
||||
:type :text}])
|
||||
{:key :disabled
|
||||
:type :boolean}
|
||||
{:key :label
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:label "Press Me"
|
||||
:size 40})
|
||||
@@ -57,32 +42,16 @@
|
||||
before (reagent/cursor state [:before])
|
||||
icon (reagent/cursor state [:icon])]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}
|
||||
[quo/dropdown
|
||||
(merge (dissoc @state
|
||||
:theme
|
||||
:before
|
||||
:after)
|
||||
{:on-press #(println "Hello world!")}
|
||||
(when @before
|
||||
{:before :i/placeholder}))
|
||||
(if @icon :i/placeholder @label)]]]])))
|
||||
|
||||
(defn preview-dropdown
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:flex-grow 1
|
||||
:nestedScrollEnabled true
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:align-items :center}}
|
||||
[quo/dropdown
|
||||
(merge (dissoc @state
|
||||
:theme
|
||||
:before
|
||||
:after)
|
||||
{:on-press #(println "Hello world!")}
|
||||
(when @before
|
||||
{:before :i/placeholder}))
|
||||
(if @icon :i/placeholder @label)]])))
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
(ns status-im2.contexts.quo-preview.dropdowns.network-dropdown
|
||||
(:require [quo2.foundations.resources :as quo.resources]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[quo2.core :as quo]))
|
||||
|
||||
(def descriptor
|
||||
[{:key :state
|
||||
:type :select
|
||||
:options [{:key :default}
|
||||
{:key :disabled}]}
|
||||
{:key :blur?
|
||||
:type :select
|
||||
:options [{:key true}
|
||||
{:key false}]}
|
||||
{:key :amount
|
||||
:type :select
|
||||
:options [{:key 1}
|
||||
{:key 2}
|
||||
{:key 3}]}])
|
||||
|
||||
(def ^:private networks-list
|
||||
[{:source (quo.resources/get-network :ethereum)}
|
||||
{:source (quo.resources/get-network :optimism)}
|
||||
{:source (quo.resources/get-network :arbitrum)}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [component-state (reagent/atom {:state :default :blur? false :amount 3})]
|
||||
(fn []
|
||||
[preview/preview-container
|
||||
{:state component-state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @component-state)
|
||||
:show-blur-background? true}
|
||||
[rn/view {:style {:align-self :center}}
|
||||
[quo/network-dropdown
|
||||
(merge {:on-press #(js/alert "Dropdown pressed")}
|
||||
@component-state)
|
||||
(take (:amount @component-state) networks-list)]]])))
|
||||
@@ -1,40 +1,28 @@
|
||||
(ns status-im2.contexts.quo-preview.empty-state.empty-state
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[status-im2.common.resources :as resources]))
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Title:"
|
||||
:key :title
|
||||
:type :text}
|
||||
{:label "Description:"
|
||||
:key :description
|
||||
:type :text}
|
||||
{:label "Image:"
|
||||
:key :image
|
||||
[{:key :title
|
||||
:type :text}
|
||||
{:key :description
|
||||
:type :text}
|
||||
{:key :image
|
||||
:type :select
|
||||
:options [{:key :no-contacts-light
|
||||
:value "No contacts light"}
|
||||
{:key :no-contacts-dark
|
||||
:value "No contacts dark"}
|
||||
{:key :no-messages-light
|
||||
:value "No messages light"}
|
||||
{:key :no-messages-dark
|
||||
:value "No messages dark"}]}
|
||||
{:label "Upper button text"
|
||||
:key :upper-button-text
|
||||
:type :text}
|
||||
{:label "Lower button text"
|
||||
:key :lower-button-text
|
||||
:type :text}
|
||||
{:label "Blur:"
|
||||
:key :blur?
|
||||
:type :boolean}])
|
||||
:options [{:key :no-contacts-light}
|
||||
{:key :no-contacts-dark}
|
||||
{:key :no-messages-light}
|
||||
{:key :no-messages-dark}]}
|
||||
{:key :upper-button-text
|
||||
:type :text}
|
||||
{:key :lower-button-text
|
||||
:type :text}
|
||||
{:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:image :no-messages-light
|
||||
:title "A big friendly title"
|
||||
@@ -43,42 +31,18 @@
|
||||
:upper-button-text "Send community link"
|
||||
:lower-button-text "Invite friends to Status"})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:style {:margin-vertical 24
|
||||
:background-color (when (:blur? @state) colors/neutral-95)}}
|
||||
[preview/blur-view
|
||||
{:style {:width "100%"
|
||||
:align-items :center
|
||||
:top (if (:blur? @state) 32 16)
|
||||
:position (if (:blur? @state)
|
||||
:absolute
|
||||
:relative)}
|
||||
:height 300
|
||||
:show-blur-background? (:blur? @state)
|
||||
:blur-view-props (when (:blur? @state)
|
||||
{:overlay-color colors/neutral-80-opa-80})}
|
||||
|
||||
[rn/view {:style {:flex 1 :width "100%"}}
|
||||
[quo/empty-state
|
||||
(-> @state
|
||||
(assoc :upper-button
|
||||
{:text (:upper-button-text @state)
|
||||
:on-press #(js/alert "Upper button")})
|
||||
(assoc :lower-button
|
||||
{:text (:lower-button-text @state)
|
||||
:on-press #(js/alert "Lower button")})
|
||||
(update :image resources/get-image))]]]]]])))
|
||||
|
||||
(defn preview-empty-state
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:flex 1
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-95)}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:blur-height 300
|
||||
:show-blur-background? true}
|
||||
[quo/empty-state
|
||||
(-> @state
|
||||
(assoc :upper-button
|
||||
{:text (:upper-button-text @state)
|
||||
:on-press #(js/alert "Upper button")})
|
||||
(assoc :lower-button
|
||||
{:text (:lower-button-text @state)
|
||||
:on-press #(js/alert "Lower button")})
|
||||
(update :image resources/get-image))]])))
|
||||
|
||||
@@ -24,50 +24,36 @@
|
||||
(when shadow? shadow-style))}]])
|
||||
|
||||
(def descriptor
|
||||
[{:label "Shadows enabled?"
|
||||
:key :shadow?
|
||||
:type :boolean}])
|
||||
[{:key :shadow?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:shadow? true})
|
||||
shadow? (reagent/cursor state [:shadow?])]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[preview/customizer state descriptor]
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Normal Scales"]
|
||||
[demo-box @shadow? "Shadow 1" (shadows/get 1)]
|
||||
[demo-box @shadow? "Shadow 2" (shadows/get 2)]
|
||||
[demo-box @shadow? "Shadow 3" (shadows/get 3)]
|
||||
[demo-box @shadow? "Shadow 4" (shadows/get 4)]
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Inverted Scales"]
|
||||
[demo-box @shadow? "Shadow 1" (shadows/get 1 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 2" (shadows/get 2 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 3" (shadows/get 3 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 4" (shadows/get 4 (quo.theme/get-theme) :inverted)]
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Inverted Scales"]
|
||||
[demo-box @shadow? "Inner Shadow" shadows/inner-shadow]]])))
|
||||
|
||||
(defn preview-shadows
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/neutral-30 colors/neutral-95)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Normal Scales"]
|
||||
[demo-box @shadow? "Shadow 1" (shadows/get 1)]
|
||||
[demo-box @shadow? "Shadow 2" (shadows/get 2)]
|
||||
[demo-box @shadow? "Shadow 3" (shadows/get 3)]
|
||||
[demo-box @shadow? "Shadow 4" (shadows/get 4)]
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Inverted Scales"]
|
||||
[demo-box @shadow? "Shadow 1" (shadows/get 1 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 2" (shadows/get 2 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 3" (shadows/get 3 (quo.theme/get-theme) :inverted)]
|
||||
[demo-box @shadow? "Shadow 4" (shadows/get 4 (quo.theme/get-theme) :inverted)]
|
||||
[quo/text
|
||||
{:style {:margin-left :auto
|
||||
:margin-right :auto
|
||||
:align-items :center}}
|
||||
"Inverted Scales"]
|
||||
[demo-box @shadow? "Inner Shadow" shadows/inner-shadow]])))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im2.contexts.quo-preview.gradient.gradient-cover
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.theme :as quo.theme]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.core :as rn]
|
||||
@@ -43,7 +42,7 @@
|
||||
:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:customization-color :blue :blur? false})
|
||||
blur? (reagent/cursor state [:blur?])
|
||||
@@ -54,8 +53,7 @@
|
||||
(when @blur?
|
||||
(quo.theme/set-theme :dark)))
|
||||
[@blur?])
|
||||
[:<>
|
||||
[preview/customizer state descriptor]
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[rn/view
|
||||
{:style {:height 332
|
||||
:margin-top 24
|
||||
@@ -75,13 +73,6 @@
|
||||
:padding-vertical 40}
|
||||
:blur-type :dark}
|
||||
[quo/gradient-cover @state]]]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 20
|
||||
:padding-horizontal 16}}
|
||||
[quo/color-picker
|
||||
{:blur? @blur?
|
||||
:selected @customization-color
|
||||
:on-change #(reset! customization-color %)}]]
|
||||
[quo/button
|
||||
{:container-style {:margin-horizontal 40}
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
@@ -89,16 +80,3 @@
|
||||
:gradient-cover? true
|
||||
:customization-color @customization-color}])}
|
||||
"See in bottom sheet"]])]))
|
||||
|
||||
(defn preview-gradient-cover
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
(ns status-im2.contexts.quo-preview.graph.wallet-graph
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
@@ -20,26 +18,17 @@
|
||||
(recur (dec n) new-prices new-price volatility)))))
|
||||
|
||||
(def descriptor
|
||||
[{:label "State:"
|
||||
:key :state
|
||||
[{:key :state
|
||||
:type :select
|
||||
:options [{:key :positive
|
||||
:value "Positive"}
|
||||
{:key :negative
|
||||
:value "Negative"}]}
|
||||
{:label "Time frame:"
|
||||
:key :time-frame
|
||||
:options [{:key :positive}
|
||||
{:key :negative}]}
|
||||
{:key :time-frame
|
||||
:type :select
|
||||
:options [{:key :empty
|
||||
:value "Empty"}
|
||||
{:key :1-week
|
||||
:value "1 Week"}
|
||||
{:key :1-month
|
||||
:value "1 Month"}
|
||||
{:key :3-months
|
||||
:value "3 Months"}
|
||||
{:key :1-year
|
||||
:value "1 Year"}
|
||||
:options [{:key :empty}
|
||||
{:key :1-week}
|
||||
{:key :1-month}
|
||||
{:key :3-months}
|
||||
{:key :1-year}
|
||||
{:key :all-time
|
||||
:value "All time (500 years data)"}]}])
|
||||
|
||||
@@ -61,30 +50,16 @@
|
||||
0.005)]
|
||||
(generate-crypto-token-prices data-points volatility)))
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:state :positive
|
||||
:time-frame :1-week})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[quo/wallet-graph
|
||||
{:data (generate-data (:time-frame @state))
|
||||
:state (:state @state)
|
||||
:time-frame (:time-frame @state)}]]])))
|
||||
|
||||
(defn preview-wallet-graph
|
||||
[]
|
||||
[rn/view
|
||||
{:style
|
||||
{:background-color (colors/theme-colors
|
||||
colors/white
|
||||
colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str
|
||||
:scroll-enabled false}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:component-container-style {:padding-horizontal 0 :margin-top 200}}
|
||||
[quo/wallet-graph
|
||||
{:data (generate-data (:time-frame @state))
|
||||
:state (:state @state)
|
||||
:time-frame (:time-frame @state)}]])))
|
||||
|
||||
@@ -1,53 +1,27 @@
|
||||
(ns status-im2.contexts.quo-preview.info.info-message
|
||||
(:require [quo2.components.info.info-message :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.components.info.info-message :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :success
|
||||
:value "Success"}
|
||||
{:key :error
|
||||
:value "Error"}]}
|
||||
{:label "Size:"
|
||||
:key :size
|
||||
:options [{:key :default}
|
||||
{:key :success}
|
||||
{:key :error}]}
|
||||
{:key :size
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :tiny
|
||||
:value "Tiny"}]}
|
||||
{:label "Message"
|
||||
:key :message
|
||||
:type :text}])
|
||||
:options [{:key :default}
|
||||
{:key :tiny}]}
|
||||
{:key :message
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:type :default
|
||||
:size :default
|
||||
:icon :i/placeholder
|
||||
:message "This is a message"})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo2/info-message @state (:message @state)]]]])))
|
||||
|
||||
(defn preview-info-message
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/info-message @state (:message @state)]])))
|
||||
|
||||
@@ -1,38 +1,28 @@
|
||||
(ns status-im2.contexts.quo-preview.info.information-box
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :informative
|
||||
:value "Informative"}
|
||||
{:key :error
|
||||
:value "Error"}]}
|
||||
{:label "Closable?"
|
||||
:key :closable?
|
||||
:type :boolean}
|
||||
{:label "Message"
|
||||
:key :message
|
||||
:type :text}
|
||||
{:label "Button Label"
|
||||
:key :button-label
|
||||
:type :text}])
|
||||
:options [{:key :default}
|
||||
{:key :informative}
|
||||
{:key :error}]}
|
||||
{:key :closable?
|
||||
:type :boolean}
|
||||
{:key :message
|
||||
:type :text}
|
||||
{:key :button-label
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom
|
||||
{:type :default
|
||||
:closable? true
|
||||
:message (str "If you registered a stateofus.eth name "
|
||||
"you might be eligible to connect $ENS")
|
||||
:button-label "Button"})
|
||||
(let [state (reagent/atom {:type :default
|
||||
:closable? true
|
||||
:message (str "If you registered a stateofus.eth name "
|
||||
"you might be eligible to connect $ENS")
|
||||
:button-label "Button"})
|
||||
closable? (reagent/cursor state [:closable?])
|
||||
closed? (reagent/cursor state [:closed?])
|
||||
on-close (fn []
|
||||
@@ -40,26 +30,10 @@
|
||||
(js/setTimeout (fn [] (reset! closed? false))
|
||||
2000))]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:style {:padding-vertical 20
|
||||
:align-items :center}}
|
||||
[quo/information-box
|
||||
(merge {:icon :i/info
|
||||
:style {:width 335}
|
||||
:on-close (when @closable? on-close)}
|
||||
@state)
|
||||
(:message @state)]]]])))
|
||||
|
||||
(defn preview-information-box
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/information-box
|
||||
(merge {:icon :i/info
|
||||
:style {:width 335}
|
||||
:on-close (when @closable? on-close)}
|
||||
@state)
|
||||
(:message @state)]])))
|
||||
|
||||
@@ -1,48 +1,33 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.input
|
||||
(:require [clojure.string :as string]
|
||||
[quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Type:"
|
||||
:key :type
|
||||
[{:key :type
|
||||
:type :select
|
||||
:options [{:key :text
|
||||
:value "Text"}
|
||||
{:key :password
|
||||
:value "Password"}]}
|
||||
{:label "Blur:"
|
||||
:key :blur?
|
||||
:type :boolean}
|
||||
{:label "Error:"
|
||||
:key :error?
|
||||
:type :boolean}
|
||||
{:label "Icon:"
|
||||
:key :icon-name
|
||||
:type :boolean}
|
||||
{:label "Disabled:"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "Clearable:"
|
||||
:key :clearable?
|
||||
:type :boolean}
|
||||
{:label "Small:"
|
||||
:key :small?
|
||||
:type :boolean}
|
||||
{:label "Multiline:"
|
||||
:key :multiline
|
||||
:type :boolean}
|
||||
{:label "Button:"
|
||||
:key :button
|
||||
:type :boolean}
|
||||
{:label "Label:"
|
||||
:key :label
|
||||
:type :text}
|
||||
{:label "Char limit:"
|
||||
:key :char-limit
|
||||
:options [{:key :text}
|
||||
{:key :password}]}
|
||||
{:key :blur?
|
||||
:type :boolean}
|
||||
{:key :error?
|
||||
:type :boolean}
|
||||
{:key :icon-name
|
||||
:type :boolean}
|
||||
{:key :disabled?
|
||||
:type :boolean}
|
||||
{:key :clearable?
|
||||
:type :boolean}
|
||||
{:key :small?
|
||||
:type :boolean}
|
||||
{:key :multiline
|
||||
:type :boolean}
|
||||
{:key :button
|
||||
:type :boolean}
|
||||
{:key :label
|
||||
:type :text}
|
||||
{:key :char-limit
|
||||
:type :select
|
||||
:options [{:key 10
|
||||
:value "10"}
|
||||
@@ -50,14 +35,13 @@
|
||||
:value "50"}
|
||||
{:key 100
|
||||
:value "100"}]}
|
||||
{:label "Value:"
|
||||
:key :value
|
||||
:type :text}])
|
||||
{:key :value
|
||||
:type :text}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:type :text
|
||||
:blur false
|
||||
:blur? false
|
||||
:placeholder "Type something"
|
||||
:error false
|
||||
:icon-name false
|
||||
@@ -66,36 +50,23 @@
|
||||
:on-char-limit-reach #(js/alert
|
||||
(str "Char limit reached: " %))})]
|
||||
(fn []
|
||||
(let [blank-label? (string/blank? (:label @state))
|
||||
icon? (boolean (:icon-name @state))
|
||||
button-props {:on-press #(js/alert "Button pressed!")
|
||||
:text "My button"}]
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]]
|
||||
[preview/blur-view
|
||||
{:style {:flex 1
|
||||
:align-items :center
|
||||
:margin-vertical 20}
|
||||
:show-blur-background? (:blur? @state)}
|
||||
[rn/view {:style {:width 300}}
|
||||
[quo/input
|
||||
(cond-> @state
|
||||
:always (assoc
|
||||
:on-clear? #(swap! state assoc :value "")
|
||||
:on-change-text #(swap! state assoc :value %))
|
||||
(:button @state) (assoc :button button-props)
|
||||
blank-label? (dissoc :label)
|
||||
icon? (assoc :icon-name :i/placeholder))]]]]]))))
|
||||
(let [blank-label? (string/blank? (:label @state))]
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/input
|
||||
(cond-> (assoc @state
|
||||
:on-clear? #(swap! state assoc :value "")
|
||||
:on-change-text #(swap! state assoc :value %))
|
||||
(:button @state)
|
||||
(assoc :button
|
||||
{:on-press #(js/alert "Button pressed!")
|
||||
:text "My button"})
|
||||
|
||||
(defn preview-input
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
blank-label?
|
||||
(dissoc :label)
|
||||
|
||||
(:icon-name @state)
|
||||
(assoc :icon-name :i/placeholder))]]))))
|
||||
|
||||
@@ -1,42 +1,24 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.locked-input
|
||||
(:require [quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[quo2.core :as quo]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "show icon"
|
||||
:key :icon
|
||||
:type :boolean}
|
||||
{:label "label"
|
||||
:key :label
|
||||
:type :text}
|
||||
{:label "Value"
|
||||
:key :value
|
||||
:type :text}])
|
||||
[{:key :icon :type :boolean}
|
||||
{:key :label :type :text}
|
||||
{:key :value :type :text}])
|
||||
|
||||
(defn preview-locked-input
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:value "$1,648.34"
|
||||
:label "Network fee"})]
|
||||
(fn []
|
||||
(let [{:keys [label value icon]} @state]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1
|
||||
:flex-direction :column
|
||||
:padding-top 20
|
||||
:padding-left 20}
|
||||
[rn/view {:style {:height 200}}
|
||||
[preview/customizer state descriptor]]
|
||||
[rn/view
|
||||
{:style {:margin-top 11
|
||||
:flex-direction :row}}
|
||||
[quo/locked-input
|
||||
{:icon (when icon :i/gas)
|
||||
:label label
|
||||
:container-style {:margin-right 20
|
||||
:margin-horizontal 20
|
||||
:flex 1}}
|
||||
value]]]))))
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/locked-input
|
||||
{:icon (when icon :i/gas)
|
||||
:label label
|
||||
:container-style {:margin-right 20
|
||||
:margin-horizontal 20
|
||||
:flex 1}}
|
||||
value]]))))
|
||||
|
||||
@@ -1,67 +1,42 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.profile-input
|
||||
(:require [quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "disabled?"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "image selected?"
|
||||
:key :image-selected?
|
||||
:type :boolean}
|
||||
{:label "Custom Color"
|
||||
:key :color
|
||||
:type :select
|
||||
:options (map (fn [color]
|
||||
(let [k (get color :name)]
|
||||
{:key k :value k}))
|
||||
(quo/picker-colors))}])
|
||||
[{:key :disabled?
|
||||
:type :boolean}
|
||||
{:key :image-selected?
|
||||
:type :boolean}
|
||||
(preview/customization-color-option {:key :color})])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:color :blue
|
||||
:image-selected? false
|
||||
:disabled? false})
|
||||
max-length 24
|
||||
|
||||
value (reagent/atom "")
|
||||
on-change-text #(reset! value %)]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view {:flex 1}]
|
||||
[preview/customizer state descriptor]
|
||||
[blur/view
|
||||
{:background-color colors/neutral-80-opa-80
|
||||
:flex-direction :row
|
||||
:margin-horizontal 20
|
||||
:justify-content :center}
|
||||
[quo/profile-input
|
||||
{:default-value ""
|
||||
:on-change-text on-change-text
|
||||
:customization-color (:color @state)
|
||||
:placeholder "Your Name"
|
||||
:on-press #(js/alert "show image selector")
|
||||
:image-picker-props {:profile-picture (when (:image-selected? @state)
|
||||
(resources/get-mock-image :user-picture-male5))
|
||||
:full-name @value}
|
||||
:title-input-props {:disabled? (:disabled? @state)
|
||||
:max-length max-length
|
||||
:on-change-text on-change-text}}]]]])))
|
||||
|
||||
(defn preview-profile-input
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white
|
||||
colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[blur/view
|
||||
{:background-color colors/neutral-80-opa-80
|
||||
:flex-direction :row
|
||||
:margin-horizontal 20
|
||||
:justify-content :center}
|
||||
[quo/profile-input
|
||||
{:default-value ""
|
||||
:on-change-text on-change-text
|
||||
:customization-color (:color @state)
|
||||
:placeholder "Your Name"
|
||||
:on-press #(js/alert "show image selector")
|
||||
:image-picker-props {:profile-picture (when (:image-selected? @state)
|
||||
(resources/get-mock-image :user-picture-male5))
|
||||
:full-name @value}
|
||||
:title-input-props {:disabled? (:disabled? @state)
|
||||
:max-length max-length
|
||||
:on-change-text on-change-text}}]]])))
|
||||
|
||||
@@ -1,76 +1,48 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.recovery-phrase-input
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Text"
|
||||
:key :text
|
||||
:type :text}
|
||||
{:label "Placeholder"
|
||||
:key :placeholder
|
||||
:type :text}
|
||||
{:label "Blur"
|
||||
:key :blur?
|
||||
:type :boolean}
|
||||
{:label "Mark errors"
|
||||
:key :mark-errors?
|
||||
:type :boolean}
|
||||
{:label "Customization color"
|
||||
:key :customization-color
|
||||
:type :select
|
||||
:options (map (fn [[color _]]
|
||||
{:key color :value (name color)})
|
||||
colors/customization)}
|
||||
{:label "Word limit"
|
||||
:key :word-limit
|
||||
[{:key :text
|
||||
:type :text}
|
||||
{:key :placeholder
|
||||
:type :text}
|
||||
{:key :blur?
|
||||
:type :boolean}
|
||||
{:key :mark-errors?
|
||||
:type :boolean}
|
||||
(preview/customization-color-option)
|
||||
{:key :word-limit
|
||||
:type :select
|
||||
:options [{:key nil :value "No limit"}
|
||||
{:key 5 :value "5 words"}
|
||||
{:key 10 :value "10 words"}
|
||||
{:key 20 :value "20 words"}]}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:text ""
|
||||
:placeholder "Type or paste your recovery phrase"
|
||||
:customization-color :blue
|
||||
:word-limit 20
|
||||
:blur? false
|
||||
:mark-errors? true})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]
|
||||
[quo/text {:size :paragraph-2}
|
||||
"(Any word with at least 6 chars is marked as error)"]]
|
||||
[preview/blur-view
|
||||
{:style {:align-items :center
|
||||
:margin-vertical 20
|
||||
:width "100%"}
|
||||
:height 200
|
||||
:show-blur-background? (:blur? @state)}
|
||||
[rn/view
|
||||
{:style {:height 150
|
||||
:width "100%"}}
|
||||
[quo/recovery-phrase-input
|
||||
{:mark-errors? (:mark-errors? @state)
|
||||
:error-pred #(> (count %) 5)
|
||||
:on-change-text #(swap! state assoc :text %)
|
||||
:placeholder (:placeholder @state)
|
||||
:customization-color (:customization-color @state)
|
||||
:word-limit (:word-limit @state)}
|
||||
(:text @state)]]]]])))
|
||||
|
||||
(defn preview-recovery-phrase-input
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboardShouldPersistTaps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/text {:size :paragraph-2}
|
||||
"(Any word with at least 6 chars is marked as error)"]
|
||||
[rn/view {:style {:height 150}}
|
||||
[quo/recovery-phrase-input
|
||||
{:mark-errors? (:mark-errors? @state)
|
||||
:error-pred #(> (count %) 5)
|
||||
:on-change-text #(swap! state assoc :text %)
|
||||
:placeholder (:placeholder @state)
|
||||
:customization-color (:customization-color @state)
|
||||
:word-limit (:word-limit @state)}
|
||||
(:text @state)]]])))
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.search-input
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Value"
|
||||
:key :value
|
||||
:type :text}
|
||||
{:label "Blur"
|
||||
:key :blur?
|
||||
:type :boolean}
|
||||
{:label "Disabled"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "Number of Tags"
|
||||
:key :number-tags
|
||||
[{:key :value
|
||||
:type :text}
|
||||
{:key :blur?
|
||||
:type :boolean}
|
||||
{:key :disabled?
|
||||
:type :boolean}
|
||||
{:key :number-tags
|
||||
:type :select
|
||||
:options (map (fn [n]
|
||||
{:key n :value (str n)})
|
||||
@@ -35,40 +29,24 @@
|
||||
(resources/get-mock-image :user-picture-female2)
|
||||
"Freya Odinson"]])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:blur? false
|
||||
:disabled? false
|
||||
:number-tags 0
|
||||
:placeholder "Search..."
|
||||
:value ""
|
||||
:on-clear #(js/alert "Clear pressed")})
|
||||
:value ""})
|
||||
on-change-text (fn [new-text]
|
||||
(swap! state assoc :value new-text))]
|
||||
(fn []
|
||||
(let [tags (take (:number-tags @state) (example-tags (:blur? @state)))]
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style {:padding-bottom 150}}
|
||||
[rn/view {:style {:flex 1}}
|
||||
[preview/customizer state descriptor]]
|
||||
[preview/blur-view
|
||||
{:style {:align-items :center
|
||||
:margin-vertical 20
|
||||
:width "100%"}
|
||||
:show-blur-background? (:blur? @state)}
|
||||
[rn/view {:style {:width "100%"}}
|
||||
[quo/search-input
|
||||
(assoc @state
|
||||
:tags tags
|
||||
:on-change-text on-change-text)]]]]]))))
|
||||
|
||||
(defn preview-search-input
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboardShouldPersistTaps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/search-input
|
||||
(assoc @state
|
||||
:on-clear #(swap! state assoc :value "")
|
||||
:tags tags
|
||||
:on-change-text on-change-text)]]))))
|
||||
|
||||
@@ -1,57 +1,30 @@
|
||||
(ns status-im2.contexts.quo-preview.inputs.title-input
|
||||
(:require [quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "disabled?"
|
||||
:key :disabled?
|
||||
:type :boolean}
|
||||
{:label "blur?"
|
||||
:key :blur?
|
||||
:type :boolean}
|
||||
{:label "Cursor Color"
|
||||
:key :color
|
||||
:type :select
|
||||
:options (map (fn [{:keys [name]}] {:key name :value name}) (quo/picker-colors))}])
|
||||
[{:key :disabled?
|
||||
:type :boolean}
|
||||
{:key :placeholder
|
||||
:type :text}
|
||||
{:key :max-length
|
||||
:type :number}
|
||||
{:key :blur?
|
||||
:type :boolean}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:color nil
|
||||
:blur? false
|
||||
:disabled? false})
|
||||
max-length 24
|
||||
on-change-text (fn [_v]
|
||||
(println (str "cool-preview -> on-change-text called " _v)))]
|
||||
(let [state (reagent/atom {:color nil
|
||||
:placeholder "Type something here"
|
||||
:max-length 24
|
||||
:blur? false
|
||||
:disabled? false})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[rn/view {:flex 1}]
|
||||
[preview/customizer state descriptor]
|
||||
|
||||
[preview/blur-view
|
||||
{:show-blur-background? (:blur? @state)
|
||||
:style {:flex-direction :row
|
||||
:justify-content :center}}
|
||||
[quo/title-input
|
||||
{:max-length max-length
|
||||
:default-value ""
|
||||
:on-change-text on-change-text
|
||||
:disabled? (:disabled? @state)
|
||||
:customization-color (:color @state)
|
||||
:blur? (:blur? @state)
|
||||
:placeholder "type something here"}]]]])))
|
||||
|
||||
(defn preview-title-input
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white
|
||||
colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:blur? (:blur? @state)
|
||||
:show-blur-background? true}
|
||||
[quo/title-input (assoc @state :default-value "")]])))
|
||||
|
||||
@@ -1,37 +1,17 @@
|
||||
(ns status-im2.contexts.quo-preview.keycard.keycard
|
||||
(:require [status-im2.contexts.quo-preview.preview :as preview]
|
||||
[react-native.core :as rn]
|
||||
[quo2.foundations.colors :as colors]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[quo2.core :as quo]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Holder"
|
||||
:key :holder-name
|
||||
:type :text}
|
||||
{:label "Locked?"
|
||||
:key :locked?
|
||||
:type :boolean}])
|
||||
[{:key :holder-name :type :text}
|
||||
{:key :locked? :type :boolean}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:holder-name nil
|
||||
(let [state (reagent/atom {:holder-name ""
|
||||
:locked? true})]
|
||||
(fn
|
||||
[]
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view [preview/customizer state descriptor]
|
||||
[quo/keycard
|
||||
{:holder-name? (:holder-name @state)
|
||||
:locked? (:locked? @state)}]]])))
|
||||
|
||||
(defn preview-keycard
|
||||
[]
|
||||
[rn/view
|
||||
{:style {:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||
:flex 1}}
|
||||
[rn/flat-list
|
||||
{:style {:flex 1}
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/keycard @state]])))
|
||||
|
||||
@@ -1,27 +1,19 @@
|
||||
(ns status-im2.contexts.quo-preview.list-items.account-list-card
|
||||
(:require
|
||||
[quo2.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "State:"
|
||||
:key :state
|
||||
[{:key :state
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :pressed
|
||||
:value "Pressed"}]}
|
||||
{:label "Action:"
|
||||
:key :action
|
||||
:options [{:key :default}
|
||||
{:key :pressed}]}
|
||||
{:key :action
|
||||
:type :select
|
||||
:options [{:key :none
|
||||
:value "None"}
|
||||
{:key :icon
|
||||
:value "Icon"}]}])
|
||||
:options [{:key :none}
|
||||
{:key :icon}]}])
|
||||
|
||||
(defn preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:account-props {:customization-color :purple
|
||||
:size 32
|
||||
@@ -34,9 +26,5 @@
|
||||
:action :none
|
||||
:on-press (fn [] (js/alert "Button pressed"))})]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view
|
||||
{:style {:flex 1
|
||||
:padding-horizontal 20}}
|
||||
[rn/view {:style {:min-height 150}} [preview/customizer state descriptor]]
|
||||
[quo/account-list-card @state]]])))
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/account-list-card @state]])))
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
(ns status-im2.contexts.quo-preview.list-items.channel
|
||||
(:require [quo2.components.list-items.channel :as quo2-channel]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Muted?:"
|
||||
:key :muted?
|
||||
:type :boolean}
|
||||
{:label "Name"
|
||||
:key :name
|
||||
:type :text}
|
||||
{:label "Number of mentions"
|
||||
:key :mentions-count
|
||||
:type :text}
|
||||
{:label "Unread Messages:"
|
||||
:key :unread-messages?
|
||||
:type :boolean}
|
||||
{:label "Avatar emoji"
|
||||
:key :emoji
|
||||
:type :text}
|
||||
{:label "is Locked?"
|
||||
:key :locked?
|
||||
[{:key :muted?
|
||||
:type :boolean}
|
||||
{:key :name
|
||||
:type :text}
|
||||
{:key :mentions-count
|
||||
:type :text}
|
||||
{:key :unread-messages?
|
||||
:type :boolean}
|
||||
{:key :emoji
|
||||
:type :text}
|
||||
{:key :locked?
|
||||
:type :select
|
||||
:options [{:key nil
|
||||
:value "None"}
|
||||
@@ -30,11 +22,9 @@
|
||||
:value "Unlocked"}
|
||||
{:key true
|
||||
:value "Locked"}]}
|
||||
{:label "Is Pressed Channel:"
|
||||
:key :is-active-channel?
|
||||
:type :boolean}
|
||||
{:label "Channel color"
|
||||
:key :channel-color
|
||||
{:key :is-active-channel?
|
||||
:type :boolean}
|
||||
{:key :channel-color
|
||||
:type :select
|
||||
:options [{:key "#00FFFF"
|
||||
:value "Blue"}
|
||||
@@ -43,7 +33,7 @@
|
||||
{:key "#FFFF00"
|
||||
:value "Yellow"}]}])
|
||||
|
||||
(defn cool-preview
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:is-active-channel? false
|
||||
:muted? false
|
||||
@@ -54,27 +44,5 @@
|
||||
:name "channel"
|
||||
:locked? true})]
|
||||
(fn []
|
||||
[rn/view
|
||||
{:margin-bottom 50
|
||||
:padding-bottom 16
|
||||
:padding-right 8
|
||||
:padding-left 8
|
||||
|
||||
:padding-top 16}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo2-channel/list-item @state]]])))
|
||||
|
||||
(defn preview-channel
|
||||
[]
|
||||
[rn/keyboard-avoiding-view {:style {:flex 1}}
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/channel-list-item @state]])))
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
(ns status-im2.contexts.quo-preview.list-items.dapp
|
||||
(:require [quo2.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:key :state
|
||||
:type :select
|
||||
:options [{:key :default
|
||||
:value "Default"}
|
||||
{:key :active
|
||||
:value "Active"}]}
|
||||
{:key :action
|
||||
:type :select
|
||||
:options [{:key :none
|
||||
:value "None"}
|
||||
{:key :icon
|
||||
:value "Icon"}]}
|
||||
{:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn preview
|
||||
[]
|
||||
(let [state (reagent/atom {:dapp {:avatar (resources/get-mock-image :coin-gecko)
|
||||
:name "Coingecko"
|
||||
:value "coingecko.com"}
|
||||
:state :default
|
||||
:action :icon
|
||||
:blur? false
|
||||
:customization-color :blue
|
||||
:on-press-icon (fn [] (js/alert "Button pressed"))})]
|
||||
(fn []
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:flex-direction :row
|
||||
:justify-content :center}
|
||||
[quo/dapp @state]]])))
|
||||
@@ -1,15 +1,12 @@
|
||||
(ns status-im2.contexts.quo-preview.list-items.preview-lists
|
||||
(:require [quo2.components.list-items.preview-list :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
(:require [quo2.core :as quo]
|
||||
[quo2.foundations.resources :as quo.resources]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.common.resources :as resources]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Size:"
|
||||
:key :size
|
||||
[{:key :size
|
||||
:type :select
|
||||
:options [{:key 32
|
||||
:value "32"}
|
||||
@@ -17,19 +14,15 @@
|
||||
:value "24"}
|
||||
{:key 16
|
||||
:value "16"}]}
|
||||
{:label "Type:"
|
||||
:key :type
|
||||
{:key :type
|
||||
:type :select
|
||||
:options [{:key :user
|
||||
:value "User"}
|
||||
{:key :photo
|
||||
:value "Photo"}]}
|
||||
{:label "List Size"
|
||||
:key :list-size
|
||||
:options [{:key :user}
|
||||
{:key :photo}
|
||||
{:key :network}]}
|
||||
{:key :list-size
|
||||
:default 10
|
||||
:type :text}])
|
||||
|
||||
;; Mocked list items
|
||||
(def user-list
|
||||
[{:full-name "ABC DEF"}
|
||||
{:full-name "GHI JKL"}
|
||||
@@ -44,32 +37,22 @@
|
||||
{:source (resources/get-mock-image :photo2)}
|
||||
{:source (resources/get-mock-image :photo3)}])
|
||||
|
||||
(defn cool-preview
|
||||
(def networks-list
|
||||
[{:source (quo.resources/get-network :ethereum)}
|
||||
{:source (quo.resources/get-network :optimism)}
|
||||
{:source (quo.resources/get-network :arbitrum)}])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:type :user
|
||||
:size 32
|
||||
:list-size 10
|
||||
:more-than-99-label (i18n/label :counter-99-plus)})
|
||||
:more-than-99-label "99+"})
|
||||
type (reagent/cursor state [:type])]
|
||||
(fn []
|
||||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:padding-bottom 150}
|
||||
[preview/customizer state descriptor]
|
||||
[rn/view
|
||||
{:padding-vertical 60
|
||||
:align-items :center}
|
||||
[quo2/preview-list @state
|
||||
(case @type
|
||||
:user user-list
|
||||
:photo photos-list)]]]])))
|
||||
|
||||
(defn preview-preview-lists
|
||||
[]
|
||||
[rn/view
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-90)
|
||||
:flex 1}
|
||||
[rn/flat-list
|
||||
{:flex 1
|
||||
:keyboard-should-persist-taps :always
|
||||
:header [cool-preview]
|
||||
:key-fn str}]])
|
||||
[preview/preview-container {:state state :descriptor descriptor}
|
||||
[quo/preview-list @state
|
||||
(case @type
|
||||
:user user-list
|
||||
:photo photos-list
|
||||
:network networks-list)]])))
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
[status-im2.contexts.quo-preview.drawers.drawer-buttons :as drawer-buttons]
|
||||
[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]
|
||||
[status-im2.contexts.quo-preview.foundations.shadows :as shadows]
|
||||
[status-im2.contexts.quo-preview.info.info-message :as info-message]
|
||||
[status-im2.contexts.quo-preview.info.information-box :as information-box]
|
||||
@@ -61,6 +62,7 @@
|
||||
[status-im2.contexts.quo-preview.links.link-preview :as link-preview]
|
||||
[status-im2.contexts.quo-preview.list-items.account-list-card :as account-list-card]
|
||||
[status-im2.contexts.quo-preview.list-items.channel :as channel]
|
||||
[status-im2.contexts.quo-preview.list-items.dapp :as dapp]
|
||||
[status-im2.contexts.quo-preview.list-items.preview-lists :as preview-lists]
|
||||
[status-im2.contexts.quo-preview.list-items.user-list :as user-list]
|
||||
[status-im2.contexts.quo-preview.list-items.community-list :as community-list]
|
||||
@@ -110,8 +112,8 @@
|
||||
[status-im2.contexts.quo-preview.loaders.skeleton :as skeleton]
|
||||
[status-im2.contexts.quo-preview.community.channel-actions :as channel-actions]
|
||||
[status-im2.contexts.quo-preview.gradient.gradient-cover :as gradient-cover]
|
||||
[status-im2.contexts.quo-preview.wallet.account-overview :as account-overview]
|
||||
[status-im2.contexts.quo-preview.wallet.account-card :as account-card]
|
||||
[status-im2.contexts.quo-preview.wallet.account-overview :as account-overview]
|
||||
[status-im2.contexts.quo-preview.wallet.keypair :as keypair]
|
||||
[status-im2.contexts.quo-preview.wallet.network-amount :as network-amount]
|
||||
[status-im2.contexts.quo-preview.wallet.network-bridge :as network-bridge]
|
||||
@@ -124,105 +126,107 @@
|
||||
|
||||
(def screens-categories
|
||||
{:foundations [{:name :shadows
|
||||
:component shadows/preview-shadows}]
|
||||
:component shadows/view}]
|
||||
:animated-list [{:name :animated-header-list
|
||||
:component animated-header-list/mock-screen}]
|
||||
:avatar [{:name :group-avatar
|
||||
:component group-avatar/preview-group-avatar}
|
||||
:component group-avatar/view}
|
||||
{:name :icon-avatar
|
||||
:component icon-avatar/preview-icon-avatar}
|
||||
:component icon-avatar/view}
|
||||
{:name :user-avatar
|
||||
:component user-avatar/preview-user-avatar}
|
||||
:component user-avatar/view}
|
||||
{:name :wallet-user-avatar
|
||||
:component wallet-user-avatar/preview-wallet-user-avatar}
|
||||
:component wallet-user-avatar/view}
|
||||
{:name :channel-avatar
|
||||
:component channel-avatar/preview-channel-avatar}
|
||||
:component channel-avatar/view}
|
||||
{:name :account-avatar
|
||||
:component account-avatar/preview-account-avatar}]
|
||||
:component account-avatar/view}]
|
||||
:banner [{:name :banner
|
||||
:component banner/preview-banner}]
|
||||
:component banner/view}]
|
||||
:buttons [{:name :button
|
||||
:component button/preview-button}
|
||||
:component button/view}
|
||||
{:name :composer-button
|
||||
:component composer-button/preview-composer-button}
|
||||
:component composer-button/view}
|
||||
{:name :dynamic-button
|
||||
:component dynamic-button/preview-dynamic-button}
|
||||
:component dynamic-button/view}
|
||||
{:name :slide-button
|
||||
:component slide-button/preview-slide-button}
|
||||
:component slide-button/view}
|
||||
{:name :predictive-keyboard
|
||||
:component predictive-keyboard/preview-predictive-keyboard}
|
||||
:component predictive-keyboard/view}
|
||||
{:name :wallet-button
|
||||
:component wallet-button/preview}
|
||||
:component wallet-button/view}
|
||||
{:name :wallet-ctas
|
||||
:component wallet-ctas/preview}]
|
||||
:component wallet-ctas/view}]
|
||||
:browser [{:name :browser-input
|
||||
:component browser-input/preview-browser-input}]
|
||||
:calendar [{:name :calendar
|
||||
:component calendar/preview-calendar}
|
||||
:component calendar/view}
|
||||
{:name :calendar-day
|
||||
:component calendar-day/preview-calendar-day}
|
||||
:component calendar-day/view}
|
||||
{:name :calendar-year
|
||||
:component calendar-year/preview-calendar-year}]
|
||||
:component calendar-year/view}]
|
||||
:code [{:name :snippet
|
||||
:component code-snippet/preview-code-snippet}]
|
||||
:component code-snippet/view}]
|
||||
:colors [{:name :color-picker
|
||||
:component color-picker/view}]
|
||||
:community [{:name :community-card-view
|
||||
:component community-card/preview-community-card}
|
||||
:component community-card/view}
|
||||
{:name :community-membership-list-view
|
||||
:component community-membership-list-view/preview-community-list-view}
|
||||
:component community-membership-list-view/view}
|
||||
{:name :discover-card
|
||||
:component discover-card/preview-discoverd-card}
|
||||
:component discover-card/view}
|
||||
{:name :token-gating
|
||||
:options {:insets {:bottom? true}}
|
||||
:component token-gating/preview-token-gating}
|
||||
:component token-gating/view}
|
||||
{:name :channel-actions
|
||||
:options {:insets {:bottom? true}}
|
||||
:component channel-actions/preview-channel-actions}]
|
||||
:component channel-actions/view}]
|
||||
:counter [{:name :counter
|
||||
:component counter/preview-counter}
|
||||
:component counter/view}
|
||||
{:name :step
|
||||
:component step/preview-step}]
|
||||
:component step/view}]
|
||||
:dividers [{:name :divider-label
|
||||
:component divider-label/view}
|
||||
{:name :new-messages
|
||||
:component new-messages/preview-new-messages}
|
||||
:component new-messages/view}
|
||||
{:name :divider-date
|
||||
:component divider-date/preview-divider-date}
|
||||
:component divider-date/view}
|
||||
{:name :strength-divider
|
||||
:component strength-divider/preview-strength-divider}]
|
||||
:component strength-divider/view}]
|
||||
:drawers [{:name :action-drawers
|
||||
:component action-drawers/preview-action-drawers}
|
||||
:component action-drawers/view}
|
||||
{:name :documentation-drawer
|
||||
:component documenation-drawers/preview-documenation-drawers}
|
||||
:component documenation-drawers/view}
|
||||
{:name :drawer-buttons
|
||||
:component drawer-buttons/preview-drawer-buttons}
|
||||
:component drawer-buttons/view}
|
||||
{:name :permission-drawers
|
||||
:component permission-drawers/preview-permission-drawers}]
|
||||
:component permission-drawers/view}]
|
||||
:dropdowns [{:name :dropdown
|
||||
:component dropdown/preview-dropdown}]
|
||||
:component dropdown/view}
|
||||
{:name :network-dropdown
|
||||
:component network-dropdown/view}]
|
||||
:empty-state [{:name :empty-state
|
||||
:component empty-state/preview-empty-state}]
|
||||
:component empty-state/view}]
|
||||
:gradient [{:name :gradient-cover
|
||||
:component gradient-cover/preview-gradient-cover}]
|
||||
:component gradient-cover/view}]
|
||||
:graph [{:name :wallet-graph
|
||||
:component wallet-graph/preview-wallet-graph}]
|
||||
:component wallet-graph/view}]
|
||||
:info [{:name :info-message
|
||||
:component info-message/preview-info-message}
|
||||
:component info-message/view}
|
||||
{:name :information-box
|
||||
:component information-box/preview-information-box}]
|
||||
:component information-box/view}]
|
||||
:inputs [{:name :input
|
||||
:component input/preview-input}
|
||||
:component input/view}
|
||||
{:name :locked-input
|
||||
:component locked-input/preview-locked-input}
|
||||
:component locked-input/view}
|
||||
{:name :profile-input
|
||||
:component profile-input/preview-profile-input}
|
||||
:component profile-input/view}
|
||||
{:name :recovery-phrase-input
|
||||
:component recovery-phrase-input/preview-recovery-phrase-input}
|
||||
:component recovery-phrase-input/view}
|
||||
{:name :search-input
|
||||
:component search-input/preview-search-input}
|
||||
:component search-input/view}
|
||||
{:name :title-input
|
||||
:component title-input/preview-title-input}]
|
||||
:component title-input/view}]
|
||||
:numbered-keyboard [{:name :keyboard-key
|
||||
:options {:insets {:top? true}}
|
||||
:component keyboard-key/preview-keyboard-key}
|
||||
@@ -239,14 +243,16 @@
|
||||
:options {:insets {:top? true}}
|
||||
:component link-preview/view}]
|
||||
:list-items [{:name :account-list-card
|
||||
:component account-list-card/preview}
|
||||
:component account-list-card/view}
|
||||
{:name :channel
|
||||
:component channel/preview-channel}
|
||||
:component channel/view}
|
||||
{:name :community-list
|
||||
:options {:insets {:top? true}}
|
||||
:component community-list/view}
|
||||
{:name :dapp
|
||||
:component dapp/preview}
|
||||
{:name :preview-lists
|
||||
:component preview-lists/preview-preview-lists}
|
||||
:component preview-lists/view}
|
||||
{:name :user-list
|
||||
:component user-list/preview-user-list}
|
||||
{:name :token-value
|
||||
@@ -357,7 +363,7 @@
|
||||
{:name :wallet-overview
|
||||
:component wallet-overview/preview-wallet-overview}]
|
||||
:keycard [{:name :keycard-component
|
||||
:component keycard/preview-keycard}]})
|
||||
:component keycard/view}]})
|
||||
|
||||
(defn- navigation-bar
|
||||
[]
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]
|
||||
[utils.address :as address]))
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:label "Primary name"
|
||||
@@ -36,8 +35,6 @@
|
||||
[]
|
||||
(let [state (reagent/atom {:primary-name "Alisher Yakupov"
|
||||
:seconadary-name ""
|
||||
:short-chat-key (address/get-shortened-compressed-key
|
||||
"zQ3ssgRy5TtB47MMiMKMKaGyaawkCgMqqbrnAUYrZJ1sgt5N")
|
||||
:time-str "09:30"
|
||||
:contact? false
|
||||
:verified? false
|
||||
|
||||
@@ -139,15 +139,15 @@
|
||||
"Close"]]]]]])
|
||||
|
||||
(defn- customizer-select-button
|
||||
[{:keys [open selected-key]}]
|
||||
[{:keys [open selected-option]}]
|
||||
[rn/pressable
|
||||
{:style (style/select-container)
|
||||
:on-press #(reset! open true)}
|
||||
[rn/text
|
||||
{:style (style/field-select)
|
||||
:number-of-lines 1}
|
||||
(if selected-key
|
||||
(humanize selected-key)
|
||||
(if selected-option
|
||||
(or (:value selected-option) (humanize (:key selected-option)))
|
||||
"Select option")]
|
||||
[rn/view
|
||||
[quo/icon :i/chevron-right]]])
|
||||
@@ -156,9 +156,9 @@
|
||||
[]
|
||||
(let [open (reagent/atom nil)]
|
||||
(fn [{:keys [label state options] :as args}]
|
||||
(let [label (or label (key->text-label (:key args)))
|
||||
field-value (reagent/cursor state [(:key args)])
|
||||
selected-key (:key (find-selected-option @field-value options))]
|
||||
(let [label (or label (key->text-label (:key args)))
|
||||
field-value (reagent/cursor state [(:key args)])
|
||||
selected-option (find-selected-option @field-value options)]
|
||||
[rn/view {:style style/field-row}
|
||||
[label-view state label]
|
||||
[rn/view {:style style/field-column}
|
||||
@@ -166,7 +166,7 @@
|
||||
{:open open
|
||||
:options options
|
||||
:field-value field-value}]
|
||||
[customizer-select-button {:open open :selected-key selected-key}]]]))))
|
||||
[customizer-select-button {:open open :selected-option selected-option}]]]))))
|
||||
|
||||
(defn customizer
|
||||
[state descriptors]
|
||||
@@ -189,8 +189,7 @@
|
||||
([]
|
||||
(customization-color-option {}))
|
||||
([opts]
|
||||
(merge {:label "Custom color:"
|
||||
:key :customization-color
|
||||
(merge {:key :customization-color
|
||||
:type :select
|
||||
:options (->> colors/customization
|
||||
keys
|
||||
@@ -200,7 +199,7 @@
|
||||
opts)))
|
||||
|
||||
(defn blur-view
|
||||
[{:keys [show-blur-background? image height blur-view-props style]} children]
|
||||
[{:keys [show-blur-background? image height blur-view-props style]} & children]
|
||||
[rn/view
|
||||
{:style {:flex 1
|
||||
:padding-vertical 16}}
|
||||
@@ -221,39 +220,39 @@
|
||||
:blur-amount 10
|
||||
:overlay-color (colors/theme-colors colors/white-opa-70 colors/neutral-80-opa-80)}
|
||||
blur-view-props)]])
|
||||
[rn/view
|
||||
{:style (merge {:position :absolute
|
||||
:top 32
|
||||
:padding-horizontal 16}
|
||||
style)}
|
||||
children]])
|
||||
(into [rn/view
|
||||
{:style (merge {:position :absolute
|
||||
:top 32
|
||||
:padding-horizontal 16}
|
||||
style)}]
|
||||
children)])
|
||||
|
||||
(defn preview-container
|
||||
[{:keys [state descriptor blur?
|
||||
component-container-style
|
||||
blur-container-style blur-view-props blur-height show-blur-background?]
|
||||
:or {blur-height 200}}
|
||||
component]
|
||||
& children]
|
||||
[rn/scroll-view
|
||||
{:style (style/panel-basic)
|
||||
:shows-vertical-scroll-indicator false}
|
||||
[rn/pressable {:on-press rn/dismiss-keyboard!}
|
||||
[rn/view {:style style/customizer-container}
|
||||
[customizer state descriptor]]
|
||||
[rn/view
|
||||
(merge {:style style/component-container}
|
||||
component-container-style)
|
||||
(if blur?
|
||||
[blur-view
|
||||
{:show-blur-background? show-blur-background?
|
||||
:height blur-height
|
||||
:style (merge {:width "100%"
|
||||
:flex-grow 1}
|
||||
(when-not show-blur-background?
|
||||
{:padding-horizontal 0
|
||||
:top 0})
|
||||
blur-container-style)
|
||||
:blur-view-props (merge {:blur-type (quo.theme/get-theme)}
|
||||
blur-view-props)}
|
||||
component]
|
||||
component)]]])
|
||||
(when descriptor
|
||||
[rn/view {:style style/customizer-container}
|
||||
[customizer state descriptor]])
|
||||
(if blur?
|
||||
[rn/view {:style (merge style/component-container component-container-style)}
|
||||
(into [blur-view
|
||||
{:show-blur-background? show-blur-background?
|
||||
:height blur-height
|
||||
:style (merge {:width "100%"
|
||||
:flex-grow 1}
|
||||
(when-not show-blur-background?
|
||||
{:padding-horizontal 0
|
||||
:top 0})
|
||||
blur-container-style)
|
||||
:blur-view-props (merge {:blur-type (quo.theme/get-theme)}
|
||||
blur-view-props)}]
|
||||
children)]
|
||||
(into [rn/view {:style (merge style/component-container component-container-style)}]
|
||||
children))]])
|
||||
|
||||
@@ -101,8 +101,7 @@
|
||||
[rn/view {:style style/notification-container}
|
||||
(if (= notification-indicator :counter)
|
||||
[quo/counter
|
||||
{:outline false
|
||||
:customization-color customization-color}
|
||||
{:customization-color customization-color}
|
||||
counter-label]
|
||||
[rn/view {:style (style/unread-dot customization-color)}])])
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user