Skip to content

Commit cb9ae2a

Browse files
authored
Merge branch 'develop' into 17433-composer-expanded-on-cancel
2 parents 1e0664a + 422004f commit cb9ae2a

File tree

137 files changed

+1409
-1424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1409
-1424
lines changed

.clj-kondo/status-im/config.edn

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
{:hooks {:analyze-call {utils.i18n/label hooks.core/i18n-label}}
1+
{:hooks {:analyze-call {utils.i18n/label utils.i18n/label}}
22
:linters {:status-im.linter/invalid-translation-keyword {:level :error}}}

.clj-kondo/status-im/hooks/core.clj

-19
This file was deleted.

.clj-kondo/status-im/utils/i18n.clj

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(ns utils.i18n
2+
(:require [clj-kondo.hooks-api :as hooks]))
3+
4+
(defn label
5+
"Verify call to `utils.i18n/label` pass the translation keyword qualified with `t`."
6+
[{:keys [node]}]
7+
(let [[_ translation-key-node & _] (:children node)]
8+
(when (and (hooks/keyword-node? translation-key-node)
9+
(not= "t" (-> translation-key-node hooks/sexpr namespace)))
10+
(hooks/reg-finding! (assoc (meta translation-key-node)
11+
:message "Translation keyword should be qualified with \"t\""
12+
:type :status-im.linter/invalid-translation-keyword)))))
13+
14+
(comment
15+
;; Valid
16+
(label {:node (hooks/parse-string "(i18n/label :t/foo {:var \"hello\"})")
17+
:cljc false
18+
:lang :cljs
19+
:filename ""
20+
:config {}
21+
:ns ""
22+
:context nil})
23+
24+
;; Invalid
25+
(label {:node (hooks/parse-string "(i18n/label :foo)")})
26+
)

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ modules
77
result
88
target
99
component-spec
10+
/app

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ run-android: export ANDROID_ABI_INCLUDE ?= $(shell ./scripts/adb_devices_abis.sh
278278
run-android: ##@run Build Android APK and start it on the device
279279
npx react-native run-android --appIdSuffix debug
280280

281-
SIMULATOR=iPhone 11 Pro
281+
SIMULATOR=iPhone 13
282282
run-ios: export TARGET := ios
283283
run-ios: export IOS_STATUS_GO_TARGETS := iossimulator/amd64
284284
run-ios: ##@run Build iOS app and start it in a simulator/device
@@ -312,8 +312,10 @@ lint: export TARGET := clojure
312312
lint: export CLJ_LINTER_PRINT_WARNINGS ?= false
313313
lint: ##@test Run code style checks
314314
@sh scripts/lint-re-frame-in-quo-components.sh && \
315+
sh scripts/lint-direct-require-component-outside-quo.sh && \
315316
clj-kondo --config .clj-kondo/config.edn --cache false --fail-level error --lint src $(if $(filter $(CLJ_LINTER_PRINT_WARNINGS),true),,| grep -v ': warning: ') && \
316317
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
318+
scripts/lint_translations.clj && \
317319
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \
318320
sh scripts/lint-trailing-newline.sh && \
319321
node_modules/.bin/prettier --write .

doc/component-tests-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ setups and runs the test suite once.
2323
setups and runs the test suite and watches for code changes will then retrigger the test suite.
2424

2525
## Writing Tests
26-
New test files will need their namespace added to either the file "src/quo2/core_spec.cljs" or "src/status_im2/core_spec.cljs. These locations may update overtime but it is dependent on the entrypoint in shadow-cljs config discussed below.
26+
New test files will need their namespace added to either the file "src/quo/core_spec.cljs" or "src/status_im2/core_spec.cljs. These locations may update overtime but it is dependent on the entrypoint in shadow-cljs config discussed below.
2727

2828

2929
### Best practices

doc/new-guidelines.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ It's important to name functional components with `f-` prefix.
7676

7777
### Component props and API scheme to match Figma as closely as possible
7878

79-
Ideally, the prop names for components (particularly in quo2 Design System)
79+
Ideally, the prop names for components (particularly in quo Design System)
8080
should match the Figma properties as best as possible. This makes it easier for
8181
the developer using that component to configure it correctly for the screen it
8282
is being used on and avoids unnecessary overwrites and adjustments being made.
@@ -134,7 +134,7 @@ For example if Figma has sizes `:small`, `:medium` and `:large`
134134

135135
Prefer to define styles in a separate file named `style.cljs`, colocated with
136136
the source file. For a real example, see
137-
[src/quo2/components/record_audio/record_audio/style.cljs](../src/quo2/components/record_audio/record_audio/style.cljs).
137+
[src/quo/components/record_audio/record_audio/style.cljs](../src/quo/components/record_audio/record_audio/style.cljs).
138138

139139
```clojure
140140
;; bad
@@ -467,9 +467,9 @@ Prefer the pure version of `:json-rpc/call` (no callbacks).
467467

468468
### Registering event handlers
469469

470-
Register events with `re-frame.core/reg-event-fx` and follow [re-frame's best
470+
Register events with `utils.re-frame/reg-event-fx` and follow [re-frame's best
471471
practice](https://github.com/day8/re-frame/blob/39adca93673f334dc751ee2d99d340b51a9cc6db/docs/FAQs/BestPractice.md#use-the-fx-effect)
472-
so use only `:db` and `:fx` effects. `rf/merge` is deprecated and should not be
472+
so use only `:db` and `:fx` effects. `utils.re-frame/merge` and `utils.re-frame/defn` are deprecated and should not be
473473
used in the new code in `src/status_im2/`. Don't use
474474
`re-frame.core/reg-event-db`.
475475

@@ -528,27 +528,27 @@ due to performance constraints.
528528
(:preferred-name multiaccount)))
529529
```
530530

531-
### Requiring quo2 components
531+
### Requiring quo components
532532

533-
Consume `quo2` components from `quo2.core`, unless the namespace is also inside
534-
the `quo2/` directory.
533+
Consume `quo` components from `quo.core`, unless the namespace is also inside
534+
the `quo/` directory.
535535

536536
```clojure
537537
;; bad
538538
(ns my-namespace
539-
(:require [quo2.components.icon :as icon]))
539+
(:require [quo.components.icon :as icon]))
540540

541541
(icon/icon :i/verified)
542542

543543
;; good
544544
(ns my-namespace
545-
(:require [quo2.core :as quo]))
545+
(:require [quo.core :as quo]))
546546

547547
(quo/icon :i/verified)
548548

549-
;; also good because both namespaces are inside quo2/
550-
(ns quo2.components.tabs.account-selector
551-
(:require [quo2.components.markdown.text :as text]))
549+
;; also good because both namespaces are inside quo/
550+
(ns quo.components.tabs.account-selector
551+
(:require [quo.components.markdown.text :as text]))
552552
```
553553

554554
### Require/import
@@ -615,12 +615,12 @@ Use the appropriate keyword qualification/namespace.
615615

616616
```clojure
617617
;; bad
618-
(require '[quo2.components.icon :as icons])
618+
(require '[quo.components.icon :as icons])
619619
(icons/icon :main-icons2/verified)
620620

621621
;; good
622-
(require '[quo2.core :as quo2])
623-
(quo2/icon :i/verified)
622+
(require '[quo.core :as quo])
623+
(quo/icon :i/verified)
624624
```
625625

626626
### Translations
@@ -695,7 +695,7 @@ First, the bird's-eye view with some example ClojureScript files:
695695
src
696696
├── js/
697697
├── mocks/
698-
├── quo2
698+
├── quo
699699
│ ├── components/
700700
│ ├── foundations/
701701
│ └── theme.cljs
@@ -716,7 +716,7 @@ src
716716

717717
- `src/js`: Raw Javascript files, e.g. React Native Reanimated worklets.
718718
- `src/mocks`: Plumbing configuration to be able to run tests.
719-
- `src/quo2/`: The component library for Status Mobile.
719+
- `src/quo/`: The component library for Status Mobile.
720720
- `src/react_native/`: Contains only low-level constructs to help React Native
721721
work in tandem with Clojure(Script).
722722
- `src/status_im2/`: Directory where we try to be as strict as possible about
@@ -728,7 +728,7 @@ src
728728
of the directory tree. Just like directories named `utils`, their directory
729729
nesting level communicates their applicable limits.
730730
- `src/status_im2/common/components/`: Contains reusable components that are not
731-
part of the design system (quo2).
731+
part of the design system (quo).
732732
- `src/status_im2/contexts/`: Contains [bounded contexts](#glossary), like
733733
`browser/`, `messaging/`, etc. As much as possible, _bounded contexts_ should
734734
not directly require each other's namespaces.
@@ -743,24 +743,24 @@ directory nesting level precisely indicates its boundaries. For example, a
743743
`contexts/user_settings/utils/datetime.cljs` file communicates that it should
744744
only be used in the `user_settings` context.
745745

746-
### src/quo2
746+
### src/quo
747747

748-
The `src/quo2/` directory holds all components for the new design system. As
748+
The `src/quo/` directory holds all components for the new design system. As
749749
much as possible, its sub-directories and component names should reflect the
750750
same language used by designers.
751751

752752
Even though the directory lives alongside the rest of the codebase, we should
753753
think of it as an external entity that abstracts away particular Status domain
754754
knowledge.
755755

756-
Components inside `src/quo2/` should not rely on re-frame, i.e. they should not
756+
Components inside `src/quo/` should not rely on re-frame, i.e. they should not
757757
dispatch events or use subscriptions.
758758

759759
Example structure:
760760

761761
```
762762
src
763-
└── quo2
763+
└── quo
764764
├── components
765765
│ └── dropdown
766766
│ ├── style.cljs

doc/pixel-perfection.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# Pixel Perfection
22
The Status Mobile team aims to align the design implementation perfectly according to a given screens respective Figma design spec.
33

4-
Currently the Figma Designs match up with an "iPhone 11 Pro" screen size.
4+
Currently, the Figma Designs match up with both "iPhone 11 Pro" and "iPhone 13" screen size.
5+
6+
The Dimension reference for iPhone 11 Pro is 375 x 812 (width x height) and for iPhone 13 is 390 x 844.
57

68
To test your implementation is correct you can take the following steps
79

810
- Open a new Figma file so that you have write privileges.
11+
912
- Copy in the component or screen from the Figma file.
1013

11-
- Using the "iPhone 11 Pro" simulator (it is the default now) you take a screenshot of your component and paste it into your Figma file.
14+
- Using the "iPhone 11 Pro" or the "iPhone 13" simulator (it is the default now) you take a screenshot of your component and paste it into your Figma file.
15+
16+
- To get the right size, set your screenshot to width according to your simulator:
17+
- for iPhone 13 set 390
18+
- for iPhone 11 Pro set 375
1219

13-
- To get the right size, set your screenshot to width 375px
1420

1521
![](images/pixel-perfection/layer-width.png)
1622

doc/starting-guide.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ You need to have an emulator like [AVD](https://developer.android.com/studio/run
3030

3131
#### Running on a simulator
3232

33-
We highly recommend using the `iPhone 11 Pro` simulator as its screen dimensions match with our design.
33+
We highly recommend using either the `iPhone 11 Pro` or `iPhone 13` simulator as its screen dimensions match with our design.
3434

35-
If you have Xcode `v12.x` (and above) installed in your system, you need to follow the below steps to add `iPhone 11 Pro` simulator:
35+
If you have Xcode `v12.x` (and above) installed in your system, you need to follow the below steps to add `iPhone 13` simulator:
3636

3737
1. Open Xcode
3838
2. Menu `>` Window `>` Devices and Simulators
3939
3. Tap `+` button on bottom left
40-
4. Select **Device Type** as `iPhone 11 Pro`
40+
4. Select **Device Type** as `iPhone 13`
4141
5. Leave the **Simulator Name** empty and tap on **Create**
4242

4343
##### NOTE ⚠️
4444

45-
Running `make run-ios` will target `iPhone 11 Pro` by default.
45+
Running `make run-ios` will target `iPhone 13` by default.
4646

4747
If you need to run on any other simulator, you can specify the simulator type by adding the `SIMULATOR` flag:
4848
```sh
49-
make run-ios SIMULATOR="iPhone 11 Pro"
49+
make run-ios SIMULATOR="iPhone 13"
5050
```
5151

5252
#### Running on a physical device

ios/Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ SPEC CHECKSUMS:
765765
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
766766
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
767767
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
768-
RNReanimated: 62e43ee6baafb9ba3d3af1857d7fd23a1d41bff0
768+
RNReanimated: 42f56dc5c032a11177b9ea12cdb57285318b432e
769769
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
770770
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
771771
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9

modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java

-40
Original file line numberDiff line numberDiff line change
@@ -1194,21 +1194,6 @@ public String logFileDirectory() {
11941194
return getPublicStorageDirectory().getAbsolutePath();
11951195
}
11961196

1197-
@ReactMethod(isBlockingSynchronousMethod = true)
1198-
public String generateAlias(final String seed) {
1199-
return Statusgo.generateAlias(seed);
1200-
}
1201-
1202-
@ReactMethod
1203-
public void generateAliasAsync(final String seed, final Callback callback) throws JSONException {
1204-
executeRunnableStatusGoMethod(() -> Statusgo.generateAlias(seed), callback);
1205-
}
1206-
1207-
@ReactMethod(isBlockingSynchronousMethod = true)
1208-
public String identicon(final String seed) {
1209-
return Statusgo.identicon(seed);
1210-
}
1211-
12121197
@ReactMethod(isBlockingSynchronousMethod = true)
12131198
public String encodeTransfer(final String to, final String value) {
12141199
return Statusgo.encodeTransfer(to, value);
@@ -1269,31 +1254,6 @@ public void identiconAsync(final String seed, final Callback callback) throws JS
12691254
executeRunnableStatusGoMethod(() -> Statusgo.identicon(seed), callback);
12701255
}
12711256

1272-
@ReactMethod
1273-
public void generateAliasAndIdenticonAsync(final String seed, final Callback callback) {
1274-
1275-
Log.d(TAG, "generateAliasAndIdenticonAsync");
1276-
if (!checkAvailability()) {
1277-
callback.invoke(false);
1278-
return;
1279-
}
1280-
1281-
Runnable r = new Runnable() {
1282-
@Override
1283-
public void run() {
1284-
String resIdenticon = Statusgo.identicon(seed);
1285-
String resAlias = Statusgo.generateAlias(seed);
1286-
1287-
Log.d(TAG, resIdenticon);
1288-
Log.d(TAG, resAlias);
1289-
callback.invoke(resAlias, resIdenticon);
1290-
}
1291-
};
1292-
1293-
StatusThreadPoolExecutor.getInstance().execute(r);
1294-
1295-
}
1296-
12971257
@Override
12981258
public @Nullable
12991259
Map<String, Object> getConstants() {

0 commit comments

Comments
 (0)