Compare commits

..
405 changed files with 6748 additions and 8311 deletions
+1 -5
View File
@@ -16,11 +16,7 @@
;; respect blank line
;; https://github.com/kkinnear/zprint/blob/main/doc/reference.md#respect-bl
:respect-bl
;; hang multiline left-hand-thing
;; https://github.com/kkinnear/zprint/issues/273
:multi-lhs-hang]
:respect-bl]
:fn-map
{"reg-sub" :arg1-pair
"h/describe" :arg1-body
+2 -2
View File
@@ -349,8 +349,8 @@ component-test-watch: ##@ Watch tests and re-run no changes to cljs files
component-test: export TARGET := clojure
component-test: export COMPONENT_TEST := true
component-test: export BABEL_ENV := test
component-test: ##@test Run component tests once in NodeJS
yarn install
component-test: ##@test Run tests once in NodeJS
# Here we create the gyp bindings for nodejs
yarn shadow-cljs compile component-test && \
jest --config=test/jest/jest.config.js
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.5'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
+1 -3
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.3'
pipeline {
agent { label 'linux' }
@@ -8,8 +8,6 @@ pipeline {
disableConcurrentBuilds()
/* Prevent Jenkins jobs from running forever */
timeout(time: 40, unit: 'MINUTES')
/* Allow copying of artifacts from this job. */
copyArtifactPermission('/status-mobile/e2e/*')
/* Limit builds retained */
buildDiscarder(logRotator(
numToKeepStr: '10',
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.5'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.3'
pipeline {
agent { label params.AGENT_LABEL }
+1 -9
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.3'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
@@ -68,14 +68,6 @@ pipeline {
}
}
}
stage('Component Tests') {
steps {
sh """#!/bin/bash
set -eo pipefail
make component-test 2>&1 | tee -a ${LOG_FILE}
"""
}
}
stage('Upload') {
steps {
script {
+6 -12
View File
@@ -1,5 +1,3 @@
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
@@ -20,17 +18,13 @@ pipeline {
disableConcurrentBuilds()
}
stages {
stage('Fetch') {
when { expression { !params.APK_URL } }
stage('Prep') {
steps { script {
copyArtifacts(
projectName: "status-mobile/nightly",
filter: '*-x86.apk',
/* WARNING: This copies the latest available artifact. */
selector: lastWithArtifacts(),
)
apk_path = "${env.WORKSPACE}/${utils.findFile('*-x86.apk')}"
if (params.PR_ID == null) {
error("PR_ID parameter not set!")
}
} }
}
@@ -79,7 +73,7 @@ pipeline {
-m testrail_id \
-m \"new_ui_critical or new_ui_medium\" \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${params.APK_URL ?: apk_path}
--apk=${params.APK_NAME}
"""
}
}
+3 -9
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.5'
pipeline {
@@ -14,10 +14,6 @@ pipeline {
name: 'PR_ID',
description: 'ID of the Pull Request triggering this build.',
)
string(
name: 'APK_URL',
description: 'Optional, set if job require APK to be downloaded from URL.',
)
string(
name: 'KEYWORD_EXPRESSION',
description: 'This will run tests which contain names that match the given string expression (Optional)',
@@ -58,11 +54,9 @@ pipeline {
}
stage('Fetch') {
when { expression { !params.APK_URL } }
steps { script {
steps { script { /* WARNING: This copies the latest available artifact. */
copyArtifacts(
projectName: "status-mobile/prs/android-e2e/PR-${params.PR_ID}",
/* WARNING: This copies the latest available artifact. */
selector: lastWithArtifacts(),
)
apk_path = "${env.WORKSPACE}/${utils.findFile('result/*.apk')}"
@@ -125,7 +119,7 @@ pipeline {
--rerun_count=2 \
--testrail_report=True \
-k \"${params.KEYWORD_EXPRESSION}\" \
--apk=${params.APK_URL ?: apk_path} \
--apk=${apk_path} \
--build=PR-${params.PR_ID}-${utils.timestamp()} \
--pr_number=${params.PR_ID} \
${extraPytestOpts}
-2
View File
@@ -1,5 +1,3 @@
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent { label 'linux' }
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.3'
pipeline {
agent { label 'macos' }
+1 -1
View File
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.6.6'
library 'status-jenkins-lib@v1.6.3'
pipeline {
agent { label 'linux' }
-47
View File
@@ -1,47 +0,0 @@
library 'status-jenkins-lib@v1.6.6'
pipeline {
agent {
label 'linux'
}
triggers {
cron('H 5 * * *')
}
options {
timestamps()
/* Prevent Jenkins jobs from running forever */
timeout(time: 15, unit: 'MINUTES')
/* Disable concurrent jobs */
disableConcurrentBuilds()
/* Don't keep more than 50 builds */
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Get Nodes') {
steps { script {
stagePerNode = nodesByLabel('macos').collectEntries {
["${it}" : generateNodeCleanupStage(it)]
}
} }
}
stage('Clean Xcode') {
steps { script {
parallel stagePerNode
} }
}
}
}
def generateNodeCleanupStage(nodeLabel) {
return { stage(nodeLabel) {
node(nodeLabel) {
dir('/Users/jenkins/Library/Developer/Xcode') {
sh 'rm -fr Archives DerivedData'
}
}
} }
}
+7 -8
View File
@@ -27,10 +27,12 @@ The most important thing is that
status-mobile code that makes it to the `develop` branch, should always point to a tagged version of status-go in the `develop` branch of status-go.
In practice, this means that sometimes they need to be merged in lockstep.
1) Create a PR in status-go and status-mobile. Update the status-go version to the PR revision `scripts/update-status-go.sh $git_revision`.
2) Get both PRs reviewed and approved. Once status-mobile PR has been approved, go through manual QA testing if necessary. Don't merge status-mobile PR just yet.
3) Now that you know the integration between client & server is working, bump the `VERSION` in status-go and merge it.
In practice this means:
1) Create a PR in status-go, get it reviewed by status-go devs
2) Create a PR in status-mobile, get it reviewed by devs, then go through manual testing (if necessary)
3) Once ready to merge, merge status-go PR first, make sure you bump the `VERSION` file in status-go
4) Once merged, tag the version with the new version and push the tag:
```
git checkout develop
@@ -39,7 +41,4 @@ In practice, this means that sometimes they need to be merged in lockstep.
git push origin vx.y.z
```
5) Update status-mobile with the new status-go version, using the new tag `scripts/update-status-go.sh "vx.y.z"`
6) In status-mobile, push, rebase against `develop` and merge it 🚀
important note : make sure your status-go PRs get a tested-ok by QA before merging them in.
6) Push, make sure it's rebased and go through the merge process as above.
+3 -17
View File
@@ -1,4 +1,4 @@
# Code Style Guidelines
# Guidelines
>The goal of this document is to help all contributors (core and external) to
>write code in _unison_ and help establish good practices that serve the Status
@@ -77,21 +77,7 @@ Joshua Comeau.
[rn/view {:style {:padding-horizontal 20}}]
```
### Don't prepend booleans with is-
It is a common practice in JavaScript and other languages to prepend boolean variable names with `is-*`.
In ClojureScript it is common practice to suffix boolean variable names with a `?`.
There is no need for both of these and so it is preferable to stick with the latter.
```clojure
;; bad
(let [is-open? true] ...)
;; good
(let [open? true] ...)
```
### Styles def vs defn
#### Styles def vs defn
Always use `def` over `defn`, unless the style relies on dynamic values, such as
deref'ed atoms.
@@ -184,7 +170,7 @@ Use the simple `defn` to declare components. Don't use `utils.views/defview` and
(do-something window-width)))
```
### Use `[]` instead of `()` in Reagent components
#### Use `[]` instead of `()` in Reagent components
- The `()` version [does NOT work with Form-2 and
Form-3](https://github.com/reagent-project/reagent/blob/master/doc/UsingSquareBracketsInsteadOfParens.md#a-further-significant-why)
+2 -16
View File
@@ -18,6 +18,8 @@ Also test watcher can be launched. It will re-run the entire test suite when any
Developers can also manually change the shadow-cljs option `:ns-regex` to control which namespaces the test runner should pick.
## Testing with REPL
The most convenient way to develop and run test locally is using REPL:
@@ -50,19 +52,3 @@ In the video below, you can see two buffers side-by-side. On the left the source
Here I'm showing a terminal-only experience using Tmux (left pane Emacs, right pane the output coming from running the make target).
[2022-12-19 13-17.webm](https://user-images.githubusercontent.com/46027/208471199-1909c446-c82d-42a0-9350-0c15ca562713.webm)
## Component tests
To run tests:
```
make component-test
```
Also test watcher can be launched. It will re-run the entire test suite when any file is modified
```
make component-test-watch
```
Check [component tests doc](./component-tests-overview.md) for more.
+12 -12
View File
@@ -525,8 +525,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --openssl-legacy-provider --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1";
shellPath = /bin/sh;
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1";
};
0F876BD5356F61BF142A01A0 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
@@ -546,7 +546,7 @@
"$(DERIVED_FILE_DIR)/Pods-Status-StatusIm-StatusImTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
@@ -568,7 +568,7 @@
"$(DERIVED_FILE_DIR)/Pods-Status-StatusIm-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
@@ -583,8 +583,8 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --openssl-legacy-provider --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1";
shellPath = /bin/sh;
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1";
};
3AAD2AD724A3A60E0075D594 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
@@ -597,7 +597,7 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ./set_xcode_version.log 2>&1";
};
3C1038075AE5E6FB86AC2319 /* [CP] Copy Pods Resources */ = {
@@ -618,7 +618,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh\"\n";
showEnvVarsInLog = 0;
};
@@ -640,7 +640,7 @@
"$(DERIVED_FILE_DIR)/Pods-Status-StatusImPR-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
@@ -662,7 +662,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
@@ -677,7 +677,7 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/scripts/set_xcode_version.sh\" > ./set_xcode_version.log 2>&1";
};
E732E3E1B024946173BF6D3D /* [CP] Copy Pods Resources */ = {
@@ -698,7 +698,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env sh";
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh\"\n";
showEnvVarsInLog = 0;
};
+1 -1
View File
@@ -52,7 +52,7 @@
<key>ITSAppUsesNonExemptEncryption</key>
<true/>
<key>ITSEncryptionExportComplianceCode</key>
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
+1 -1
View File
@@ -48,7 +48,7 @@
<key>ITSAppUsesNonExemptEncryption</key>
<true/>
<key>ITSEncryptionExportComplianceCode</key>
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
@@ -797,7 +797,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
final JSONObject jsonConfig = new JSONObject(configJSON);
final String keyStorePath = pathCombine(this.getNoBackupDirectory(), "/keystore");
jsonConfig.put("keystorePath", keyStorePath);
jsonConfig.put("rootDataDir", this.getNoBackupDirectory());
executeRunnableStatusGoMethod(() -> Statusgo.inputConnectionStringForBootstrapping(connectionString, jsonConfig.toString()), callback);
}
@@ -1139,11 +1139,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
executeRunnableStatusGoMethod(() -> Statusgo.generateAlias(seed), callback);
}
@ReactMethod
public void emojiHash(final String publicKey, final Callback callback) throws JSONException {
executeRunnableStatusGoMethod(() -> Statusgo.emojiHash(publicKey), callback);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String identicon(final String seed) {
return Statusgo.identicon(seed);
@@ -329,13 +329,12 @@ RCT_EXPORT_METHOD(inputConnectionStringForBootstrapping:(NSString *)cs
NSDictionary *configDict = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *rootUrl =[[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
NSURL *rootDataDir = rootUrl.path;
NSURL *multiaccountKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
NSString *keystoreDir = multiaccountKeystoreDir.path;
[configDict setValue:keystoreDir forKey:@"keystorePath"];
[configDict setValue:rootDataDir forKey:@"rootDataDir"];
NSString *modifiedConfigJSON = [configDict bv_jsonStringWithPrettyPrint:NO];
NSString *result = StatusgoInputConnectionStringForBootstrapping(cs,modifiedConfigJSON);
callback(@[result]);
}
@@ -866,12 +865,6 @@ RCT_EXPORT_METHOD(generateAliasAsync:(NSString *)publicKey
callback(@[result]);
}
RCT_EXPORT_METHOD(emojiHash:(NSString *)publicKey
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoEmojiHash(publicKey);
callback(@[result]);
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(identicon:(NSString *)publicKey) {
return StatusgoIdenticon(publicKey);
}
-14
View File
@@ -16,7 +16,6 @@ let
mkdir -p $out
cd $out
'' +
# TODO: Generalize this section to not repeat the same code.
(concatMapStrings (dep:
let
url = "${dep.host}/${dep.path}";
@@ -34,13 +33,6 @@ let
jar-download = optionalString (jar.sha256 != "") (
fetchurl { url = "${url}.${dep.type}"; inherit (jar) sha256; }
);
nodeps = {
sha1 = attrByPath [ "nodeps" "sha1" ] "" dep;
sha256 = attrByPath [ "nodeps" "sha256" ] "" dep;
};
nodeps-download = optionalString (nodeps.sha256 != "") (
fetchurl { url = "${url}-nodeps.jar"; inherit (nodeps) sha256; }
);
fileName = last (splitString "/" dep.path);
directory = removeSuffix fileName dep.path;
in
@@ -59,12 +51,6 @@ let
${optionalString (jar.sha1 != "") ''
echo "${jar.sha1}" > "${dep.path}.${dep.type}.sha1"
''}
${optionalString (nodeps-download != "") ''
ln -s "${nodeps-download}" "${dep.path}-nodeps.jar"
''}
${optionalString (nodeps.sha1 != "") ''
echo "${nodeps.sha1}" > "${dep.path}.${dep.type}.sha1"
''}
'')
deps));
+45 -59
View File
@@ -4018,30 +4018,30 @@
},
{
"path": "com/github/status-im/status-keycard-java/android/3.1.1/android-3.1.1",
"path": "com/github/status-im/status-keycard-java/android/3.0.4/android-3.0.4",
"host": "https://jitpack.io",
"type": "jar",
"pom": {
"sha1": "ac7e6699628e329dfc028345f32bc41c5d6c2f33",
"sha256": "12qh5qwncj2gbv6g1whz32rliap34mv2kxlyqv2ivg5jc6yfvyhj"
"sha1": "e6e1933d85ac05b51953effc21ab893679f5864b",
"sha256": "1y9kqp3qgx3kqaf6vm6iwphdj8caqd9x6kncjsnp6f0nirp5ijzq"
},
"jar": {
"sha1": "26118061c0996fff357ae30cc360e5928c8dd455",
"sha256": "15m0h4ri0ny7jz4vvl25blw5s65iivlv5gchw0j5n0jblr1wr270"
"sha1": "dca6e47e087a649643bbad1c1feb4b0b5e1aaf45",
"sha256": "0krxjj5h5zmap4645llscwkmyszm8qyngwg8vi8ds1mf2kp0jaz1"
}
},
{
"path": "com/github/status-im/status-keycard-java/lib/3.1.1/lib-3.1.1",
"path": "com/github/status-im/status-keycard-java/lib/3.0.4/lib-3.0.4",
"host": "https://jitpack.io",
"type": "jar",
"pom": {
"sha1": "63c7bbd55ddbf88d1b89941f78158aa07fb46873",
"sha256": "1x0n0xq6zgg5qj6s6j9sjpy3zbggfznr64pb6sjh2882y4d1j6qi"
"sha1": "718d3d286d53186552a84cee1a1283e0975da789",
"sha256": "0s2mbx1638qig4m802rf0ill9bghgga8w3ld0vpcz6x7h2kmvv6g"
},
"jar": {
"sha1": "07f0374f17160c8731350316226ffe0de50f6f31",
"sha256": "1bfvb0ynxa0ws46cqmyx6d960pyg7hjxv3xwx7mg0xw03xk2bam1"
"sha1": "b2afa2711a9898d9aeb188195edde53c00984543",
"sha256": "16c7r0667pbgljx1p8zmvahv1igcnway1qjqprbn0n4ny1vy2imm"
}
},
@@ -5778,10 +5778,6 @@
"jar": {
"sha1": "de8c77583e97bbbd3cdbe5f406b583e9b081ff56",
"sha256": "0435ff3qzmcxprsm93x3aw9clgfpa871zl41izhijwm3bwib9yfy"
},
"nodeps": {
"sha1": "273cc1869ddf7ebbac8176402e29f41b1c83d7df",
"sha256": "1w4a2ak60r46wiy8yl00yy8v397qa2zja5jmsd7wsk1p2sjyqn9z"
}
},
@@ -6934,12 +6930,12 @@
},
{
"path": "com/sun/xml/bind/jaxb-bom-ext/4.0.2/jaxb-bom-ext-4.0.2",
"path": "com/sun/xml/bind/jaxb-bom-ext/4.0.1/jaxb-bom-ext-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "600924984be6a63e1c38d5f6ef0637a070002937",
"sha256": "1jsdpynkd7d7bqp81ajcy7fa2riz9wnl8rb81icd8shv7awnkbfx"
"sha1": "6916f1573d78b0d41b629257277da86215ea7a6f",
"sha256": "069gm0wclljzdjn5j29hizhc4rakszk8kgzmsx66h5fkvlcvgd5b"
}
},
@@ -6954,12 +6950,12 @@
},
{
"path": "com/sun/xml/bind/mvn/jaxb-parent/4.0.2/jaxb-parent-4.0.2",
"path": "com/sun/xml/bind/mvn/jaxb-parent/4.0.1/jaxb-parent-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "160938bb66dc61a4839edaad77a5b7b7f9f5171d",
"sha256": "184avj0jpjz1rsxrrw88yn31yxkvw1l3blyq6fs4sbmgac12dvqc"
"sha1": "315ec09b889041008f815ddd41cca9633ee50cc4",
"sha256": "1bpqac2a25qq81h99zvj20n9ac2hd8iry7mnwisvd4f8avpm272i"
}
},
@@ -6984,12 +6980,12 @@
},
{
"path": "com/sun/xml/bind/mvn/jaxb-txw-parent/4.0.2/jaxb-txw-parent-4.0.2",
"path": "com/sun/xml/bind/mvn/jaxb-txw-parent/4.0.1/jaxb-txw-parent-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "c9c99b4e33782535b5988616bc3b452543cb48e5",
"sha256": "0xxyqayffjwdmagqa6jqca8ykl3iz2vhw59l6478nv8ir268x2rn"
"sha1": "0f5e6242fe24ccd5e4c663dc66f7b935b4cffb55",
"sha256": "1niyxycc1k9qb0hpkb30zcccai28pq4yhy9a8p45d24zgrvdgs1a"
}
},
@@ -7654,12 +7650,12 @@
},
{
"path": "org/antlr/antlr4-master/4.12.0/antlr4-master-4.12.0",
"path": "org/antlr/antlr4-master/4.11.1/antlr4-master-4.11.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "5cd9d694d06e046886a7a8e54d70b22bc03af4a3",
"sha256": "0x3rhw76nrzh35d8liq9wffm74rshxwg944xc55c3qlcwlxg3xj2"
"sha1": "298ecf68d872658e1d92457168018bd5b8fff245",
"sha256": "1b80dq56qs5rqzbvq5pyf2pcsgfmmfmsmznhbxw1armvvbl5vskj"
}
},
@@ -7678,16 +7674,16 @@
},
{
"path": "org/antlr/antlr4-runtime/4.12.0/antlr4-runtime-4.12.0",
"path": "org/antlr/antlr4-runtime/4.11.1/antlr4-runtime-4.11.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "jar",
"pom": {
"sha1": "3113149fe4ea467b27f14f2b99096cac9d4ca53a",
"sha256": "1r3isigbls4i2ldc4kyq3kzv2klcgz7przyq3knz02aasrzm95n6"
"sha1": "b76aa0c70639f8b3112e4d5e14abf951cb38761c",
"sha256": "0d0vd3nh9f2aqy4njx4d0qh7jwha83crmxkyplgmk307b4lyqmn4"
},
"jar": {
"sha1": "dd105cf6ac9f7417b3782c178f6dbd06bf75df57",
"sha256": "0d6sd7jrxfxd7qp5gbsd8vdq6wp1r2iww189g76i0vkxj8s3ndfv"
"sha1": "069214c1de1960040729702eb58deac8827135e7",
"sha256": "0nfsdach3x0vyv1isnvvjp7hif0kdzyb1i1f0lv4vhfcq59nav70"
}
},
@@ -8544,16 +8540,16 @@
},
{
"path": "org/checkerframework/checker-qual/3.31.0/checker-qual-3.31.0",
"path": "org/checkerframework/checker-qual/3.29.0/checker-qual-3.29.0",
"host": "https://repo.maven.apache.org/maven2",
"type": "jar",
"pom": {
"sha1": "a600a4210e8c3db6ea45ea0989920b0255dbb6f6",
"sha256": "0cajb4ivvw446lc3bcwl49difmpgg1rrcbzklxc87rs7pqz9qms3"
"sha1": "76bd5ffeef4d9b039e6445e2674264dbc5bfb94c",
"sha256": "0azs4ndih02r5a3fvn08sndwc58ymzma2krqclfz6pivmfrxcyp2"
},
"jar": {
"sha1": "eeefd4af42e2f4221d145c1791582f91868f99ab",
"sha256": "1fai6kk72j76ivgipgl7ckbcn8g8yl289pbx712zpii2dm3mzvqw"
"sha1": "a805a761b7a734d69f9c1766ead1ff78698a1497",
"sha256": "1hb8ajlszzvh3cimvzkwgkx2689rh131jh7259a7s94cvzjq1p77"
}
},
@@ -8779,16 +8775,6 @@
}
},
{
"path": "org/eclipse/ee4j/project/1.0.8/project-1.0.8",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "41a621037931f9f4aa8768694be9f5cb59df83df",
"sha256": "0jv7vwx72mx30ydlhk5ql3q8zb67m2qpw43f4inaypm3aip7n30d"
}
},
{
"path": "org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2",
"host": "https://repo.maven.apache.org/maven2",
@@ -8842,12 +8828,12 @@
},
{
"path": "org/glassfish/jaxb/jaxb-bom/4.0.2/jaxb-bom-4.0.2",
"path": "org/glassfish/jaxb/jaxb-bom/4.0.1/jaxb-bom-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "pom",
"pom": {
"sha1": "12668536ac24e77398bd675a1e458c1824d156c7",
"sha256": "08bgmpyhps9h25z6950g7751zg6g5vkvn02v1znamarlaw2niyl6"
"sha1": "99d85661aef6ac9f6bfb6af0f0ea507d054b91e1",
"sha256": "151zbrywjzbnmwqg246iyz0bqnx2hh730hxmig62vh67s2nbw8lm"
}
},
@@ -8866,16 +8852,16 @@
},
{
"path": "org/glassfish/jaxb/jaxb-core/4.0.2/jaxb-core-4.0.2",
"path": "org/glassfish/jaxb/jaxb-core/4.0.1/jaxb-core-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "jar",
"pom": {
"sha1": "9aecfe4442b96fc3f9cabc25e7c6e310972d674e",
"sha256": "00yij4s17cvixysjdjrzc51jd07fpcc11jy4lgg1z8zfvx6zdhma"
"sha1": "e366262bbe2037088461f748896f6aa4afcfd3c6",
"sha256": "14d3d3p0c42qd8jq8mxmpymd17x5zxixhyccwfmxkr24ad9pvj46"
},
"jar": {
"sha1": "08c29249f6c10f4ee08967783831580b0f5c5360",
"sha256": "1k8c8wf420nmqyhyr6p0ns12mx127bzwq71rp6x0nj3qmma2kzyp"
"sha1": "b4707bb31dfcf54ae424b930741f0cd62d672af9",
"sha256": "19v525w4qb65czx1v31k5lz0yan9vc030h736iqgz59l2048hf3l"
}
},
@@ -8908,16 +8894,16 @@
},
{
"path": "org/glassfish/jaxb/txw2/4.0.2/txw2-4.0.2",
"path": "org/glassfish/jaxb/txw2/4.0.1/txw2-4.0.1",
"host": "https://repo.maven.apache.org/maven2",
"type": "jar",
"pom": {
"sha1": "f8eef3319522b021e51123ea88d6ab4d484d2c59",
"sha256": "1ry99inn7v0fpgfrnhj3h4qnhaccmksn8vsrgfn1ysj6cqrfgc8p"
"sha1": "160273691bf3ffa0745bf86453dd56c62ec23ac2",
"sha256": "03zv45jgmppikcqk7gq01pyryzvam3qnllc5q7jjywvnq5mjdvvp"
},
"jar": {
"sha1": "24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc",
"sha256": "036gl0lp8y83zxy01pyzvq169i0r03lhm169fw7m6hha9wp92wga"
"sha1": "797720dfe2e15504f6014fb82eb873051a653c75",
"sha256": "1aba3rk9jm66k65vx95a92sdapbsvfbsvii26s8y9rach44p9m7l"
}
},
+2 -2
View File
@@ -357,8 +357,8 @@ com.github.bumptech.glide:glide:4.12.0
com.github.bumptech.glide:okhttp3-integration:4.12.0
com.github.clans:fab:1.6.4
com.github.gundy:semver4j:0.16.4
com.github.status-im.status-keycard-java:android:3.1.1
com.github.status-im.status-keycard-java:lib:3.1.1
com.github.status-im.status-keycard-java:android:3.0.4
com.github.status-im.status-keycard-java:lib:3.0.4
com.github.status-im:function:0.0.1
com.github.wix-playground:ahbottomnavigation:3.3.0
com.github.wix-playground:reflow-animator:1.0.6
+11 -12
View File
@@ -285,8 +285,8 @@ https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.0
https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.2.0-alpha03/material-1.2.0-alpha03.pom
https://jitpack.io/com/github/Dimezis/BlurView/version-2.0.2/BlurView-version-2.0.2.pom
https://jitpack.io/com/github/status-im/function/0.0.1/function-0.0.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/android/3.1.1/android-3.1.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/lib/3.1.1/lib-3.1.1.pom
https://jitpack.io/com/github/status-im/status-keycard-java/android/3.0.4/android-3.0.4.pom
https://jitpack.io/com/github/status-im/status-keycard-java/lib/3.0.4/lib-3.0.4.pom
https://jitpack.io/com/github/wix-playground/ahbottomnavigation/3.3.0/ahbottomnavigation-3.3.0.pom
https://jitpack.io/com/github/wix-playground/reflow-animator/1.0.6/reflow-animator-1.0.6.pom
https://jitpack.io/com/github/yalantis/ucrop/2.2.6-native/ucrop-2.2.6-native.pom
@@ -503,12 +503,12 @@ https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons-runtime/4.1.1
https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons/2.21/istack-commons-2.21.pom
https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons/4.1.1/istack-commons-4.1.1.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-bom-ext/2.2.11/jaxb-bom-ext-2.2.11.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-bom-ext/4.0.2/jaxb-bom-ext-4.0.2.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-bom-ext/4.0.1/jaxb-bom-ext-4.0.1.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-parent/4.0.2/jaxb-parent-4.0.2.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-parent/4.0.1/jaxb-parent-4.0.1.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-runtime-parent/2.2.11/jaxb-runtime-parent-2.2.11.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-txw-parent/2.2.11/jaxb-txw-parent-2.2.11.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-txw-parent/4.0.2/jaxb-txw-parent-4.0.2.pom
https://repo.maven.apache.org/maven2/com/sun/xml/bind/mvn/jaxb-txw-parent/4.0.1/jaxb-txw-parent-4.0.1.pom
https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.13/FastInfoset-1.2.13.pom
https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/2.1.0/FastInfoset-2.1.0.pom
https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/fastinfoset-project/1.2.13/fastinfoset-project-1.2.13.pom
@@ -561,9 +561,9 @@ https://repo.maven.apache.org/maven2/org/antlr/ST4/4.0.8/ST4-4.0.8.pom
https://repo.maven.apache.org/maven2/org/antlr/ST4/4.3.4/ST4-4.3.4.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-master/4.5.2-1/antlr4-master-4.5.2-1.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-master/4.5.3/antlr4-master-4.5.3.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-master/4.12.0/antlr4-master-4.12.0.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-master/4.11.1/antlr4-master-4.11.1.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-runtime/4.5.2-1/antlr4-runtime-4.5.2-1.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-runtime/4.12.0/antlr4-runtime-4.12.0.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4-runtime/4.11.1/antlr4-runtime-4.11.1.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr4/4.5.3/antlr4-4.5.3.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr-master/3.3/antlr-master-3.3.pom
https://repo.maven.apache.org/maven2/org/antlr/antlr-master/3.5.2/antlr-master-3.5.2.pom
@@ -636,7 +636,7 @@ https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov
https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.60/bcprov-jdk15on-1.60.pom
https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.70/bcprov-jdk15on-1.70.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.31.0/checker-qual-3.31.0.pom
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.29.0/checker-qual-3.29.0.pom
https://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.pom
https://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.pom
@@ -656,17 +656,16 @@ https://repo.maven.apache.org/maven2/org/easymock/easymock/5.1.0/easymock-5.1.0.
https://repo.maven.apache.org/maven2/org/eclipse/angus/angus-activation-project/2.0.0/angus-activation-project-2.0.0.pom
https://repo.maven.apache.org/maven2/org/eclipse/angus/angus-activation/2.0.0/angus-activation-2.0.0.pom
https://repo.maven.apache.org/maven2/org/eclipse/ee4j/project/1.0.7/project-1.0.7.pom
https://repo.maven.apache.org/maven2/org/eclipse/ee4j/project/1.0.8/project-1.0.8.pom
https://repo.maven.apache.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.pom
https://repo.maven.apache.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.pom
https://repo.maven.apache.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.6.1/ecj-4.6.1.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-bom/2.2.11/jaxb-bom-2.2.11.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-bom/4.0.2/jaxb-bom-4.0.2.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-bom/4.0.1/jaxb-bom-4.0.1.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-core/2.2.11/jaxb-core-2.2.11.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-core/4.0.2/jaxb-core-4.0.2.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-core/4.0.1/jaxb-core-4.0.1.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/txw2/2.2.11/txw2-2.2.11.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/txw2/4.0.2/txw2-4.0.2.pom
https://repo.maven.apache.org/maven2/org/glassfish/jaxb/txw2/4.0.1/txw2-4.0.1.pom
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-core-2.2.pom
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
-22
View File
@@ -36,11 +36,6 @@ function match_repo_url() {
exit 1
}
function pom_has_nodeps_jar() {
grep '<shadedClassifierName>nodeps</shadedClassifierName>' $1 \
2>&1 >/dev/null
}
if [[ -z "${1}" ]]; then
echo "Required argument not given!" >&2
exit 1
@@ -101,16 +96,6 @@ if [[ "${OBJ_TYPE}" != "pom" ]]; then
fi
fi
# Some deps include nodeps JARs which include.
if pom_has_nodeps_jar "${POM_PATH}"; then
NODEPS_NIX_FETCH_OUT=$(nix_fetch "${OBJ_REL_URL}-nodeps.jar")
if [[ ${?} -eq 0 ]]; then
NODEPS_PATH=$(get_nix_path "${NODEPS_NIX_FETCH_OUT}")
NODEPS_SHA256=$(get_nix_sha "${NODEPS_NIX_FETCH_OUT}")
NODEPS_SHA1=$(get_sha1 "${NODEPS_PATH}")
fi
fi
# Format into a Nix attrset entry
echo -ne "
{
@@ -129,13 +114,6 @@ if [[ -n "${OBJ_SHA256}" ]]; then
\"jar\": {
\"sha1\": \"${OBJ_SHA1}\",
\"sha256\": \"${OBJ_SHA256}\"
}";[[ -n "${NODEPS_SHA256}" ]] && echo -n ","
fi
if [[ -n "${NODEPS_SHA256}" ]]; then
echo -n "
\"nodeps\": {
\"sha1\": \"${NODEPS_SHA1}\",
\"sha256\": \"${NODEPS_SHA256}\"
}"
fi
echo -e "\n },"
-3
View File
@@ -1,9 +1,6 @@
{ mkShell, deps }:
mkShell {
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
NODE_OPTIONS = "--openssl-legacy-provider";
# check if node modules changed and if so install them
shellHook = ''
export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)
-12
View File
@@ -32,18 +32,6 @@ in {
# For parsing gradle.properties into an attrset
gradlePropParser = callPackage ./tools/gradlePropParser.nix { };
# Clojure formatting tool
zprint = super.zprint.override rec {
buildGraalvmNativeImage = args: super.buildGraalvmNativeImage ( args // rec {
inherit (args) pname;
version = "1.2.5";
src = self.fetchurl {
url = "https://github.com/kkinnear/${pname}/releases/download/${version}/${pname}-filter-${version}";
sha256 = "sha256-PWdR5jqyzvTk9HoxqDldwtZNik34dmebBtZZ5vtva4A=";
};
});
};
# Package version adjustments
gradle = super.gradle_5;
nodejs = super.nodejs-16_x;
+2 -2
View File
@@ -19,7 +19,7 @@
"@babel/preset-typescript": "^7.17.12",
"@react-native-async-storage/async-storage": "^1.17.9",
"@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6",
"@react-native-community/blur": "git+https://github.com/status-im/react-native-blur#refs/tags/v4.3.1-status",
"@react-native-community/blur": "git+https://github.com/status-im/react-native-blur#refs/tags/v4.3.0-status",
"@react-native-community/cameraroll": "git+https://github.com/status-im/react-native-cameraroll.git#refs/tags/v4.0.4-status.0",
"@react-native-community/clipboard": "^1.2.2",
"@react-native-community/hooks": "^2.5.1",
@@ -69,7 +69,7 @@
"react-native-safe-area-context": "^2.0.0",
"react-native-shake": "^3.3.1",
"react-native-share": "^7.0.1",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.39",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.5.38",
"react-native-svg": "^9.8.4",
"react-native-touch-id": "^4.4.1",
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#refs/tags/v11.16.0-status",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 KiB

+4 -2
View File
@@ -1,9 +1,11 @@
#!/usr/bin/env sh
INVALID_CHANGES=$(grep -E -r '(re-frame/dispatch|rf/dispatch|re-frame/subscribe|rf/subscribe|rf/sub|<sub|>evt|status-im\.|status-im2\.)' './src/quo2')
CHANGES=$(git diff --no-ext-diff --diff-filter=d --cached --unified=0 --no-prefix --minimal --exit-code src/quo src/quo2 | grep '^+' || echo '')
INVALID_CHANGES=$(echo "$CHANGES" | grep -E '(re-frame/dispatch|rf/dispatch|re-frame/subscribe|rf/subscribe|rf/sub|<sub|>evt|status-im)')
if test -n "$INVALID_CHANGES"; then
echo "WARNING: re-frame, status-im are not allowed in quo2 components"
echo "re-frame dispatch/subscribe and status-im are not allowed in quo/quo2 components"
echo ''
echo "$INVALID_CHANGES"
exit 1
+50 -50
View File
@@ -1,64 +1,64 @@
;; shadow-cljs configuration
{:source-paths ["src" "test/cljs"]
{:source-paths ["src" "test/cljs"]
:dependencies [[reagent "1.0.0"]
[re-frame "0.12.0"]
[binaryage/oops "0.7.0"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[status-im/timbre "4.10.0-2-status"]
[com.taoensso/encore "2.105.0"]
[hickory "0.7.1"]
[cljs-bean "1.3.0"]
[com.cognitect/transit-cljs "0.8.248"]
[mvxcvi/alphabase "1.0.0"]
[camel-snake-kebab "0.4.3"]
;; dev dependencies
[refactor-nrepl "2.5.0"]
[cider/cider-nrepl "0.25.3"]
[cider/piggieback "0.4.1"]
[re-frisk-remote "1.6.0"]
;; routing
[bidi "2.1.6"]
;; test dependencies
[day8.re-frame/test "0.1.5"]
[com.taoensso/tufte "2.1.0"]]
:dependencies [[reagent "1.0.0"]
[re-frame "0.12.0"]
[binaryage/oops "0.7.0"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[status-im/timbre "4.10.0-2-status"]
[com.taoensso/encore "2.105.0"]
[hickory "0.7.1"]
[cljs-bean "1.3.0"]
[com.cognitect/transit-cljs "0.8.248"]
[mvxcvi/alphabase "1.0.0"]
[camel-snake-kebab "0.4.3"]
;; dev dependencies
[refactor-nrepl "2.5.0"]
[cider/cider-nrepl "0.25.3"]
[cider/piggieback "0.4.1"]
[re-frisk-remote "1.6.0"]
;; routing
[bidi "2.1.6"]
;; test dependencies
[day8.re-frame/test "0.1.5"]
[com.taoensso/tufte "2.1.0"]]
;; port and middleware for repl in development
:nrepl {:port 7888
:middleware [cider.piggieback/wrap-cljs-repl
refactor-nrepl.middleware/wrap-refactor]}
:nrepl {:port 7888
:middleware [cider.piggieback/wrap-cljs-repl
refactor-nrepl.middleware/wrap-refactor]}
;; shadow-cljs web interface
:http {:port 3449
:host "0.0.0.0"}
:http {:port 3449
:host "0.0.0.0"}
:cache-blockers #{status-im.utils.js-resources status-im.ui.components.icons.icons}
:builds
{:mobile
{:target :react-native
{:target :react-native
:output-dir "app"
:init-fn status-im2.core/init
:init-fn status-im2.core/init
;; When false, the Shadow-CLJS watcher won't automatically refresh
;; the target files (a.k.a hot reload). When false, you can manually
;; reload by calling `shadow.cljs.devtools.api/watch-compile-all!`.
:devtools {:autobuild #shadow/env ["SHADOW_AUTOBUILD_ENABLED" :default true :as :bool]}
:dev {:devtools {:after-load status-im2.setup.hot-reload/reload
:build-notify status-im2.setup.hot-reload/build-notify
:preloads [re-frisk-remote.preload]}
:closure-defines
{status-im2.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
status-im2.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"}
:compiler-options {:output-feature-set :es5
:closure-defines
{re-frame.trace/trace-enabled? true}
:source-map false
:infer-externs true}
;; if you want to use a real device, set your local ip
;; in the SHADOW_HOST env variable to make sure that
;; it will use the right interface
:local-ip #shadow/env "SHADOW_HOST"}
:chunks {:fleets status-im.fleet.default-fleet/default-fleets}
:devtools {:autobuild #shadow/env ["SHADOW_AUTOBUILD_ENABLED" :default true :as :bool]}
:dev {:devtools {:after-load status-im2.setup.hot-reload/reload
:build-notify status-im2.setup.hot-reload/build-notify
:preloads [re-frisk-remote.preload]}
:closure-defines
{status-im2.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
status-im2.config/OPENSEA_API_KEY #shadow/env "OPENSEA_API_KEY"}
:compiler-options {:output-feature-set :es5
:closure-defines
{re-frame.trace/trace-enabled? true}
:source-map false
:infer-externs true}
;; if you want to use a real device, set your local ip
;; in the SHADOW_HOST env variable to make sure that
;; it will use the right interface
:local-ip #shadow/env "SHADOW_HOST"}
:chunks {:fleets status-im.fleet.default-fleet/default-fleets}
:release
{:closure-defines
{status-im2.config/POKT_TOKEN #shadow/env "POKT_TOKEN"
@@ -77,10 +77,10 @@
;; produced by the target :mocks below and redefines node require
;; function to use the mocks instead of the rn libraries
:test
{:output-to "target/test/test.js"
:output-dir "target/test"
:optimizations :simple
:target :node-test
{:output-to "target/test/test.js"
:output-dir "target/test"
:optimizations :simple
:target :node-test
;; When running tests without a REPL you can uncomment below line to `make test-watch` a specific file
;; :ns-regexp "status-im2.subs.chat.messages-test$"
:main
+79 -83
View File
@@ -33,64 +33,63 @@ globalThis.__STATUS_MOBILE_JS_IDENTITY_PROXY__ = new Proxy({}, {get() { return (
(def svg #js {})
(def react-native
(clj->js
{:NativeModules {:RNGestureHandlerModule {:Direction (fn [])}
:PushNotifications {}
:Status utils.test/status
:ReanimatedModule {:configureProps (fn [])}}
(clj->js {:NativeModules {:RNGestureHandlerModule {:Direction (fn [])}
:PushNotifications {}
:Status utils.test/status
:ReanimatedModule {:configureProps (fn [])}}
:View {}
:RefreshControl {}
:AppState {}
:Alert {:alert (fn [])}
:FlatList {}
:SectionList {}
:Text {}
:StatusBar {}
:ScrollView {}
:KeyboardAvoidingView {}
:TextInput {}
:Image {}
:Picker {:Item {}}
:Switch {}
:Modal {}
:Keyboard {:dismiss (fn [])}
:Linking {}
:TouchableWithoutFeedback {}
:TouchableHighlight {}
:Pressable {}
:TouchableOpacity {}
:ActivityIndicator {}
:StyleSheet {:create (fn [])}
:Animated {:createAnimatedComponent identity
:Value (fn [])
:ValueXY (fn [])
:View {}
:FlatList {}
:ScrollView {}
:Text {}}
:Easing {:bezier (fn [])
:poly (fn [])
:out (fn [])
:in (fn [])
:inOut (fn [])}
:DeviceEventEmitter {:addListener (fn [])}
:Dimensions {:get (fn []) :addEventListener identity}
:useWindowDimensions {}
:Platform {:select (fn [])}
:I18nManager {:isRTL ""}
:NativeEventEmitter (fn [])
:LayoutAnimation {:Presets #js
{:easeInEaseOut nil
:linear nil
:spring nil}
:Types #js {}
:Properties #{}
:create (fn [])
:configureNext (fn [])}
:requireNativeComponent (fn [] {:propTypes ""})
:Appearance {:getColorScheme (fn [])
:addChangeListener (fn [])}}))
:View {}
:RefreshControl {}
:AppState {}
:Alert {:alert (fn [])}
:FlatList {}
:SectionList {}
:Text {}
:StatusBar {}
:ScrollView {}
:KeyboardAvoidingView {}
:TextInput {}
:Image {}
:Picker {:Item {}}
:Switch {}
:Modal {}
:Keyboard {:dismiss (fn [])}
:Linking {}
:TouchableWithoutFeedback {}
:TouchableHighlight {}
:Pressable {}
:TouchableOpacity {}
:ActivityIndicator {}
:StyleSheet {:create (fn [])}
:Animated {:createAnimatedComponent identity
:Value (fn [])
:ValueXY (fn [])
:View {}
:FlatList {}
:ScrollView {}
:Text {}}
:Easing {:bezier (fn [])
:poly (fn [])
:out (fn [])
:in (fn [])
:inOut (fn [])}
:DeviceEventEmitter {:addListener (fn [])}
:Dimensions {:get (fn []) :addEventListener identity}
:useWindowDimensions {}
:Platform {:select (fn [])}
:I18nManager {:isRTL ""}
:NativeEventEmitter (fn [])
:LayoutAnimation {:Presets #js
{:easeInEaseOut nil
:linear nil
:spring nil}
:Types #js {}
:Properties #{}
:create (fn [])
:configureNext (fn [])}
:requireNativeComponent (fn [] {:propTypes ""})
:Appearance {:getColorScheme (fn [])
:addChangeListener (fn [])}}))
(set! js/ReactNative react-native)
@@ -139,7 +138,6 @@ globalThis.__STATUS_MOBILE_JS_IDENTITY_PROXY__ = new Proxy({}, {get() { return (
(def react-native-svg
#js
{:ClipPath #js {:render identity}
:Circle #js {:render identity}
:Defs #js {:render identity}
:Path #js {:render identity}
:Rect #js {:render identity}
@@ -177,19 +175,19 @@ globalThis.__STATUS_MOBILE_JS_IDENTITY_PROXY__ = new Proxy({}, {get() { return (
(def react-native-navigation
#js
{:Navigation #js
{:constants (fn [] #js {:then identity})
:setDefaultOptions identity
:setRoot identity
:dismissOverlay #(js/Promise.resolve)
:showOverlay identity
{:constants (fn [] #js {:then identity})
:setDefaultOptions identity
:setRoot identity
:dismissOverlay #(js/Promise.resolve)
:showOverlay identity
:setLazyComponentRegistrator identity
:pop identity
:push identity
:mergeOptions identity
:popToRoot identity
:showModal identity
:dismissModal identity
:registerComponent identity
:pop identity
:push identity
:mergeOptions identity
:popToRoot identity
:showModal identity
:dismissModal identity
:registerComponent identity
:events
(fn []
#js
@@ -266,15 +264,7 @@ globalThis.__STATUS_MOBILE_JS_IDENTITY_PROXY__ = new Proxy({}, {get() { return (
(def react-native-gesture-handler
#js
{:FlatList #js {}
:Gesture #js {:Pan nil}
:GestureDetector #js {}
:LongPressGestureHandler #js {}
:NativeViewGestureHandler #js {}
:PanGestureHandler #js {}
:PureNativeButton #js {}
:RectButton #js {}
:ScrollView #js {}
{:default #js {}
:State #js
{:BEGAN nil
:ACTIVE nil
@@ -282,13 +272,19 @@ globalThis.__STATUS_MOBILE_JS_IDENTITY_PROXY__ = new Proxy({}, {get() { return (
:END nil
:FAILED nil
:UNDETERMINED nil}
:Swipeable #js {}
:PureNativeButton #js {}
:TapGestureHandler #js {}
:PanGestureHandler #js {}
:TouchableHighlight #js {}
:TouchableOpacity #js {}
:LongPressGestureHandler #js {}
:TouchableWithoutFeedback #js {}
:createNativeWrapper identity
:default #js {}})
:NativeViewGestureHandler #js {}
:FlatList #js {}
:ScrollView #js {}
:TouchableOpacity #js {}
:GestureDetector #js {}
:Gesture #js {:Pan nil}
:createNativeWrapper identity})
(def react-native-redash #js {:clamp nil})
+6 -6
View File
@@ -66,15 +66,15 @@
border-radius 8
haptic-type :selection}}
children]
(let [theme' (cond
disabled :disabled
:else theme)
(let [theme' (cond
disabled :disabled
:else theme)
{:keys [icon-color background-color text-color border-color]}
(themes theme')
optional-haptic (fn []
(when haptic-feedback
(haptic/trigger haptic-type)))]
optional-haptic (fn []
(when haptic-feedback
(haptic/trigger haptic-type)))]
[animation/pressable
(merge {:bg-color background-color
:border-radius border-radius
+18 -18
View File
@@ -14,24 +14,24 @@
(fn [props]
(let [{:keys [value onChange disabled]}
(bean/bean props)
state (animated/use-value 0)
tap-state (animated/use-value (:undetermined gh/states))
tap-handler (animated/on-gesture {:state tap-state})
hold (react/use-memo
(fn []
(animated/with-timing-transition
(animated/eq tap-state (:began gh/states))
{}))
[])
transition (react/use-memo
(fn []
(animated/with-spring-transition state
(:lazy
animated/springs)))
[])
press-end (fn []
(when (and (not disabled) onChange)
(onChange (not value))))]
state (animated/use-value 0)
tap-state (animated/use-value (:undetermined gh/states))
tap-handler (animated/on-gesture {:state tap-state})
hold (react/use-memo
(fn []
(animated/with-timing-transition
(animated/eq tap-state (:began gh/states))
{}))
[])
transition (react/use-memo
(fn []
(animated/with-spring-transition state
(:lazy
animated/springs)))
[])
press-end (fn []
(when (and (not disabled) onChange)
(onChange (not value))))]
(animated/code!
(fn []
(animated/cond* (animated/eq tap-state (:end gh/states))
+8 -8
View File
@@ -102,7 +102,7 @@
(into [rn/view {:style header-actions-style}]
(map header-action accessories))
component component
component component
:else
[rn/view {:style header-action-placeholder}])])
@@ -111,7 +111,7 @@
[{:keys [title subtitle component title-align]}]
[:<>
(cond
component component
component component
(and title subtitle)
[:<>
@@ -125,12 +125,12 @@
:number-of-lines 1}
subtitle]]
title [text/text
{:weight :bold
:number-of-lines 0
:align title-align
:size :large}
title])])
title [text/text
{:weight :bold
:number-of-lines 0
:align title-align
:size :large}
title])])
(defn header
[{:keys [left-width right-width]}]
+14 -14
View File
@@ -227,22 +227,22 @@
animated platform/ios?
active-background-enabled true
haptic-type :selection}}]
(let [theme (if disabled :disabled theme)
(let [theme (if disabled :disabled theme)
{:keys [text-color active-background passive-background]}
(themes theme)
icon-color (or icon-color
(:icon-color (themes theme)))
icon-bg-color (or icon-bg-color
(:icon-bg-color (themes theme)))
optional-haptic (fn []
(when haptic-feedback
(haptic/trigger haptic-type)))
component (cond
(and (not on-press)
(not on-long-press))
rn/view
animated animated/pressable
:else rn/touchable-highlight)]
icon-color (or icon-color
(:icon-color (themes theme)))
icon-bg-color (or icon-bg-color
(:icon-bg-color (themes theme)))
optional-haptic (fn []
(when haptic-feedback
(haptic/trigger haptic-type)))
component (cond
(and (not on-press)
(not on-long-press))
rn/view
animated animated/pressable
:else rn/touchable-highlight)]
[rn/view
{:background-color (cond (not= background-color nil)
background-color
+3 -6
View File
@@ -47,10 +47,7 @@
(into [component
(merge {:style (text-style props)}
(dissoc props
:style
:size
:weight
:color
:align
:animated?))]
:style :size
:weight :color
:align :animated?))]
(reagent/children this))))
+7 -10
View File
@@ -186,7 +186,7 @@
{:icon :main-icons/show
:on-press #(reset! visible true)}
:else after)
:else after)
secure (boolean (and secure-text-entry (not @visible))) ; must be a boolean to work on
; iOS
auto-complete (cond
@@ -259,15 +259,12 @@
(when (and platform/ios? (not after))
{:clear-button-mode :while-editing})
(dissoc props
:style
:keyboard-type
:on-focus
:on-blur
:secure-text-entry
:ref
:get-ref
:auto-correct
:auto-complete-type))]
:style
:keyboard-type :on-focus
:on-blur
:secure-text-entry
:ref :get-ref
:auto-correct :auto-complete-type))]
(when after
[accessory-element after])]
(when (and show-cancel
+3 -3
View File
@@ -61,9 +61,9 @@
:justify-content :center}
[quo/button
(merge (dissoc @state
:theme
:before
:after)
:theme
:before
:after)
{:on-press #(println "Hello world!")}
(when @theme
{:theme @theme})
+2 -2
View File
@@ -121,8 +121,8 @@
:property (:opacity layout-animation-properties)}}})
(defonce enable-layout-animations
(when platform/android?
(.setLayoutAnimationEnabledExperimental ^js ui-manager true)))
(when platform/android?
(.setLayoutAnimationEnabledExperimental ^js ui-manager true)))
(def activity-indicator (reagent/adapt-react-class (.-ActivityIndicator ^js rn)))
@@ -1,15 +1,16 @@
(ns quo2.components.animated-header-flatlist.view
(:require
[quo2.core :as quo]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
[react-native.fast-image :as fast-image]
[reagent.core :as reagent]
[quo2.foundations.colors :as colors]
[quo2.components.animated-header-flatlist.style :as style]
[oops.core :as oops]))
[quo2.core :as quo]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[quo2.foundations.colors :as colors]
[status-im.ui.components.fast-image :as fast-image]
[quo2.components.animated-header-flatlist.style :as style]
[oops.core :as oops]
[utils.re-frame :as rf]))
(def header-height 234)
(def cover-height 192)
@@ -50,8 +51,10 @@
[reanimated/view {:style (style/entity-picture size-animation)}
[display-picture-comp image-animation]]]))
(defn animated-header-list
[{:keys [header-comp main-comp back-button-on-press] :as parameters}]
[{:keys [header-comp main-comp] :as parameters}]
[safe-area/consumer
(fn [insets]
(let [window-height (:height (rn/get-window))
@@ -73,7 +76,7 @@
[rn/view {:style (style/container-view view-height)}
[rn/touchable-opacity
{:active-opacity 1
:on-press back-button-on-press
:on-press #(rf/dispatch [:navigate-back])
:style (style/button-container {:left 20})}
[quo/icon :i/arrow-left {:size 20 :color (colors/theme-colors colors/black colors/white)}]]
[rn/touchable-opacity
+105 -89
View File
@@ -1,5 +1,6 @@
(ns quo2.components.avatars.user-avatar
(:require [clojure.string :as string]
(:require [clojure.string :refer [blank? split upper-case]]
[quo2.components.icon :as icons]
[quo2.components.markdown.text :as text]
[quo2.foundations.colors :as colors]
[quo2.theme :refer [dark?]]
@@ -39,100 +40,115 @@
:font-size :label}})
(defn dot-indicator
[{:keys [size online? ring? dark?]}]
(let [dimensions (get-in sizes [size :status-indicator])
border-width (get-in sizes [size :status-indicator-border])
right (case size
:big 2
:medium 0
:small -2
0)
bottom (case size
:big (if ring? -1 2)
:medium (if ring? 0 -2)
:small -2
0)]
[rn/view
{:style {:background-color (if online?
colors/success-50
colors/neutral-40)
:width dimensions
:height dimensions
:border-width border-width
:border-radius dimensions
:border-color (if dark?
colors/neutral-100
colors/white)
:position :absolute
:bottom bottom
:right right}}]))
[size status-indicator? online? ring? dark?]
(when status-indicator?
(let [dimensions (get-in sizes [size :status-indicator])
border-width (get-in sizes [size :status-indicator-border])
right (case size
:big 2
:medium 0
:small -2
0)
bottom (case size
:big (if ring?
-1
2)
:medium (if ring?
0
-2)
:small (if ring?
-2
-2)
0)]
[rn/view
{:style {:background-color (if online?
colors/success-50
colors/neutral-40)
:width dimensions
:height dimensions
:border-width border-width
:border-radius dimensions
:border-color (if dark?
colors/neutral-100
colors/white)
:position :absolute
:bottom bottom
:right right}}])))
(defn initials-style
(defn container-styling
[inner-dimensions outer-dimensions]
{:position :absolute
:top (/ (- outer-dimensions inner-dimensions) 2)
:left (/ (- outer-dimensions inner-dimensions) 2)
:width inner-dimensions
:height inner-dimensions
:border-radius inner-dimensions
:justify-content :center
:align-items :center
:background-color (colors/custom-color-by-theme :turquoise 50 60)})
{:width inner-dimensions
:position :absolute
:top (/ (- outer-dimensions inner-dimensions) 2)
:left (/ (- outer-dimensions inner-dimensions) 2)
:height inner-dimensions
:border-radius inner-dimensions})
(defn outer-styles
[outer-dimensions]
{:width outer-dimensions
:height outer-dimensions
:border-radius outer-dimensions})
(defn container
[inner-dimensions outer-dimensions & children]
[rn/view
{:style (merge {:background-color (colors/custom-color-by-theme :turquoise 50 60)
:justify-content :center
:align-items :center}
(container-styling inner-dimensions outer-dimensions))}
children])
(def one-initial-letter-sizes #{:xs :xxs :xxxs})
(def valid-ring-sizes #{:big :medium :small})
(defn initials-avatar
[{:keys [full-name size inner-dimensions outer-dimensions]}]
(let [amount-initials (if (one-initial-letter-sizes size) 1 2)
initials (as-> full-name $
(string/split $ " ")
(map (comp string/upper-case first) $)
(take amount-initials $)
(string/join $))
font-size (get-in sizes [size :font-size])]
[rn/view {:style (initials-style inner-dimensions outer-dimensions)}
[text/text
{:style {:color colors/white-opa-70}
:weight :semi-bold
:size font-size}
initials]]))
(def small-sizes #{:xs :xxs :xxxs})
(def identicon-sizes #{:big :medium :small})
(defn user-avatar
"If no `profile-picture` is given, draws the initials based on the `full-name` and
uses `ring-background` to display the ring behind the initials when given. Otherwise,
shows the profile picture which already comes with the ring drawn over it."
[{:keys [full-name status-indicator? online? size profile-picture ring-background]
:or {status-indicator? true
[{:keys [ring?
online?
size
status-indicator?
profile-picture
full-name]
:or {full-name "empty name"
status-indicator? true
online? true
size :big}}]
(let [full-name (or full-name "empty name")
draw-ring? (and ring-background (valid-ring-sizes size))
outer-dimensions (get-in sizes [size :outer])
inner-dimensions (get-in sizes [size (if draw-ring? :inner :outer)])]
size :big
ring? true}}]
(let [initials (if full-name
(reduce str (map first (split full-name " ")))
"")
first-initial-letter (if full-name
(or (first full-name) "")
"")
identicon? (contains? identicon-sizes size)
small? (contains? small-sizes size)
outer-dimensions (get-in sizes [size :outer])
inner-dimensions (get-in sizes
[size
(if ring?
:inner
:outer)])
font-size (get-in sizes [size :font-size])
icon-text (if-not (or (blank? first-initial-letter)
(blank? initials))
(if small?
first-initial-letter
initials)
"")]
[rn/view
{:style (outer-styles outer-dimensions)
:accessibility-label :user-avatar}
;; The `profile-picture` already has the ring in it
(when-let [image (or profile-picture ring-background)]
{:accessibility-label :user-avatar
:style {:width outer-dimensions
:height outer-dimensions
:border-radius outer-dimensions}}
(when (and false (and ring? identicon?)) ;;TODO not implemented yet
[icons/icon :i/identicon-ring
{:size outer-dimensions
:no-color true}])
(if profile-picture
;; display image
[fast-image/fast-image
{:style (outer-styles outer-dimensions)
:source image}])
(when-not profile-picture
[initials-avatar
{:full-name full-name
:size size
:inner-dimensions inner-dimensions
:outer-dimensions outer-dimensions}])
(when status-indicator?
[dot-indicator
{:size size
:online? online?
:ring? draw-ring?
:dark? (dark?)}])]))
{:source profile-picture
:style (container-styling inner-dimensions outer-dimensions)}]
;; else display initials
[container inner-dimensions outer-dimensions
^{:key :icon-text}
[text/text
{:weight :semi-bold
:size font-size
:style {:color colors/white-opa-70}}
(upper-case icon-text)]])
[dot-indicator size status-indicator? online? ring? (dark?)]]))
+2 -2
View File
@@ -254,9 +254,9 @@
(shape-style-container type icon size)
{:background-color
(if (= state :pressed)
(colors/theme-colors colors/white colors/neutral-100)
(colors/theme-colors colors/neutral-100 colors/white)
:transparent)
:width width}
:width width}
style)}
[rn/view
{:style (merge
@@ -1,23 +0,0 @@
(ns quo2.components.colors.color-picker.component-spec
(:require [quo2.components.colors.color-picker.view :as color-picker]
[reagent.core :as reagent]
[test-helpers.component :as h]))
(h/describe "color-picker"
(h/test "color picker rendered"
(h/render [color-picker/view])
(-> (h/expect (h/get-all-by-label-text :color-picker-item))
(.toHaveLength 12)))
(h/test "clicks on a color item"
(let [event (h/mock-fn)]
(h/render [color-picker/view {:on-change #(event)}])
(h/fire-event :press (get (h/get-all-by-label-text :color-picker-item) 0))
(-> (h/expect event)
(.toHaveBeenCalled))))
(h/test "color picker color changed"
(let [selected (reagent/atom nil)]
(h/render [color-picker/view {:on-change #(reset! selected %)}])
(h/fire-event :press (get (h/get-all-by-label-text :color-picker-item) 0))
(-> (h/expect @selected)
(.toStrictEqual :blue)))))
@@ -1,48 +0,0 @@
(ns quo2.components.colors.color-picker.style
(:require [quo2.foundations.colors :as colors]))
(def color-picker-container
{:max-width 338
:flex-direction :row
:flex-wrap :wrap
:justify-content :space-between})
(def flex-break
{:flex-basis "100%"
:height 10})
(defn color-button
[color selected?]
(merge {:width 48
:height 48
:border-width 4
:border-radius 24
:transform [{:rotate "45deg"}]
:border-color :transparent}
(when selected?
{:border-top-color (colors/alpha color 0.4)
:border-end-color (colors/alpha color 0.4)
:border-bottom-color (colors/alpha color 0.2)
:border-start-color (colors/alpha color 0.2)})))
(defn color-circle
[color border?]
{:width 40
:height 40
:transform [{:rotate "-45deg"}]
:background-color color
:justify-content :center
:align-items :center
:border-color color
:border-width (if border? 2 0)
:overflow :hidden
:border-radius 20})
(defn secondary-overlay
[secondary-color border?]
{:width (if border? 18 20)
:height 40
:position :absolute
:right 0
:background-color secondary-color})
@@ -1,71 +0,0 @@
(ns quo2.components.colors.color-picker.view
(:require [react-native.core :as rn]
[quo2.foundations.colors :as colors]
[quo2.components.icon :as icon]
[reagent.core :as reagent]
[quo2.components.colors.color-picker.style :as style]))
(def color-list [:blue :yellow :turquoise :copper :sky :camel :orange :army :pink :purple :magenta])
(defn picker-colors
[blur?]
(concat (map (fn [color]
{:name color
:color (colors/custom-color-by-theme color (if blur? 60 50) 60)})
color-list)
[{:name :yinyang
:color (colors/theme-colors (colors/custom-color :yin 50)
(colors/custom-color :yang 50))
:secondary-color (colors/theme-colors (colors/custom-color :yang 50)
(colors/custom-color :yin 50))}]))
(defn- on-change-handler
[selected color-name on-change]
(reset! selected color-name)
(when on-change (on-change color-name)))
(defn- color-item
[{:keys [name
color
secondary-color
selected?
on-press
blur?]}]
(let [border? (and (not blur?) (and secondary-color (not selected?)))]
[rn/touchable-opacity
{:style (style/color-button color selected?)
:accessibility-label :color-picker-item
:on-press #(on-press name)}
[rn/view
{:style (style/color-circle color border?)}
(when (and secondary-color (not selected?))
[rn/view
{:style (style/secondary-overlay secondary-color border?)}])
(when selected?
[icon/icon :i/check
{:size 20
:color (or secondary-color
colors/white)}])]]))
(defn view
"Options
- `default-selected?` Default selected color name.
- `selected` Selected color name.
- `on-change` Callback called when a color is selected `(fn [color-name])`.
- `blur?` Boolean to enable blur background support.}"
[{:keys [default-selected?]}]
(let [internal-selected (reagent/atom default-selected?)]
(fn [{:keys [blur? on-change selected]}]
(when (and (not (nil? selected)) (not= @internal-selected selected))
(reset! internal-selected selected))
[rn/view {:style style/color-picker-container}
(doall (map-indexed (fn [index color]
[:<> {:key (color :name)}
[color-item
(merge color
{:selected? (= (color :name) @internal-selected)
:on-press #(on-change-handler internal-selected % on-change)
:blur? blur?})]
(when (= index 5) [rn/view {:style style/flex-break}])])
(picker-colors blur?)))])))
+23 -27
View File
@@ -90,36 +90,32 @@
(defn token-requirement-list
[props community-color]
(let [{:keys [gate token-requirements-changed?
required-tokens-lost?]} props
(let [{:keys [gate token-requirements-changed? required-tokens-lost?]} props
[gate-type token-requirement-lists] gate
multiple-token-requirements? (multiple-token-requirements? token-requirement-lists)
is-sufficient? (are-multiple-token-requirements-met?
token-requirement-lists)
you-must-hold-label (if (= gate-type :join)
(cond
token-requirements-changed? :t/you-must-now-hold
required-tokens-lost? :t/you-must-always-hold
:else :t/you-must-hold)
:t/you-must-hold)
message-label (cond
(= gate-type :join)
(cond
token-requirements-changed?
:t/community-join-requirements-changed
required-tokens-lost?
:t/community-join-requirements-tokens-lost
:else (if is-sufficient?
multiple-token-requirements? (multiple-token-requirements? token-requirement-lists)
is-sufficient? (are-multiple-token-requirements-met? token-requirement-lists)
you-must-hold-label (if (= gate-type :join)
(cond
token-requirements-changed? :t/you-must-now-hold
required-tokens-lost? :t/you-must-always-hold
:else :t/you-must-hold)
:t/you-must-hold)
message-label (cond
(= gate-type :join)
(cond
token-requirements-changed? :t/community-join-requirements-changed
required-tokens-lost? :t/community-join-requirements-tokens-lost
:else (if is-sufficient?
:t/community-join-requirements-met
:t/community-join-requirements-not-met))
(= gate-type :read)
(if is-sufficient?
:t/community-channel-read-requirements-met
:t/community-channel-read-requirements-not-met)
(= gate-type :write)
(if is-sufficient?
:t/community-channel-write-requirements-met
:t/community-channel-write-requirements-not-met))]
(= gate-type :read)
(if is-sufficient?
:t/community-channel-read-requirements-met
:t/community-channel-read-requirements-not-met)
(= gate-type :write)
(if is-sufficient?
:t/community-channel-write-requirements-met
:t/community-channel-write-requirements-not-met))]
[rn/view
[rn/view {:style (get styles :token-requirement-text-spacing)}
[text/text
@@ -1,38 +0,0 @@
(ns quo2.components.dividers.strength-divider.component-spec
(:require [quo2.components.dividers.strength-divider.view :as strength-divider]
[test-helpers.component :as h]))
(h/describe "select-profile component"
(h/test "render component"
(h/render [strength-divider/view {:type :okay}])
(-> (h/expect (h/get-by-label-text :strength-divider))
(.toBeTruthy)))
(h/test "render component with :type :very-weak"
(h/render [strength-divider/view {:type :very-weak}])
(-> (h/expect (h/get-by-translation-text :strength-divider-very-weak-label))
(.toBeTruthy)))
(h/test "render component with :type :weak"
(h/render [strength-divider/view {:type :weak}])
(-> (h/expect (h/get-by-translation-text :strength-divider-weak-label))
(.toBeTruthy)))
(h/test "render component with :type :okay"
(h/render [strength-divider/view {:type :okay}])
(-> (h/expect (h/get-by-translation-text :strength-divider-okay-label))
(.toBeTruthy)))
(h/test "render component with :type :strong"
(h/render [strength-divider/view {:type :strong}])
(-> (h/expect (h/get-by-translation-text :strength-divider-strong-label))
(.toBeTruthy)))
(h/test "render component with :type :very-strong"
(h/render [strength-divider/view {:type :very-strong}])
(-> (h/expect (h/get-by-translation-text :strength-divider-very-strong-label))
(.toBeTruthy)))
(h/test "render component with :type :alert"
(h/render [strength-divider/view {:type :alert} "Text message"])
(-> (h/expect (h/get-by-text "Text message"))
(.toBeTruthy)))
(h/test "render component with :type :info"
(h/render [strength-divider/view {:type :info} "Text Info"])
(-> (h/expect (h/get-by-text "Text Info"))
(.toBeTruthy))))
@@ -1,13 +0,0 @@
(ns quo2.components.dividers.strength-divider.style)
(def container
{:height 40
:flex-direction :row
:padding-horizontal 20
:align-items :center})
(defn text
[color]
{:color color
:margin-left 4})
@@ -1,85 +0,0 @@
(ns quo2.components.dividers.strength-divider.view
(:require [quo2.components.dividers.strength-divider.style :as style]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.linear-gradient :as linear-gradient]
[react-native.svg :as svg]
[utils.i18n :as i18n]))
(def strength-divider-types
{:very-weak {:default-text (i18n/label :t/strength-divider-very-weak-label)
:color colors/danger-60
:percentage 20}
:weak {:default-text (i18n/label :t/strength-divider-weak-label)
:color (colors/custom-color :orange 60)
:percentage 40}
:okay {:default-text (i18n/label :t/strength-divider-okay-label)
:color (colors/custom-color :yellow 60)
:percentage 60}
:strong {:default-text (i18n/label :t/strength-divider-strong-label)
:color colors/success-60
:percentage 80}
:very-strong {:default-text (i18n/label :t/strength-divider-very-strong-label)
:color colors/success-60
:percentage 100}
:info {:color colors/white-opa-40}
:alert {:color colors/danger-60}})
(defn circular-progress
[{:keys [color percentage]}]
(let [strength-indicator-radius 6.5
strength-indicator-circumference (* 2 Math/PI strength-indicator-radius)]
[svg/svg
{:view-box "0 0 16 16"
:width 14.2
:transform [{:rotate "270deg"}]
:height 14.2}
[svg/circle
{:cx 8
:cy 8
:r strength-indicator-radius
:fill :transparent
:stroke-width 1.2
:stroke (colors/alpha color 0.2)}]
[svg/circle
{:cx 8
:cy 8
:r strength-indicator-radius
:fill :transparent
:stroke-width 1.2
:stroke-dasharray strength-indicator-circumference
:stroke-dashoffset (* (- 100 percentage) 0.01 strength-indicator-circumference)
:stroke color}]
[svg/circle]]))
(defn strength-indicator
[type]
(let [{:keys [color percentage]} (strength-divider-types type)]
(case type
:info nil
:alert [icon/icon :i/alert
{:color color
:size 16}]
[circular-progress {:color color :percentage percentage}])))
(defn view
"Options
- `:type` `:very-weak`/`:weak`/`:okay`/`:strong`/`:very-strong`/`:info`/`:alert`)
`text` message string(only works when type is `info`/`alert`)"
[{:keys [type] :or {type :very-weak}} text]
(let [{:keys [color default-text]} (strength-divider-types type)]
[linear-gradient/linear-gradient
{:colors [(colors/alpha color 0.05) (colors/alpha color 0)]}
[rn/view
{:style style/container
:accessibility-label :strength-divider}
[strength-indicator type]
[text/text
{:size :paragraph-2
:weight :medium
:style (style/text color)}
(or default-text text)]]]))
@@ -6,10 +6,10 @@
[quo2.components.drawers.action-drawers.style :as style]))
(defn- get-icon-color
[danger? override-theme]
[danger?]
(if danger?
colors/danger-50
(colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)))
(colors/theme-colors colors/neutral-50 colors/neutral-40)))
(def divider
[rn/view
@@ -25,7 +25,6 @@
danger?
on-press
add-divider?
override-theme
accessibility-label]
:as action-props}]
(when action-props
@@ -34,7 +33,7 @@
[rn/touchable-highlight
{:accessibility-label accessibility-label
:style (style/container sub-label)
:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90 override-theme)
:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90)
:on-press on-press}
[rn/view
{:style (style/row-container sub-label)}
@@ -43,7 +42,7 @@
:accessible true
:style style/left-icon}
[icon/icon icon
{:color (get-icon-color danger? override-theme)
{:color (get-icon-color danger?)
:size 20}]]
[rn/view
{:style style/text-container}
@@ -51,15 +50,14 @@
{:size :paragraph-1
:weight :medium
:style {:color
(cond
danger? (colors/theme-colors colors/danger-50 colors/danger-60 override-theme)
:else (colors/theme-colors colors/neutral-100 colors/white override-theme))}}
(when danger?
(colors/theme-colors colors/danger-50 colors/danger-60))}}
label]
(when sub-label
[text/text
{:size :paragraph-2
:style {:color
(colors/theme-colors colors/neutral-50 colors/neutral-40 override-theme)}}
(colors/theme-colors colors/neutral-50 colors/neutral-40)}}
sub-label])]
(when right-icon
[rn/view
@@ -67,7 +65,7 @@
:accessible true
:accessibility-label :right-icon-for-action}
[icon/icon right-icon
{:color (get-icon-color danger? override-theme)
{:color (get-icon-color danger?)
:size 20}]])]]]))
(defn action-drawer
@@ -1,70 +0,0 @@
(ns quo2.components.drawers.drawer-buttons.component-spec
(:require [quo2.components.drawers.drawer-buttons.view :as drawer-buttons]
[react-native.core :as rn]
[test-helpers.component :as h]))
(h/describe "drawer-buttons"
(h/test "the top heading and subheading render"
(h/render [drawer-buttons/view
{:top-card {:heading :top-heading}
:bottom-card {:heading :bottom-heading}}
:top-sub-heading
:bottom-sub-heading])
(-> (js/expect (h/get-by-text "top-heading"))
(.toBeTruthy))
(-> (js/expect (h/get-by-text "top-sub-heading"))
(.toBeTruthy)))
(h/test "the bottom heading and subheading render"
(h/render [drawer-buttons/view
{:top-card {:heading :top-heading}
:bottom-card {:heading :bottom-heading}}
:top-sub-heading
:bottom-sub-heading])
(-> (js/expect (h/get-by-text "bottom-heading"))
(.toBeTruthy))
(-> (js/expect (h/get-by-text "bottom-sub-heading"))
(.toBeTruthy)))
(h/test "it clicks the top card"
(let [event (h/mock-fn)]
(h/render [drawer-buttons/view
{:top-card {:on-press event
:heading :top-heading}
:bottom-card {:heading :bottom-heading}}
:top-sub-heading
:bottom-sub-heading])
(h/fire-event :press (h/get-by-text "top-heading"))
(-> (js/expect event)
(.toHaveBeenCalled))))
(h/test "it clicks the bottom card"
(let [event (h/mock-fn)]
(h/render [drawer-buttons/view
{:top-card {:heading :top-heading}
:bottom-card {:on-press event
:heading :bottom-heading}}
:top-sub-heading
:bottom-sub-heading])
(h/fire-event :press (h/get-by-text "bottom-heading"))
(-> (js/expect event)
(.toHaveBeenCalled))))
(h/test "the top card child renders with a render prop"
(h/render [drawer-buttons/view
{:top-card {:heading :top-heading}
:bottom-card {:heading :bottom-heading}}
[rn/text :top-render-fn]
:bottom-sub-heading])
(-> (js/expect (h/get-by-text "top-render-fn"))
(.toBeTruthy)))
(h/test "the bottom card child renders with a render prop"
(h/render [drawer-buttons/view
{:top-card {:heading :top-heading}
:bottom-card {:heading :bottom-heading}}
:top-sub-heading
[rn/text :bottom-render-fn]])
(-> (js/expect (h/get-by-text "bottom-render-fn"))
(.toBeTruthy))))
@@ -1,48 +0,0 @@
(ns quo2.components.drawers.drawer-buttons.style
(:require [quo2.foundations.colors :as colors]))
(def outer-container {:height 216})
(def top-card
{:flex 1
:padding-vertical 12
:padding-horizontal 20
:border-radius 20
:background-color colors/neutral-80})
(def bottom-card
{:position :absolute
:top 80
:left 0
:right 0
:bottom 0
:padding-vertical 12
:padding-horizontal 20
:border-radius 20
:background-color (colors/alpha colors/white 0.05)})
(def bottom-container
{:flex-direction :row
:justify-content :space-between})
(def bottom-icon
{:border-radius 40
:border-width 1
:margin-left 24
:height 28
:width 28
:justify-content :center
:align-items :center
:border-color (colors/alpha colors/white 0.05)})
(def bottom-text
{:flex 1
:color (colors/alpha colors/white 0.7)})
(def top-text
{:color (colors/alpha colors/white 0.7)})
(defn heading-text
[gap]
{:color colors/white
:margin-bottom gap})
@@ -1,80 +0,0 @@
(ns quo2.components.drawers.drawer-buttons.view
(:require [react-native.core :as rn]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.foundations.colors :as colors]
[quo2.components.drawers.drawer-buttons.style :as style]))
(defn render-bottom
[children]
[rn/view {:style style/bottom-container}
children
[rn/view
{:style style/bottom-icon}
[icon/icon :arrow-right
{:color colors/white
:size 20}]]])
(defn label? [el] (or (string? el) (keyword? el)))
(defn render-children-bottom
[children]
(if (label? children)
[render-bottom
[text/text
{:size :paragraph-2
:style style/bottom-text
:weight :semi-bold}
children]]
[render-bottom children]))
(defn render-children-top
[children]
(if (label? children)
[text/text
{:size :paragraph-2
:style style/top-text
:weight :semi-bold}
children]
children))
(defn card
[{:keys [on-press style heading gap top?]} children]
[rn/touchable-highlight
{:on-press on-press
:border-radius 20
:style style
:underlay-color (:background-color style)}
[rn/view {}
[text/text
{:size :heading-1
:style (style/heading-text gap)
:weight :semi-bold}
heading]
(if top?
[render-children-top children]
[render-children-bottom children])]])
(defn view
"[view opts]
opts
{:container-style style-object
:top-card { :on-press event
:heading string}
:bottom-card { :on-press event
:heading string}}
child-1 string, keyword or hiccup
child-2 string, keyword or hiccup
"
[{:keys [container-style top-card bottom-card]} child-1 child-2]
[rn/view
{:style (merge container-style style/outer-container)}
[card
(merge {:gap 4
:top? true
:style style/top-card}
top-card) child-1]
[card
(merge {:style style/bottom-card
:gap 20}
bottom-card) child-2]])
+8 -8
View File
@@ -103,7 +103,7 @@
(into [rn/view {:style header-actions-style}]
(map header-action accessories))
component component
component component
:else
[rn/view {:style header-action-placeholder}])])
@@ -112,7 +112,7 @@
[{:keys [title subtitle component title-align]}]
[:<>
(cond
component component
component component
(and title subtitle)
[:<>
@@ -126,12 +126,12 @@
:number-of-lines 1}
subtitle]]
title [text/text
{:weight :bold
:number-of-lines 0
:align title-align
:size :large}
title])])
title [text/text
{:weight :bold
:number-of-lines 0
:align title-align
:size :large}
title])])
(defn header
[{:keys [left-width right-width]}]
+1 -1
View File
@@ -24,6 +24,6 @@
container-style)
:accessibility-label accessibility-label
:source (icons/icon-source (str (name icon-name) size))}])))
:source (icons/icon-source (str (name icon-name) size))}])))
(def icon (memoize memo-icon-fn))
@@ -1,66 +0,0 @@
(ns quo2.components.list-items.user-list
(:require [react-native.core :as rn]
[quo2.components.avatars.user-avatar :as user-avatar]
[quo2.components.markdown.text :as text]
[quo2.components.icon :as icons]
[quo2.foundations.colors :as colors]
[quo2.components.messages.author.view :as author]
[quo2.components.selectors.selectors :as selectors]))
(def container-style
{:margin-horizontal 8
:padding-vertical 8
:padding-horizontal 12
:border-radius 12
:flex 1
:flex-direction :row
:align-items :center})
(defn action-icon
[{:keys [type on-press on-check disabled? checked?]}]
[rn/touchable-opacity
{:on-press (when on-press on-press)
:style {:position :absolute :right 20}}
(case type
:options
[icons/icon :i/options
{:size 20
:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}]
:checkbox
[selectors/checkbox
{:checked? checked?
:accessibility-label :user-list-toggle-check
:disabled? disabled?
:on-change (when on-check on-check)}]
:close
[text/text "not implemented"]
[rn/view])])
(defn user-list
[{:keys [short-chat-key primary-name secondary-name photo-path online? contact? verified?
untrustworthy? on-press on-long-press accessory]}]
[rn/touchable-opacity
{:style container-style
:accessibility-label :user-list
:on-press (when on-press on-press)
:on-long-press (when on-long-press on-long-press)}
[user-avatar/user-avatar
{:full-name primary-name
:profile-picture photo-path
:status-indicator? true
:online? online?
:size :small}]
[rn/view {:style {:margin-left 8}}
[author/author
{:primary-name primary-name
:secondary-name secondary-name
:contact? contact?
:verified? verified?
:untrustworthy? untrustworthy?}]
(when short-chat-key
[text/text
{:size :paragraph-1
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}}
short-chat-key])]
(when accessory
[action-icon accessory])])
@@ -7,6 +7,14 @@
:flex-direction :row
:align-items :center})
(defn ens-text
[]
{:color (colors/theme-colors colors/neutral-100 colors/white)})
(defn nickname-text
[]
{:color (colors/theme-colors colors/neutral-100 colors/white)})
(def middle-dot-nickname
{:color colors/neutral-50
:margin-horizontal 4})
@@ -19,6 +27,12 @@
{:color colors/neutral-50
:margin-left 4})
(defn profile-name-text
[nickname?]
{:color (if nickname?
(colors/theme-colors colors/neutral-60 colors/neutral-40)
(colors/theme-colors colors/neutral-100 colors/white))})
(def icon-container
{:margin-left 4})
+81 -55
View File
@@ -3,71 +3,97 @@
[quo2.components.icon :as icons]
[quo2.components.markdown.text :as text]
[quo2.components.messages.author.style :as style]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]))
(def middle-dot "·")
(defn display-name
[{:keys [profile-name nickname ens-name text-style]}]
(let [ens? (-> ens-name string/blank? not)
nickname? (-> nickname string/blank? not)]
(if ens?
[text/text
(merge {:weight :semi-bold
:size :paragraph-2
:style (style/ens-text)}
text-style)
ens-name]
[:<>
(if nickname?
[text/text
(merge {:weight :semi-bold
:size :paragraph-2
:style (style/nickname-text)}
text-style)
nickname]
[text/text
(merge {:weight :semi-bold
:size :paragraph-2
:style (style/profile-name-text nickname?)}
text-style)
profile-name])])))
(defn author
[{:keys [primary-name secondary-name short-chat-key time-str contact? verified? untrustworthy?]}]
[{:keys [profile-name nickname short-chat-key ens-name time-str contact? verified? untrustworthy?]}]
[:f>
(fn []
[rn/view {:style style/container}
[:<>
[text/text
{:weight :semi-bold
:size :paragraph-2
:number-of-lines 1
:style {:color (colors/theme-colors colors/neutral-100 colors/white)}}
primary-name]
(when (not (string/blank? secondary-name))
[:<>
(let [ens? (-> ens-name string/blank? not)
nickname? (-> nickname string/blank? not)]
[rn/view {:style style/container}
(if ens?
[text/text
{:size :paragraph-2
:number-of-lines 1
:style style/middle-dot-nickname}
middle-dot]
{:weight :semi-bold
:size :paragraph-2
:style (style/ens-text)}
ens-name]
[:<>
(when nickname?
[:<>
[text/text
{:weight :semi-bold
:size :paragraph-2
:style (style/nickname-text)}
nickname]
[text/text
{:size :paragraph-2
:style style/middle-dot-nickname}
middle-dot]])
[text/text
{:weight (if nickname? :medium :semi-bold)
:size :paragraph-2
:style (style/profile-name-text nickname?)}
profile-name]])
(when contact?
[icons/icon :main-icons2/contact
{:size 12
:no-color true
:container-style style/icon-container}])
(cond
verified?
[icons/icon :main-icons2/verified
{:size 12
:no-color true
:container-style style/icon-container}]
untrustworthy?
[icons/icon :main-icons2/untrustworthy
{:size 12
:no-color true
:container-style style/icon-container}])
(when-not ens?
[text/text
{:weight :medium
:size :paragraph-2
:number-of-lines 1
:style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}}
secondary-name]])]
(when contact?
[icons/icon :main-icons2/contact
{:size 12
:no-color true
:container-style style/icon-container}])
(cond
verified?
[icons/icon :main-icons2/verified
{:size 12
:no-color true
:container-style style/icon-container}]
untrustworthy?
[icons/icon :main-icons2/untrustworthy
{:size 12
:no-color true
:container-style style/icon-container}])
(when (and (not verified?) short-chat-key)
[text/text
{:monospace true
:size :paragraph-2
:number-of-lines 1
:style style/chat-key-text}
short-chat-key])
(when (and (not verified?) time-str)
[text/text
{:monospace true
:size :paragraph-2
:number-of-lines 1
:style style/middle-dot-chat-key}
middle-dot])
(when time-str
{:monospace true
:size :paragraph-2
:style style/chat-key-text}
short-chat-key])
(when-not ens?
[text/text
{:monospace true
:size :paragraph-2
:style style/middle-dot-chat-key}
middle-dot])
[text/text
{:monospace true
:size :paragraph-2
:accessibility-label :message-timestamp
:number-of-lines 1
:style (style/time-text verified?)}
time-str])])])
:style (style/time-text ens?)}
time-str]]))])
@@ -173,7 +173,7 @@
(utils/truncate-str (:info content) 24)])]]]])
(defn system-message
[{:keys [type style non-pressable? animate-landing? labels on-long-press] :as message}]
[{:keys [type style non-pressable? animate-landing? labels] :as message}]
[:f>
(fn []
(let [sv-color (reanimated/use-shared-value
@@ -186,17 +186,16 @@
:linear
1000))
[reanimated/touchable-opacity
{:on-press #(when-not non-pressable?
(reanimated/set-shared-value sv-color (get-color :bg :pressed type)))
:on-long-press on-long-press
:style (reanimated/apply-animations-to-style
{:background-color sv-color}
(merge
{:flex-direction :row
:flex 1
:border-radius 16
:padding-vertical 9
:padding-horizontal 11
:background-color sv-color}
style))}
{:on-press #(when-not non-pressable?
(reanimated/set-shared-value sv-color (get-color :bg :pressed type)))
:style (reanimated/apply-animations-to-style
{:background-color sv-color}
(merge
{:flex-direction :row
:flex 1
:border-radius 16
:padding-vertical 9
:padding-horizontal 11
:background-color sv-color}
style))}
[sm-render message labels]]))])
@@ -216,7 +216,6 @@
;; iPhone 11 Pro's height in Figma divided by Component height 56/1125
:align-items :center
:padding-horizontal 20
:margin-top 44
:height 56
:justify-content :space-between}
page-nav-background-uri (assoc :background-color page-nav-color)
@@ -33,16 +33,25 @@
:padding-vertical 8
:background-color colors/white-opa-5})
(def footer-container
(def buttons-container
{:margin-top 12
:flex-direction :row})
:flex-direction :row
:align-items :flex-start})
(def status
{:margin-top 12
:align-items :flex-start
:flex 1})
(defn title
[]
{:color colors/white})
[replying?]
{:color colors/white
:flex-shrink 1
:max-width (when-not replying? "60%")})
(def timestamp
{:text-transform :none
:flex-grow 1
:margin-left 8
:color colors/neutral-40})
@@ -66,8 +75,3 @@
(def top-section-container
{:align-items :center
:flex-direction :row})
(def title-container
{:flex 1
:flex-direction :row
:align-items :center})
@@ -7,12 +7,19 @@
[quo2.components.notifications.activity-log.style :as style]
[quo2.components.tags.status-tags :as status-tags]
[quo2.foundations.colors :as colors]
[utils.i18n :as i18n]
[react-native.core :as rn]
[reagent.core :as reagent]))
[reagent.core :as reagent]
[utils.i18n :as i18n]))
(def ^:private max-reply-length
280)
(defn- valid-reply?
[reply]
(<= (count reply) max-reply-length))
(defn- activity-reply-text-input
[{:keys [on-update-reply max-reply-length valid-reply?]} reply-input]
[reply-input on-update-reply]
[rn/view
[rn/view
{:style {:margin-top 16
@@ -92,12 +99,44 @@
body]
body)])
(defn- activity-buttons
[button-1 button-2 replying? reply-input]
(let [size (if replying? 40 24)
common-style (when replying?
{:padding-vertical 9
:flex-grow 1
:flex-basis 0})]
[rn/view style/buttons-container
(when button-1
[button/button
(-> button-1
(assoc :size size)
(update :style merge common-style {:margin-right 8}))
(:label button-1)])
(when button-2
[button/button
(-> button-2
(assoc :size size)
(assoc :disabled (and replying? (not (valid-reply? @reply-input))))
(update :style merge common-style))
(:label button-2)])]))
(defn- activity-status
[status]
[rn/view
{:style style/status
:accessibility-label :activity-status}
[status-tags/status-tag
{:size :small
:label (:label status)
:status status}]])
(defn- activity-title
[title replying?]
[text/text
{:weight :semi-bold
:accessibility-label :activity-title
:style (style/title)
:style (style/title replying?)
:size (if replying? :heading-2 :paragraph-1)}
title])
@@ -116,42 +155,18 @@
:style style/unread-dot-container}
[rn/view {:style style/unread-dot}]])
(defmulti footer-item-view (fn [item _ _] (:type item)))
(defmethod footer-item-view :button
[{:keys [label subtype disable-when] :as button} replying? reply-input]
(let [size (if replying? 40 24)
common-style (when replying?
{:padding-vertical 9
:flex-grow 1
:flex-basis 0})]
[button/button
(-> button
(assoc :size size)
(assoc :type subtype)
(assoc :disabled (and replying? (disable-when @reply-input)))
(update :style merge common-style {:margin-right 8}))
label]))
(defmethod footer-item-view :status
[{:keys [label subtype]} _ _]
[status-tags/status-tag
{:size :small
:label label
:status {:type subtype}}])
(defn- footer
[_ _]
[_]
(let [reply-input (reagent/atom "")]
(fn [{:keys [replying? items] :as props}]
(fn [{:keys [replying? on-update-reply status button-1 button-2]}]
[:<>
(when replying?
[activity-reply-text-input props reply-input])
(when items
[rn/view style/footer-container
(for [{:keys [key] :as item} items]
^{:key key}
[footer-item-view item replying? reply-input])])])))
[activity-reply-text-input reply-input on-update-reply])
(cond (some? status)
[activity-status status]
(or button-1 button-2)
[activity-buttons button-1 button-2 replying? reply-input])])))
(defn view
[{:keys [icon
@@ -164,8 +179,7 @@
:as props}]
[rn/view
{:accessibility-label :activity
:style style/container
:on-layout (:on-layout props)}
:style style/container}
(when-not replying?
[activity-icon icon])
[rn/view
@@ -173,10 +187,9 @@
:flex 1}}
[rn/view
[rn/view {:style style/top-section-container}
[rn/view {:style style/title-container}
[activity-title title replying?]
(when-not replying?
[activity-timestamp timestamp])]
[activity-title title replying?]
(when-not replying?
[activity-timestamp timestamp])
(when (and unread? (not replying?))
[activity-unread-dot])]
(when context
@@ -45,8 +45,8 @@
:else 0))
(def ^:private themes
{:color {:dark colors/neutral-80-opa-40
:light colors/white-opa-40}})
{:color {:light colors/neutral-80-opa-40
:dark colors/white-opa-40}})
(defn circle-timer
[{:keys [color duration size stroke-width trail-color rotation initial-remaining-time]}]
+30 -64
View File
@@ -1,29 +1,25 @@
(ns quo2.components.notifications.toast
(:require [quo2.components.icon :as icon]
(:require [utils.i18n :as i18n]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.components.notifications.count-down-circle :as count-down-circle]
[quo2.foundations.colors :as colors]
[quo2.foundations.shadows :as shadows]
[quo2.theme :as theme]
[utils.i18n :as i18n]
[react-native.blur :as blur]
[react-native.core :as rn]))
(def ^:private themes
{:container {:dark {:background-color colors/white-opa-70}
:light {:background-color colors/neutral-80-opa-70}}
:title {:dark {:color colors/neutral-100}
:light {:color colors/white}}
:light {:background-color colors/neutral-80-opa-90}}
:text {:dark {:color colors/neutral-100}
:light {:color colors/white}}
:icon {:dark {:color colors/neutral-100}
:light {:color colors/white}}
:action-container {:dark {:background-color colors/neutral-80-opa-5}
:light {:background-color colors/white-opa-5}}})
:action-container {:dark {:background-color :colors/neutral-80-opa-5}
:light {:background-color :colors/white-opa-5}}})
(defn- merge-theme-style
[component-key styles override-theme]
(merge (get-in themes [component-key (or override-theme (theme/get-theme))]) styles))
[component-key styles]
(merge (get-in themes [component-key (theme/get-theme)]) styles))
(defn toast-action-container
[{:keys [on-press style]} & children]
@@ -45,78 +41,48 @@
children]])
(defn toast-undo-action
[duration on-press override-theme]
[duration on-press]
[toast-action-container
{:on-press on-press :accessibility-label :toast-undo-action}
[rn/view {:style {:margin-right 5}}
[count-down-circle/circle-timer {:duration duration}]]
[text/text
{:size :paragraph-2 :weight :medium :style (merge-theme-style :text {} override-theme)}
{:size :paragraph-2 :weight :medium :style (merge-theme-style :text {})}
[i18n/label :t/undo]]])
(defn- toast-container
[{:keys [left title text right container-style override-theme]}]
[rn/view
{:style (merge {:margin-horizontal 12
:border-radius 12
:overflow :hidden}
container-style)}
[blur/view
{:style {:height "100%"
:width "100%"
:position :absolute
:padding-vertical 8
:padding-left 10
:padding-right 8
:background-color :transparent}
:blur-amount 13
:blur-radius 10
:blur-type :transparent
:overlay-color :transparent}]
[{:keys [left middle right container-style]}]
[rn/view {:style (merge {:padding-left 12 :padding-right 12} container-style)}
[rn/view
{:style (merge-theme-style :container
(merge
(:shadow-1 shadows/normal-scale)
{:flex-direction :row
:justify-content :space-between
:padding-vertical 8
:padding-left 10
:padding-right 8
:border-radius 12})
override-theme)}
{:flex-direction :row
:width "100%"
:margin :auto
:justify-content :space-between
:padding-vertical 8
:padding-left 10
:padding-right 8
:border-radius 12})}
[rn/view {:style {:padding 2}} left]
[rn/view {:style {:padding 4 :flex 1}}
(when title
[text/text
{:size :paragraph-1
:weight :semi-bold
:style (merge-theme-style :title {} override-theme)
:accessibility-label :toast-title}
title])
(when text
[text/text
{:size :paragraph-2
:weight :medium
:style (merge-theme-style :text {} override-theme)
:accessibility-label :toast-content}
text])]
[text/text
{:size :paragraph-2
:weight :medium
:style (merge-theme-style :text {})
:accessibility-label :toast-content}
middle]]
(when right right)]])
(defn toast
[{:keys [icon icon-color title text action undo-duration undo-on-press container-style
override-theme]}]
[{:keys [icon icon-color text action undo-duration undo-on-press container-style]}]
[toast-container
{:left (when icon
[icon/icon icon
{:container-style {:width 20 :height 20}
:color (or icon-color
(get-in themes
[:icon (or override-theme (theme/get-theme))
:color]))}])
:title title
:text text
(get-in themes [:icon (theme/get-theme) :color]))}])
:middle text
:right (if undo-duration
[toast-undo-action undo-duration undo-on-press override-theme]
[toast-undo-action undo-duration undo-on-press]
action)
:container-style container-style
:override-theme override-theme}])
:container-style container-style}])
@@ -1,52 +0,0 @@
(ns quo2.components.onboarding.small-option-card.component-spec
(:require [quo2.components.onboarding.small-option-card.view :as small-option-card]
[test-helpers.component :as h]))
(defn- testing-small-option-card
[variant
{:keys [title subtitle image on-press]
:or {title "title" subtitle "subtitle"}}]
[small-option-card/small-option-card
{:variant variant
:title title
:subtitle subtitle
:image image
:on-press on-press}])
(h/describe "small-option-card"
(h/describe "Title & subtitle are rendered"
(let [title "A title"
subtitle "A subtitle"
component-props {:title title :subtitle subtitle}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(-> (h/get-by-text title) h/expect .toBeTruthy)
(-> (h/get-by-text subtitle) h/expect .toBeTruthy))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(-> (h/get-by-text title) h/expect .toBeTruthy)
(-> (h/get-by-text subtitle) h/expect .toBeTruthy))))
(h/describe "Card pressed"
(let [on-press-fn (h/mock-fn)
component-props {:on-press on-press-fn}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(h/fire-event :press (h/get-by-label-text :small-option-card))
(-> on-press-fn js/expect .toHaveBeenCalled))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(h/fire-event :press (h/get-by-label-text :small-option-card))
(-> on-press-fn js/expect .toHaveBeenCalled))))
(h/describe "Image rendered"
(let [component-props {:image nil}]
(h/test "`:main` variant"
(h/render (testing-small-option-card :main component-props))
(-> (h/get-by-label-text :small-option-card-main-image) h/expect .-not .toBeNull))
(h/test "`:icon` variant"
(h/render (testing-small-option-card :icon component-props))
(-> (h/get-by-label-text :small-option-card-icon-image) h/expect .-not .toBeNull)))))
@@ -1,52 +0,0 @@
(ns quo2.components.onboarding.small-option-card.style
(:require [quo2.foundations.colors :as colors]))
(def text-container {:flex 1})
(def title
{:color colors/white
:height 22})
(def subtitle
{:color colors/white-opa-70
:height 18})
(def icon-variant
{:flex-direction :row
:padding-vertical 8
:padding-horizontal 12})
(def icon-variant-image-container
{:width 32
:height 40
:justify-content :center
:align-items :center
:padding-vertical 4
:margin-right 8})
(def icon-variant-image
{:flex 1
:width 32
:height 32})
(def main-variant
{:flex 1
:margin-bottom -8})
(def main-variant-text-container
{:height 62
:padding-top 10
:padding-bottom 12
:padding-horizontal 12})
(def touchable-overlay {:border-radius 16})
(defn card-container
[main-variant?]
(when main-variant? {:height 343}))
(defn card
[main-variant?]
{:background-color colors/white-opa-5
:border-radius 16
:height (if main-variant? 335 56)})
@@ -1,66 +0,0 @@
(ns quo2.components.onboarding.small-option-card.view
(:require [quo2.components.markdown.text :as text]
[quo2.components.onboarding.small-option-card.style :as style]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.fast-image :as fast-image]))
(defn- texts
[{:keys [title subtitle]}]
[rn/view {:style style/text-container}
[text/text
{:style style/title
:size :paragraph-1
:weight :semi-bold
:number-of-lines 1}
title]
[text/text
{:style style/subtitle
:size :paragraph-2
:weight :regular
:number-of-lines 1}
subtitle]])
(defn- icon-variant
[{:keys [title subtitle image]}]
[rn/view {:style style/icon-variant}
[rn/view {:style style/icon-variant-image-container}
[fast-image/fast-image
{:accessibility-label :small-option-card-icon-image
:style style/icon-variant-image
:resize-mode :contain
:source image}]]
[texts
{:title title
:subtitle subtitle}]])
(defn- main-variant
[{:keys [title subtitle image]}]
[rn/view {:style style/main-variant}
[rn/view {:style style/main-variant-text-container}
[texts
{:title title
:subtitle subtitle}]]
[fast-image/fast-image
{:accessibility-label :small-option-card-main-image
:style {:flex 1}
:resize-mode :contain
:source image}]])
(defn small-option-card
[{:keys [variant title subtitle image on-press]
:or {variant :main}}]
(let [main-variant? (= variant :main)
card-component (if main-variant? main-variant icon-variant)]
[rn/touchable-highlight
{:accessibility-label :small-option-card
:style style/touchable-overlay
:active-opacity 1
:underlay-color colors/white-opa-5
:on-press on-press}
[rn/view {:style (style/card-container main-variant?)}
[rn/view {:style (style/card main-variant?)}
[card-component
{:title title
:subtitle subtitle
:image image}]]]]))
@@ -1,20 +0,0 @@
(ns quo2.components.password.tips.component-spec
(:require [quo2.components.password.tips.view :as quo]
[test-helpers.component :as h]))
(h/describe "password tips component"
(h/test "render component"
(h/render [quo/view])
(-> (h/expect (h/get-by-label-text :password-tips))
(.toBeTruthy)))
(h/test "render component with proper text"
(h/render [quo/view {:completed? false} "Upper case"])
(-> (h/expect (h/get-by-text "Upper case"))
(.toBeTruthy)))
(h/test "render component with completed proper text & completed state"
(h/render [quo/view {:completed? true} "Numbers"])
(-> (h/expect (h/get-by-text "Numbers"))
(.toBeTruthy))
(-> (h/expect (h/get-by-label-text :password-tips-completed))
(.toBeTruthy))))
@@ -1,18 +0,0 @@
(ns quo2.components.password.tips.style
(:require [quo2.foundations.colors :as colors]))
(def container
{:align-self :flex-start})
(defn tip-text
[completed?]
{:color (if completed? colors/white-opa-40 colors/white-opa-70)})
(def strike-through
{:position :absolute
:background-color colors/white
:top 10
:left 0
:right 0
:height 0.8})
@@ -1,24 +0,0 @@
(ns quo2.components.password.tips.view
(:require [react-native.core :as rn]
[quo2.components.password.tips.style :as style]
[quo2.components.markdown.text :as text]))
(defn view
"Options
- `completed?` Password tip state
`text` Password tip string
"
[{:keys [completed?]} text]
[rn/view
{:style style/container
:accessibility-label :password-tips}
[text/text
{:style (style/tip-text completed?)
:weight :regular
:size :paragraph-2} text]
(when completed?
[rn/view
{:style style/strike-through
:accessibility-label :password-tips-completed}])])
@@ -1,12 +1,12 @@
(ns quo2.components.profile.profile-card.view
(:require
[quo2.components.profile.profile-card.style :as style]
[quo2.foundations.colors :as colors]
[quo2.components.avatars.user-avatar :as user-avatar]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.components.buttons.button :as button]
[react-native.core :as rn]))
[quo2.components.profile.profile-card.style :as style]
[quo2.foundations.colors :as colors]
[quo2.components.avatars.user-avatar :as user-avatar]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.components.buttons.button :as button]
[react-native.core :as rn]))
(defn profile-card
@@ -25,7 +25,8 @@
:profile-picture profile-picture
:override-theme :dark
:size :medium
:status-indicator? false}]
:status-indicator? false
:ring? true}]
[button/button
{:size 32
:type :blur-bg
@@ -1,16 +0,0 @@
(ns quo2.components.profile.select-profile.component-spec
(:require [quo2.components.profile.select-profile.view :as select-profile]
[test-helpers.component :as h]))
(h/describe "select-profile component"
(h/test "render component"
(h/render [select-profile/view])
(-> (h/expect (h/get-by-label-text :select-profile))
(.toBeTruthy)))
(h/test "call on-change handler when clicked"
(let [on-change (h/mock-fn)]
(h/render [select-profile/view {:on-change on-change}])
(h/fire-event :on-press (h/get-by-label-text :select-profile))
(-> (h/expect on-change)
(.toHaveBeenCalledTimes 1)))))
@@ -1,37 +0,0 @@
(ns quo2.components.profile.select-profile.style
(:require [quo2.foundations.colors :as colors]))
(defn container
[customization-color selected?]
{:padding 12
:background-color (colors/custom-color customization-color 50 40)
:border-width 1
:border-radius 16
:flex 1
:border-color (if selected? colors/white-opa-40 :transparent)})
(def header
{:flex-direction :row
:justify-content :space-between})
(def profile-name
{:margin-top 8
:color colors/white})
(defn select-radio
[selected?]
{:background-color (if selected? :transparent colors/white-opa-5)
:border-width 1.2
:width 20
:height 20
:border-radius 10
:justify-content :center
:align-items :center
:border-color (if selected? colors/white colors/white-opa-40)})
(def select-radio-inner
{:background-color colors/white
:border-radius 7
:width 14
:height 14})
@@ -1,54 +0,0 @@
(ns quo2.components.profile.select-profile.view
(:require
[quo2.components.profile.select-profile.style :as style]
[react-native.core :as rn]
[quo2.components.markdown.text :as text]
[quo2.components.avatars.user-avatar :as user-avatar]
[reagent.core :as reagent]))
(defn- on-change-handler
[selected? on-change]
(swap! selected? not)
(when on-change (on-change @selected?)))
(defn view
"Options
- `default-selected?` The default selected state. Use when the component is not controlled.
- `selected?` Selected state. Use when the component is controlled.
- `name` Full name
- `profile-picture` Profile picture
- `customization-color` Customization color
- `(on-change selected?)` On change event handler
"
[{:keys [default-selected?]}]
(let [internal-selected? (reagent/atom (or default-selected? false))]
(fn [{:keys [selected?
profile-picture
ring-background
name
customization-color
on-change]
:or {customization-color :turquoise}}]
(let [avatar-image-key (if profile-picture :profile-picture :ring-background)
picture (or profile-picture ring-background)]
(when (and (not (nil? selected?)) (not= @internal-selected? selected?))
(reset! internal-selected? selected?))
[rn/touchable-opacity
{:style (style/container customization-color @internal-selected?)
:on-press #(on-change-handler internal-selected? on-change)
:active-opacity 1
:accessibility-label :select-profile}
[rn/view {:style style/header}
[user-avatar/user-avatar
{:full-name name
:status-indicator? false
:size :medium
avatar-image-key picture}]
[rn/view {:style (style/select-radio @internal-selected?)}
(when @internal-selected? [rn/view {:style style/select-radio-inner}])]]
[text/text
{:size :heading-2
:weight :semi-bold
:style style/profile-name}
name]]))))
@@ -1,6 +1,6 @@
(ns quo2.components.record-audio.record-audio.--tests--.record-audio-component-spec
(:require [quo2.components.record-audio.record-audio.view :as record-audio]
[react-native.audio-toolkit :as audio]
[status-im.audio.core :as audio]
[test-helpers.component :as h]))
(h/describe "record audio component"
@@ -20,9 +20,7 @@
(h/test "record-audio on-start-recording works"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-start-recording event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-start-recording event}])
(h/fire-event
:on-start-should-set-responder
(h/get-by-test-id "record-audio")
@@ -33,9 +31,7 @@
(h/test "record-audio on-reviewing-audio works"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-reviewing-audio event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-reviewing-audio event}])
(with-redefs [audio/start-recording (fn [_ on-start _]
(on-start))]
(h/fire-event
@@ -54,9 +50,7 @@
(h/test "record-audio on-send works after reviewing audio"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-send event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-send event}])
(with-redefs [audio/start-recording (fn [_ on-start _]
(on-start))
audio/get-recorder-file-path (fn [] "audio-file-path")]
@@ -83,9 +77,7 @@
(h/test "record-audio on-send works after sliding to the send button"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-send event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-send event}])
(with-redefs [audio/start-recording (fn [_ on-start _]
(on-start))
audio/stop-recording (fn [_ on-stop _]
@@ -116,9 +108,7 @@
(h/test "record-audio on-cancel works after reviewing audio"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-cancel event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-cancel event}])
(with-redefs [audio/start-recording (fn [_ on-start _]
(on-start))]
(h/fire-event
@@ -142,9 +132,7 @@
(h/test "cord-audio on-cancel works after sliding to the cancel button"
(let [event (js/jest.fn)]
(h/render [record-audio/record-audio
{:on-cancel event
:record-audio-permission-granted true}])
(h/render [record-audio/record-audio {:on-cancel event}])
(with-redefs [audio/start-recording (fn [_ on-start _]
(on-start))
audio/stop-recording (fn [_ on-stop _]
@@ -4,7 +4,7 @@
[quo2.foundations.colors :as colors]
[react-native.core :as rn :refer [use-effect]]
[react-native.reanimated :as reanimated]
[react-native.audio-toolkit :as audio]
[status-im.audio.core :as audio]
[taoensso.timbre :as log]
[cljs-bean.core :as bean]
[reagent.core :as reagent]
@@ -71,7 +71,7 @@
(cond
@ready-to-send?
(start-y-animation)
@recording? (reset-y-animation)))
@recording? (reset-y-animation)))
[@ready-to-send?])
[:<>
[reanimated/view {:style (style/send-button-container opacity)}
@@ -1,14 +1,19 @@
(ns quo2.components.record-audio.record-audio.view
(:require [oops.core :as oops]
(:require [cljs-bean.core :as bean]
[oops.core :as oops]
[quo2.components.icon :as icons]
[quo2.components.record-audio.record-audio.style :as style]
[quo2.foundations.colors :as colors]
[quo2.components.record-audio.soundtrack.view :as soundtrack]
[react-native.core :as rn :refer [use-effect]]
[reagent.core :as reagent]
[status-im.utils.utils :as utils]
[quo2.components.markdown.text :as text]
[goog.string :as gstring]
[react-native.audio-toolkit :as audio]
[status-im.audio.core :as audio]
[utils.re-frame :as rf]
[utils.i18n :as i18n]
[react-native.permissions :as permissions]
[taoensso.timbre :as log]
[quo2.components.record-audio.record-audio.buttons.record-button-big :as record-button-big]
[quo2.components.record-audio.record-audio.buttons.send-button :as send-button]
@@ -149,31 +154,51 @@
{:color (colors/theme-colors colors/neutral-100 colors/white)}]]))])
(defn view
[{:keys [on-start-recording on-send on-cancel on-reviewing-audio record-audio-permission-granted
on-request-record-audio-permission on-check-audio-permissions]}]
[{:keys [on-start-recording on-send on-cancel on-reviewing-audio]}]
[:f>
(fn []
(let [recording? (reagent/atom false)
locked? (reagent/atom false)
ready-to-send? (reagent/atom false)
ready-to-lock? (reagent/atom false)
ready-to-delete? (reagent/atom false)
reviewing-audio? (reagent/atom false)
playing-audio? (reagent/atom false)
recording-length-ms (reagent/atom 0)
audio-current-time-ms (reagent/atom 0)
seeking-audio? (reagent/atom false)
clear-timeout (atom nil)
(let [recording? (reagent/atom false)
locked? (reagent/atom false)
ready-to-send? (reagent/atom false)
ready-to-lock? (reagent/atom false)
ready-to-delete? (reagent/atom false)
reviewing-audio? (reagent/atom false)
playing-audio? (reagent/atom false)
recording-length-ms (reagent/atom 0)
audio-current-time-ms (reagent/atom 0)
seeking-audio? (reagent/atom false)
clear-timeout (atom nil)
record-button-at-initial-position? (atom true)
record-button-is-animating? (atom false)
idle? (atom false)
touch-active? (atom false)
recording-timer (atom nil)
playing-timer (atom nil)
recorder-ref (atom nil)
player-ref (atom nil)
output-file (atom nil)
reached-max-duration? (atom false)
record-button-is-animating? (atom false)
idle? (atom false)
touch-active? (atom false)
recording-timer (atom nil)
playing-timer (atom nil)
recorder-ref (atom nil)
player-ref (atom nil)
record-audio-permission-granted (atom true)
output-file (atom nil)
reached-max-duration? (atom false)
check-audio-permission
(fn []
(permissions/permission-granted?
:record-audio
#(reset! record-audio-permission-granted %)
#(reset! record-audio-permission-granted false)))
request-record-audio-permission
(fn []
(rf/dispatch
[:request-permissions
{:permissions [:record-audio]
:on-allowed
#(reset! record-audio-permission-granted true)
:on-denied
#(js/setTimeout
(fn []
(utils/show-popup
(i18n/label :t/audio-recorder-error)
(i18n/label :t/audio-recorder-permissions-error)))
50)}]))
destroy-player
(fn []
(audio/destroy-player @player-ref)
@@ -222,7 +247,7 @@
:ignore-max-x? false}
record-button-area)]
(when-not @reviewing-audio?
(if record-audio-permission-granted
(if @record-audio-permission-granted
(do
(when (not @idle?)
(reset! recording? pressed-record-button?))
@@ -269,8 +294,8 @@
#(log/error "[record-audio] start recording - error: " %))
(when on-start-recording
(on-start-recording))))
(some-> on-request-record-audio-permission)))
(when record-audio-permission-granted
(request-record-audio-permission)))
(when @record-audio-permission-granted
(reset! touch-active? true))))
(not @idle?))
on-responder-move
@@ -444,7 +469,7 @@
(reset! reached-max-duration? false)))]
(fn []
(use-effect (fn []
(some-> on-check-audio-permissions)
(check-audio-permission)
(reload-recorder)))
[rn/view
{:style style/bar-container}
@@ -490,4 +515,14 @@
on-cancel]
[record-button/record-button recording? reviewing-audio?]]])))])
(def record-audio view)
(def record-audio
(reagent/adapt-react-class
(rn/memo
(fn [props]
(let [{:keys [onStartRecording onReviewingAudio onSend onCancel]} (bean/bean props)]
(reagent/as-element
[view
{:on-start-recording onStartRecording
:on-reviewing-audio onReviewingAudio
:on-send onSend
:on-cancel onCancel}]))))))
@@ -2,7 +2,7 @@
(:require [quo2.components.record-audio.soundtrack.view :as soundtrack]
[test-helpers.component :as h]
[reagent.core :as reagent]
[react-native.audio-toolkit :as audio]))
[status-im.audio.core :as audio]))
(h/describe "soundtrack component"
(h/before-each
@@ -1,7 +1,7 @@
(ns quo2.components.record-audio.soundtrack.view
(:require [quo2.components.record-audio.soundtrack.style :as style]
[quo2.foundations.colors :as colors]
[react-native.audio-toolkit :as audio]
[status-im.audio.core :as audio]
[taoensso.timbre :as log]
[react-native.platform :as platform]
[react-native.slider :as slider]))
+7 -7
View File
@@ -145,12 +145,12 @@
[rn/flat-list
(merge
(dissoc props
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= @active-tab-id (:id %)) data)})
{:ref #(reset! flat-list-ref %)
@@ -159,7 +159,7 @@
;; {:overflow :visible} doesn't work on components inheriting
;; from ScrollView (e.g. FlatList). There are open issues, here's
;; just one about this topic:
;; https://github.com/facebook/react-native/issues/31218
;; https://github.com/facebook/react-native/issues/3121
:content-container-style {:padding-top (dec unread-count-offset)}
:extra-data (str @active-tab-id)
:horizontal true
+10 -6
View File
@@ -12,7 +12,7 @@
(def small-container-style
(merge default-container-style
{:padding-horizontal 8
:padding-vertical 1}))
:padding-vertical 3}))
(def large-container-style
(merge default-container-style
@@ -56,8 +56,8 @@
[size theme label]
[base-tag
{:size size
:icon :verified
:background-color colors/success-50-opa-10
:icon :verified
:border-color colors/success-50-opa-20
:label label
:text-color (if (= theme :light)
@@ -77,14 +77,18 @@
colors/danger-60)}])
(defn- pending
[size _ label]
[size theme label]
[base-tag
{:size size
:icon :pending
:label label
:background-color colors/white-opa-5
:border-color colors/white-opa-5
:text-color colors/white-opa-70}])
:background-color (if (= theme :light)
colors/neutral-10
colors/neutral-80)
:border-color (if (= theme :light)
colors/neutral-20
colors/neutral-70)
:text-color colors/neutral-50}])
(defn status-tag
[{:keys [status size override-theme label]}]
+3 -3
View File
@@ -85,9 +85,9 @@
(fn [{:keys [id on-press disabled? size resource active accessibility-label
label type labelled? blurred? icon-color]
:or {size 32}}]
(let [state (cond disabled? :disabled
active :active
:else :default)
(let [state (cond disabled? :disabled
active :active
:else :default)
{:keys [border-color blurred-border-color text-color]}
(get-in themes [(theme/get-theme) state])]
[rn/view {:style {:align-items :center}}
+6 -6
View File
@@ -95,12 +95,12 @@
[rn/flat-list
(merge
(dissoc props
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)
:default-active
:fade-end-percentage
:fade-end?
:on-change
:scroll-on-press?
:size)
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= @active-tab-id (:id %)) data)})
{:ref #(reset! flat-list-ref %)
+4 -4
View File
@@ -57,11 +57,11 @@
:margin-right (get-value-from-size size 8 6)}
token-img-style)}]
[text/text
{:weight :medium
{:weight :medium
:number-of-lines 1
:style
{:margin-right (get-value-from-size size 12 11)}
:size (get-value-from-size size :paragraph-2 :label)} label]
:size (get-value-from-size size :paragraph-2 :label)} label]
overlay]]))
(defn token-tag
@@ -82,9 +82,9 @@
{size :small border-color (colors/custom-color-by-theme :purple 50 60)}}]
[tag
{:size size
{:size size
:token-img-src token-img-src
:border-color (when is-required border-color)
:border-color (when is-required border-color)
:overlay
(when (or is-required is-purchasable)
[rn/view
+58 -78
View File
@@ -1,70 +1,63 @@
(ns quo2.core
(:refer-clojure :exclude [filter])
(:require
quo2.components.avatars.account-avatar
quo2.components.avatars.channel-avatar
quo2.components.avatars.group-avatar
quo2.components.avatars.icon-avatar
quo2.components.avatars.user-avatar
quo2.components.avatars.wallet-user-avatar
quo2.components.banners.banner.view
quo2.components.buttons.button
quo2.components.buttons.dynamic-button
quo2.components.colors.color-picker.view
quo2.components.community.community-card-view
quo2.components.community.community-list-view
quo2.components.community.community-view
quo2.components.community.discover-card
quo2.components.community.icon
quo2.components.community.token-gating
quo2.components.counter.counter
quo2.components.dividers.date
quo2.components.dividers.divider-label
quo2.components.dividers.new-messages
quo2.components.dividers.strength-divider.view
quo2.components.drawers.action-drawers.view
quo2.components.drawers.drawer-buttons.view
quo2.components.drawers.permission-context.view
quo2.components.dropdowns.dropdown
quo2.components.header
quo2.components.icon
quo2.components.info.info-message
quo2.components.info.information-box
quo2.components.list-items.channel
quo2.components.list-items.menu-item
quo2.components.list-items.preview-list
quo2.components.loaders.skeleton
quo2.components.markdown.text
quo2.components.messages.author.view
quo2.components.messages.gap
quo2.components.messages.system-message
quo2.components.navigation.floating-shell-button
quo2.components.navigation.page-nav
quo2.components.notifications.activity-log.view
quo2.components.notifications.count-down-circle
quo2.components.notifications.info-count
quo2.components.notifications.notification-dot
quo2.components.notifications.toast
quo2.components.password.tips.view
quo2.components.profile.profile-card.view
quo2.components.profile.select-profile.view
quo2.components.reactions.reaction
quo2.components.selectors.disclaimer.view
quo2.components.selectors.filter.view
quo2.components.selectors.selectors
quo2.components.separator
quo2.components.settings.accounts.view
quo2.components.settings.privacy-option
quo2.components.onboarding.small-option-card.view
quo2.components.tabs.account-selector
quo2.components.tabs.tabs
quo2.components.tags.context-tags
quo2.components.tags.status-tags
quo2.components.tags.permission-tag
quo2.components.tags.tag
quo2.components.tags.tags
quo2.components.tags.token-tag
quo2.components.list-items.user-list))
quo2.components.avatars.account-avatar
quo2.components.avatars.channel-avatar
quo2.components.avatars.group-avatar
quo2.components.avatars.icon-avatar
quo2.components.avatars.user-avatar
quo2.components.avatars.wallet-user-avatar
quo2.components.banners.banner.view
quo2.components.buttons.button
quo2.components.buttons.dynamic-button
quo2.components.community.community-card-view
quo2.components.community.community-list-view
quo2.components.community.community-view
quo2.components.community.discover-card
quo2.components.community.icon
quo2.components.community.token-gating
quo2.components.counter.counter
quo2.components.dividers.date
quo2.components.dividers.divider-label
quo2.components.dividers.new-messages
quo2.components.drawers.action-drawers.view
quo2.components.drawers.permission-context.view
quo2.components.dropdowns.dropdown
quo2.components.header
quo2.components.icon
quo2.components.info.info-message
quo2.components.info.information-box
quo2.components.list-items.channel
quo2.components.list-items.menu-item
quo2.components.list-items.preview-list
quo2.components.loaders.skeleton
quo2.components.markdown.text
quo2.components.messages.author.view
quo2.components.messages.gap
quo2.components.messages.system-message
quo2.components.navigation.floating-shell-button
quo2.components.navigation.page-nav
quo2.components.notifications.activity-log.view
quo2.components.notifications.count-down-circle
quo2.components.notifications.info-count
quo2.components.notifications.notification-dot
quo2.components.notifications.toast
quo2.components.profile.profile-card.view
quo2.components.reactions.reaction
quo2.components.selectors.disclaimer.view
quo2.components.selectors.filter.view
quo2.components.selectors.selectors
quo2.components.separator
quo2.components.settings.accounts.view
quo2.components.settings.privacy-option
quo2.components.tabs.account-selector
quo2.components.tabs.tabs
quo2.components.tags.context-tags
quo2.components.tags.status-tags
quo2.components.tags.permission-tag
quo2.components.tags.tag
quo2.components.tags.tags
quo2.components.tags.token-tag))
(def toast quo2.components.notifications.toast/toast)
(def button quo2.components.buttons.button/button)
@@ -95,6 +88,7 @@
(def filter quo2.components.selectors.filter.view/view)
(def skeleton quo2.components.loaders.skeleton/skeleton)
(def author quo2.components.messages.author.view/author)
(def display-name quo2.components.messages.author.view/display-name)
;;;; AVATAR
(def account-avatar quo2.components.avatars.account-avatar/account-avatar)
@@ -107,13 +101,6 @@
;;;; BANNER
(def banner quo2.components.banners.banner.view/banner)
;;;; CARDS
(def small-option-card quo2.components.onboarding.small-option-card.view/small-option-card)
;;;; COLORS
(def color-picker quo2.components.colors.color-picker.view/view)
(def picker-colors quo2.components.colors.color-picker.view/picker-colors)
;;;; COMMUNITY
(def community-card-view-item quo2.components.community.community-card-view/community-card-view-item)
(def communities-list-view-item quo2.components.community.community-list-view/communities-list-view-item)
@@ -132,18 +119,15 @@
(def divider-label quo2.components.dividers.divider-label/divider-label)
(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)
;;;; DRAWERS
(def action-drawer quo2.components.drawers.action-drawers.view/action-drawer)
(def drawer-buttons quo2.components.drawers.drawer-buttons.view/view)
(def permission-context quo2.components.drawers.permission-context.view/view)
;;;; LIST ITEMS
(def channel-list-item quo2.components.list-items.channel/list-item)
(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)
;;;; NOTIFICATIONS
(def activity-log quo2.components.notifications.activity-log.view/view)
@@ -151,12 +135,8 @@
(def notification-dot quo2.components.notifications.notification-dot/notification-dot)
(def count-down-circle quo2.components.notifications.count-down-circle/circle-timer)
;;;; PASSWORD
(def tips quo2.components.password.tips.view/view)
;;;; PROFILE
(def profile-card quo2.components.profile.profile-card.view/profile-card)
(def select-profile quo2.components.profile.select-profile.view/view)
;;;; SETTINGS
(def privacy-option quo2.components.settings.privacy-option/card)
+3 -9
View File
@@ -3,16 +3,10 @@
[quo2.components.buttons.--tests--.buttons-component-spec]
[quo2.components.counter.--tests--.counter-component-spec]
[quo2.components.dividers.--tests--.divider-label-component-spec]
[quo2.components.dividers.strength-divider.component-spec]
[quo2.components.drawers.action-drawers.component-spec]
[quo2.components.drawers.drawer-buttons.component-spec]
[quo2.components.drawers.permission-context.component-spec]
[quo2.components.colors.color-picker.component-spec]
[quo2.components.markdown.--tests--.text-component-spec]
[quo2.components.onboarding.small-option-card.component-spec]
[quo2.components.password.tips.component-spec]
[quo2.components.record-audio.record-audio.--tests--.record-audio-component-spec]
[quo2.components.record-audio.soundtrack.--tests--.soundtrack-component-spec]
[quo2.components.profile.select-profile.component-spec]
[quo2.components.selectors.--tests--.selectors-component-spec]
[quo2.components.selectors.filter.component-spec]))
[quo2.components.selectors.filter.component-spec]
[quo2.components.record-audio.record-audio.--tests--.record-audio-component-spec]
[quo2.components.record-audio.soundtrack.--tests--.soundtrack-component-spec]))
+13 -27
View File
@@ -168,42 +168,28 @@
;; Colors for customizing profiles and communities themes
(def customization
{:primary {50 primary-50 ;; User can also use primary color as customisation color
{:primary {50 primary-50 ;; User can also use primary color as customisation color
60 primary-60}
:purple {50 "#7140FD"
60 "#5A33CA"}
:purple {50 "#8661C1"
60 "#5E478C"}
:indigo {50 "#496289"
60 "#3D5273"}
:turquoise {50 "#2A799B"
60 "#22617C"}
:blue {50 "#2A4AF5"
60 "#223BC4"}
:turquoise {50 "#448EA2"
60 "#397788"}
:blue {50 "#4CB4EF"
60 "#4097C9"}
:green {50 "#5BCC95"
60 "#4CAB7D"}
:yellow {50 "#F6B03C"
60 "#C58D30"}
:orange {50 "#FF7D46"
60 "#CC6438"}
:yellow {50 "#FFCB53"
60 "#D6AA46"}
:orange {50 "#FB8F61"
60 "#D37851"}
:red {50 "#F46666"
60 "#CD5656"}
:pink {50 "#F66F8F"
60 "#C55972"}
:pink {50 "#FC7BAB"
60 "#D46790"}
:brown {50 "#99604D"
60 "#805141"}
:sky {50 "#1992D7"
60 "#1475AC"}
:army {50 "#216266"
60 "#1A4E52"}
:magenta {50 "#EC266C"
60 "#BD1E56"}
:copper {50 "#CB6256"
60 "#A24E45"}
:camel {50 "#C78F67"
60 "#9F7252"}
:yin {50 "#09101C"
60 "#1D232E"}
:yang {50 "#FFFFFF"
60 "#EBEBEB"}
:beige {50 "#CAAE93"
60 "#AA927C"}})
+2 -6
View File
@@ -10,10 +10,6 @@
(def app-state ^js (.-AppState ^js react-native))
;; Only use this component for exceptional cases, otherwise use Reanimated, e.g.
;; when using interpolated values exposed by RN Gesture Handler > Swipeable.
(def animated-view (reagent/adapt-react-class react-native/Animated.View))
(def view (reagent/adapt-react-class (.-View ^js react-native)))
(def scroll-view (reagent/adapt-react-class (.-ScrollView ^js react-native)))
(def image (reagent/adapt-react-class (.-Image ^js react-native)))
@@ -135,5 +131,5 @@
(.-RNSelectableTextInputManager ^js (.-NativeModules ^js react-native))))
(defonce selectable-text-input
(reagent/adapt-react-class
(.requireNativeComponent ^js react-native "RNSelectableTextInput")))
(reagent/adapt-react-class
(.requireNativeComponent ^js react-native "RNSelectableTextInput")))
+2 -2
View File
@@ -19,8 +19,8 @@
(defn- wrap-key-fn
[f]
(fn [data index]
(when f
(f data index))))
{:post [(some? %)]}
(f data index)))
(defn base-list-props
[{:keys [key-fn render-fn empty-component header footer separator data render-data on-drag-end-fn]
+15 -51
View File
@@ -1,63 +1,27 @@
(ns react-native.gesture
(:require ["react-native-gesture-handler" :refer
(Gesture
GestureDetector
RectButton
Swipeable
TouchableWithoutFeedback
gestureHandlerRootHOC)]
[reagent.core :as reagent]))
(GestureDetector Gesture gestureHandlerRootHOC TapGestureHandler State)]
[reagent.core :as reagent]
[oops.core :refer [oget]]))
(def gesture-detector (reagent/adapt-react-class GestureDetector))
(def gesture-handler-root-hoc gestureHandlerRootHOC)
(defn gesture-tap [] (.Tap ^js Gesture))
(defn gesture-pan [] (.Pan ^js Gesture))
(defn gesture-pinch [] (.Pinch ^js Gesture))
(defn on-update [^js pan handler] (.onUpdate pan handler))
(defn on-begin [gesture handler] (.onBegin ^js gesture handler))
(defn on-start [^js pan handler] (.onStart pan handler))
(defn on-start [gesture handler] (.onStart ^js gesture handler))
(defn on-end [^js pan handler] (.onEnd pan handler))
(defn on-update [gesture handler] (.onUpdate ^js gesture handler))
(def tap-gesture-handler
(reagent/adapt-react-class TapGestureHandler))
(defn on-end [gesture handler] (.onEnd ^js gesture handler))
(defn number-of-taps [gesture count] (.numberOfTaps ^js gesture count))
(defn enabled [gesture enabled?] (.enabled ^js gesture enabled?))
(defn average-touches [gesture average-touches?] (.averageTouches ^js gesture average-touches?))
(defn simultaneous
([g1 g2] (.Simultaneous ^js Gesture g1 g2))
([g1 g2 g3] (.Simultaneous ^js Gesture g1 g2 g3)))
(defn exclusive [g1 g2] (.Exclusive ^js Gesture g1 g2))
;; RN Gesture Handler touchables are drop-in replacements for the RN ones. In
;; some cases, it's the only touchable that works with Swipeable components.
(def touchable-without-feedback (reagent/adapt-react-class TouchableWithoutFeedback))
(def rect-button (reagent/adapt-react-class RectButton))
(def ^:private swipeable-component
(reagent/adapt-react-class Swipeable))
(defn swipeable
[{:keys [render-left-actions render-right-actions] :as props} & children]
(into [swipeable-component
(cond-> props
render-left-actions
(assoc :render-left-actions
(fn [& args]
(reagent/as-element (apply render-left-actions args))))
render-right-actions
(assoc :render-right-actions
(fn [& args]
(reagent/as-element (apply render-right-actions args)))))]
children))
(def states
{:began (oget State "BEGAN")
:active (oget State "ACTIVE")
:cancelled (oget State "CANCELLED")
:end (oget State "END")
:failed (oget State "FAILED")
:undetermined (oget State "UNDETERMINED")})
-17
View File
@@ -9,7 +9,6 @@
withDelay
withSpring
withRepeat
withDecay
Easing
Keyframe
cancelAnimation
@@ -49,7 +48,6 @@
(def with-timing withTiming)
(def with-delay withDelay)
(def with-spring withSpring)
(def with-decay withDecay)
(def key-frame Keyframe)
(def with-repeat withRepeat)
(def cancel-animation cancelAnimation)
@@ -139,18 +137,3 @@
(js-obj "mass" mass
"damping" damping
"stiffness" stiffness))))
(defn animate-shared-value-with-decay
[anim velocity clamp]
(set-shared-value anim
(with-decay (clj->js {:velocity velocity
:clamp clamp}))))
(def in-out
(.-inOut Easing))
(defn with-timing-duration
[val duration]
(with-timing val
(clj->js {:duration duration
:easing (in-out (.-quad ^js Easing))})))
-2
View File
@@ -7,5 +7,3 @@
(def rect (reagent/adapt-react-class Svg/Rect))
(def clippath (reagent/adapt-react-class Svg/ClipPath))
(def defs (reagent/adapt-react-class Svg/Defs))
(def circle (reagent/adapt-react-class Svg/Circle))
+2 -2
View File
@@ -3,7 +3,7 @@
[re-frame.core :as re-frame]
[status-im.add-new.db :as db]
[status-im2.contexts.chat.events :as chat]
[status-im2.contexts.contacts.events :as contact]
[status-im.contact.core :as contact]
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.ens :as ens]
[status-im.ethereum.stateofus :as stateofus]
@@ -91,7 +91,7 @@
(i18n/label :t/use-valid-contact-code)
:yourself
(i18n/label :t/can-not-add-yourself))
:on-dismiss #(re-frame/dispatch [:pop-to-root :shell-stack])}})))
:on-dismiss #(re-frame/dispatch [:pop-to-root-tab :shell-stack])}})))
(rf/defn qr-code-scanned
{:events [:contact/qr-code-scanned]}
@@ -1,4 +1,4 @@
(ns react-native.audio-toolkit
(ns status-im.audio.core
(:require ["@react-native-community/audio-toolkit" :refer (Player Recorder MediaStates)]))
;; get mediastates from react module
+6 -6
View File
@@ -125,8 +125,8 @@
(let [cofx {:db {:networks/current-network "mainnet_rpc"
:multiaccount {:custom-bootnodes
{"mainnet_rpc"
{"a" {:id "a"
:name "name"
{"a" {:id "a"
:name "name"
:address
"enode://old-id:old-password@url:port"}}}}}}]
(is (model/fetch cofx "a")))))
@@ -154,8 +154,8 @@
(let [cofx {:db {:networks/current-network "mainnet_rpc"
:multiaccount {:custom-bootnodes
{"mainnet_rpc"
{"a" {:id "a"
:name "name"
{"a" {:id "a"
:name "name"
:address
"enode://old-id:old-password@url:port"}}}
:custom-bootnodes-enabled?
@@ -167,8 +167,8 @@
(let [cofx {:db {:networks/current-network "mainnet_rpc"
:multiaccount {:custom-bootnodes
{"mainnet_rpc"
{"a" {:id "a"
:name "name"
{"a" {:id "a"
:name "name"
:address
"enode://old-id:old-password@url:port"}}}
:custom-bootnodes-enabled?

Some files were not shown because too many files have changed in this diff Show More