Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5715248bfe | ||
|
|
821e39a562 | ||
|
|
4cef868eab | ||
|
|
34f7a48503 |
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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))
|
||||
@@ -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?}
|
||||
|
||||
@@ -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
|
||||
@@ -193,6 +194,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)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
[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]
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -243,15 +243,19 @@
|
||||
(rf/merge
|
||||
cofx
|
||||
{:json-rpc/call [{:method "wakuext_editMessage"
|
||||
:params [{:id message-id
|
||||
:text text
|
||||
:content-type (if (message-content/emoji-only-content?
|
||||
{:text text :response-to quoted-message})
|
||||
constants/content-type-emoji
|
||||
constants/content-type-text)}]
|
||||
:params [{:id message-id
|
||||
:text text
|
||||
:content-type (if (message-content/emoji-only-content?
|
||||
{:text text
|
||||
:response-to quoted-message})
|
||||
constants/content-type-emoji
|
||||
constants/content-type-text)
|
||||
:link-previews (map #(select-keys % [:url :title :description :thumbnail])
|
||||
(get-in db [:chat/link-previews :unfurled]))}]
|
||||
:js-response true
|
||||
:on-error #(log/error "failed to edit message " %)
|
||||
:on-success (fn [result]
|
||||
(prn result "awpdkoawpodkawd")
|
||||
(re-frame/dispatch [:sanitize-messages-and-process-response
|
||||
result]))}]}
|
||||
(link-preview/reset-unfurled)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
(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
|
||||
:value "Default"}
|
||||
{:key :disabled
|
||||
:value "Disabled"}]}
|
||||
{:key :blur?
|
||||
:type :select
|
||||
:options [{:key true
|
||||
:value "True"}
|
||||
{:key false
|
||||
:value "False"}]}
|
||||
{:key :amount
|
||||
:type :select
|
||||
:options [{:key 1
|
||||
:value 1}
|
||||
{:key 2
|
||||
:value 2}
|
||||
{:key 3
|
||||
:value 3}]}])
|
||||
|
||||
(def ^:private networks-list
|
||||
[{:source (quo.resources/get-network :ethereum)}
|
||||
{:source (quo.resources/get-network :optimism)}
|
||||
{:source (quo.resources/get-network :arbitrum)}])
|
||||
|
||||
(defn preview-dropdown
|
||||
[]
|
||||
(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,6 +1,7 @@
|
||||
(ns status-im2.contexts.quo-preview.list-items.preview-lists
|
||||
(:require [quo2.components.list-items.preview-list :as quo2]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[quo2.foundations.resources :as quo.resources]
|
||||
[react-native.core :as rn]
|
||||
[reagent.core :as reagent]
|
||||
[utils.i18n :as i18n]
|
||||
@@ -23,7 +24,9 @@
|
||||
:options [{:key :user
|
||||
:value "User"}
|
||||
{:key :photo
|
||||
:value "Photo"}]}
|
||||
:value "Photo"}
|
||||
{:key :network
|
||||
:value "Network"}]}
|
||||
{:label "List Size"
|
||||
:key :list-size
|
||||
:default 10
|
||||
@@ -44,6 +47,11 @@
|
||||
{:source (resources/get-mock-image :photo2)}
|
||||
{:source (resources/get-mock-image :photo3)}])
|
||||
|
||||
(def networks-list
|
||||
[{:source (quo.resources/get-network :ethereum)}
|
||||
{:source (quo.resources/get-network :optimism)}
|
||||
{:source (quo.resources/get-network :arbitrum)}])
|
||||
|
||||
(defn cool-preview
|
||||
[]
|
||||
(let [state (reagent/atom {:type :user
|
||||
@@ -60,8 +68,9 @@
|
||||
:align-items :center}
|
||||
[quo2/preview-list @state
|
||||
(case @type
|
||||
:user user-list
|
||||
:photo photos-list)]]]])))
|
||||
:user user-list
|
||||
:photo photos-list
|
||||
:network networks-list)]]]])))
|
||||
|
||||
(defn preview-preview-lists
|
||||
[]
|
||||
|
||||
@@ -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]
|
||||
@@ -200,7 +201,9 @@
|
||||
{:name :permission-drawers
|
||||
:component permission-drawers/preview-permission-drawers}]
|
||||
:dropdowns [{:name :dropdown
|
||||
:component dropdown/preview-dropdown}]
|
||||
:component dropdown/preview-dropdown}
|
||||
{:name :network-dropdown
|
||||
:component network-dropdown/preview-dropdown}]
|
||||
:empty-state [{:name :empty-state
|
||||
:component empty-state/preview-empty-state}]
|
||||
:gradient [{:name :gradient-cover
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
:justify-content :center
|
||||
:padding-bottom 20})
|
||||
|
||||
(def box { :background-color :red
|
||||
:height 100
|
||||
:width 100})
|
||||
|
||||
(def empty-title
|
||||
{:padding-bottom 2
|
||||
:color colors/white})
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
(ns status-im2.contexts.shell.activity-center.tabs.empty-tab.view
|
||||
(:require
|
||||
[react-native.blur :as blur]
|
||||
[utils.re-frame :as rf]
|
||||
[react-native.core :as rn]
|
||||
[quo2.core :as quo]
|
||||
[status-im2.contexts.shell.activity-center.style :as style]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.contexts.shell.activity-center.notification-types :as types]
|
||||
[status-im2.common.resources :as resources]))
|
||||
(:require [utils.re-frame :as rf]
|
||||
[react-native.core :as rn]
|
||||
[quo2.core :as quo]
|
||||
[status-im2.contexts.shell.activity-center.style :as style]
|
||||
[utils.i18n :as i18n]
|
||||
[status-im2.contexts.shell.activity-center.notification-types :as types]
|
||||
[status-im2.common.resources :as resources]))
|
||||
|
||||
(def empty-tab-description
|
||||
{types/no-type (i18n/label :t/empty-notifications-all-tab)
|
||||
@@ -25,11 +23,8 @@
|
||||
(let [filter-type (rf/sub [:activity-center/filter-type])
|
||||
description (get empty-tab-description filter-type nil)]
|
||||
[rn/view {:style style/empty-container}
|
||||
[blur/view {:overlayColor :transparent} [rn/view {:style style/box}]]
|
||||
;[quo/empty-state
|
||||
; {:blur? true
|
||||
; :placeholder? true
|
||||
; :image (resources/get-image :no-notifications-dark)
|
||||
; :title (i18n/label :t/empty-notifications-title-unread)
|
||||
; :description description}]
|
||||
]))
|
||||
[quo/empty-state
|
||||
{:blur? true
|
||||
:image (resources/get-image :no-notifications-dark)
|
||||
:title (i18n/label :t/empty-notifications-title-unread)
|
||||
:description description}]]))
|
||||
|
||||
Reference in New Issue
Block a user