Commit Graph

6038 Commits

Author SHA1 Message Date
Jamie Caprani 8d3883c709
feat(communities) enable user to share community channel (#18516)
Co-authored-by: Paul Fitzgerald <paulfitz99@gmail.com>
2024-01-15 12:16:42 -08:00
Omar Basem 8a16017859
Wallet: send token from drawer (#18429)
* feat: send token drawer
2024-01-15 20:57:55 +04:00
Omar Basem fa9b6edd30
Wallet: select-send-address event (#18501)
* Wallet: select-send-address event
2024-01-15 20:21:38 +04:00
Jamie Caprani 3e787ff112
feat(shell): add share qr wallet accounts feature(#18511)
Co-authored-by: Paul Fitzgerald <paulfitz99@gmail.com>
2024-01-15 06:39:48 -08:00
Siddarth Kumar 92dcd1140b
refactor native modules into separate modules (#18385)
The native module : `react-native-status` has always been 1 big fat file per platform which contained all of the native modules.

In case of Android it was `StatusModule.java`
This commit modularises it & attempts to thin out this 1 big file into these categories:
- `AccountManager.java`
- `EncryptionUtils.java`
- `DatabaseManager.java`
- `UIHelper.java`
- `LogManager.java`
- `NetworkManager.java`
- `Utils.java`

In case of iOS it was `RCTStatus.m`
This commit modularises it & attempts to thin out this 1 big file into these categories:
- `AccountManager.m`
- `EncryptionUtils.m`
- `DatabaseManager.m`
- `UIHelper.m`
- `LogManager.m`
- `NetworkManager.m`
- `Utils.m`

In this commit we also remove a lot of unused native code which has no reference on cljs side.
2024-01-15 18:57:35 +05:30
John Ngei 6aa981d4a7
fixed dark border around the community logo on community page
This PR removes the dark border around the community logo on communities page 
reproducible only when the user has not yet joined the community
2024-01-12 18:37:23 +01:00
Ulises Manuel e3ab270933
#[16978] Select collectible to send (#18404)
* Show collectibles to send and add filter capabilities

Additionally,
* Replace the sub `:wallet/collectibles-per-account` by `:wallet/current-viewing-account-collectibles` since 
    it was only used for the current viewing account and simplified the code.
* Refactor the select-asset view.
* Generalize collectibles-tab view
* Add translations for "not found" state
2024-01-12 11:14:39 -06:00
flexsurfer 4165565956
fix subs leak (#18480) 2024-01-12 16:12:10 +01:00
Icaro Motta 7e2c7abf30
Fix: incorrect props passed to RN's style prop (#18435)
Fix 3 errors in the onboarding screen about unsupported props passed to the style prop.

1x ERROR  Warning: Failed prop type: Invalid props.style key resizeMethod supplied to Image.
2x ERROR  Warning: Failed prop type: Invalid props.style key size supplied to Text.

Related guideline:
563f1c588d/doc/new-guidelines.md (dont-define-properties-in-styles-ns)
2024-01-11 20:10:04 -03:00
Omar Basem ec2b95c370
Fix: Asset decimals on select asset screen (#18427)
* fix: assets decimals
2024-01-11 20:44:20 +04:00
Parvesh Monu 623d4a1476
fix improper use of current-chat-id and rename subs (#18389) 2024-01-11 17:20:37 +05:30
Roman Volosovskyi 09408e7811
Reanimate RPC stats screen 2024-01-11 11:04:07 +01:00
Ulises Manuel 0f43daa836
[#18362] Add support for Reanimated inline styles in Reagent (#18381)
* Modify reanimated/view to support vectors contained in styles
* Add code examples of animated inline styles

Additionally,
*  Fix warning about reactive deref not supported in lazy-seqs
2024-01-10 20:09:32 -06:00
Brian Sztamfater 162c6dbf89
fix: route not found when attempting to transfer assets to additional eth account (#18325)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-01-10 12:49:45 -03:00
mmilad75 da03989c88
Implement about tab on collectible page (#18269)
* add basics

* finalize component

* fix lint issues

* move color to props

* move variants to props

* change file structure

* working

* finalize loader

* fix lint issues

* fix style issues

* add tabs structure

* add basics

* draft codes

* draft

* make codes work after rebase

* fix lint issues

* remove Permissions tab

* revert codes

* finalize code

* fix lint issues

* revert podfile.lock

* create new reg-sub for traits and chain-id

* add real title and description for about tab

* resolve comments

* fix overview tab

* add tests

* resolve comments

---------

Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
2024-01-10 18:47:07 +03:30
Mohamed Javid 5a707c0dca
Wallet - Initialize event, refactor networks data and bug fix (#18374)
This commit:

- Introduces new event ":wallet/initialize" to group events that need to be called on login
- Refactors wallet networks to use the nested structure in re-frame
- Fixes a bug when updating the testnet network preferences of an account the production network preferences update

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-01-10 18:47:24 +05:30
Parvesh Monu 425ef64901
Refactor compose (#18339)
- Removed show-floating-scroll-down-button? reagent atom
- Created event for scroll-to-bottom-fn
- Renamed chat.ui/close-chat
2024-01-10 13:53:35 +05:30
Ajay Sivan 1eb9e87383
Move selected addresses for permissions to app db (#18430) 2024-01-09 19:45:17 -08:00
yqrashawn 61b0a2ecac
fix: profile screen initial avatar alignment (#18426)
debfe1ca...debfe1ca

Signed-off-by: yqrashawn <namy.19@gmail.com>
2024-01-10 10:34:54 +08:00
frank 78576f4aeb
fix: mark all notifications as read not work (#18107) 2024-01-10 10:04:49 +08:00
Ibrahem Khalil 9ff70ed990
Add internal-link component for #17116 (#18109) 2024-01-09 14:31:00 +02:00
Omar Basem 504d92fd57
Wallet: suggested routes list (#18388)
* wallet: suggested routes list
2024-01-09 15:12:11 +04:00
Lungu Cristian fb13c3016d
Biometrics in new settings (#18258)
* feat: added biometrics setting to new-settings

* fix: fix renaming issues from status-im2

* ref: addressed @cammellos' review comments

* fix: open password settings in a modal

* ref: addressed review comments

* fix: disabling biometric clears auth-method from keychain

* chore: quo/overlay seqs the childrend so need to add keys

* fix: don't pass the password unmasked between events to avoid leaks
2024-01-09 10:25:40 +02:00
Yevheniia Berdnyk 4c4ba97308
e2e: added check for deleted 1-1 chat history 2024-01-08 21:49:20 +02:00
Mohsen b4d27d287a
feat: implement edit profile and change name (#18270) 2024-01-08 18:27:07 +03:00
Parvesh Monu fb58d7205e
Add dispatch-and-chill to navigation events (#18372) 2024-01-08 19:59:01 +05:30
Parvesh Monu 0208224741
fix delayed display of top bar in chat after sending messages (#18300) 2024-01-08 18:12:07 +05:30
Shivek Khurana b3a2f397f9
🔗 Enable explorer links in wallet->about (#18406) 2024-01-08 12:00:41 +00:00
Mohamed Javid a00e44d056
Show aggregated tokens and balance in Wallet home (#18275)
This commit adds the feature to show aggregated tokens and balances in the Wallet home.

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2024-01-06 00:36:54 +05:30
Jamie Caprani 9c62e63035
chore: organise chats context (#18373) 2024-01-05 09:39:01 -08:00
Brian Sztamfater fc72ba6a1e
fix: fix height on account card component (#18329)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-01-05 14:11:11 -03:00
BalogunofAfrica 1919094b46
fix: community buttons (#18392) 2024-01-05 17:17:51 +01:00
Brian Sztamfater e7b92dcf25
fix: increase numbered keyboard touchable area (#18330)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-01-05 12:55:23 -03:00
Brian Sztamfater 4b3bc73239
fix: always navigate back to shell stack when closing watch account screen (#18324)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-01-05 12:38:58 -03:00
Jamie Caprani 947a1ef29c
feat(wallet): add ability to send a token (#18242) 2024-01-05 07:04:39 -08:00
Ajay Sivan 4edb14bb5f
Communities: Share Selective Account (#18382) 2024-01-05 05:34:43 -08:00
Omar Basem c6a7808049
Wallet: Utility Tests (#18371)
* Wallet: utility tests
2024-01-05 16:29:26 +04:00
yqrashawn be2d0feda3
fix: generate_profile_url crash when login (#18364)
* fix: generate_profile_url.cljs$core$IFn$_invoke$arity$2 crash when login

'status_im.common.universal_links.generate_profile_url.cljs$core$IFn$_invoke$arity$2' is undefined

update the function to a fixed arity function

* fix: schema/=> macro for :function schema

Signed-off-by: yqrashawn <namy.19@gmail.com>

---------

Signed-off-by: yqrashawn <namy.19@gmail.com>
2024-01-05 20:08:13 +08:00
Ajay Sivan c91b4339dc
Use text-combinations/page-top component in request to join sheet. (#18384) 2024-01-05 02:09:58 -08:00
Brian Sztamfater 205962f582
fix: error is shown when asset is selected on select assets screen (#18326)
Signed-off-by: Brian Sztamfater <brian@status.im>
2024-01-04 11:58:35 -03:00
Ulises Manuel 4ff5e4da8b
[#17938] Collectibles per account (#18277)
* Update wallet events and subs to handle collectibles per account

Additionally,
 - Move collectibles related events to a new events namespace (`status-im.contexts.wallet.events.collectibles`).
 - Update tests to consider collectibles per account.

* Update collectibles tab to handle a current viewing account
2024-01-03 18:41:12 -06:00
Parvesh Monu fc591f303c
fix unable to open add-new-contact screen if hardware button is pressed while qr scanner is open (#18296) 2024-01-03 18:24:58 +05:30
Omar Basem f2c69ab9a8
Wallet: crypto max decimals (#18267)
* wallet: crypto max decimals
2024-01-03 15:48:04 +04:00
Omar Basem 006b637b1b
Quo: quiz item (#18306)
* Quo: quiz item
2024-01-03 15:36:17 +04:00
Jamie Caprani f016a9c33c
chore: clean up contexts folder to only include larger feature sets (#18286) 2024-01-03 02:25:49 -08:00
Omar Basem 1ce76a4af6
Wallet: network preferences text description (#18319)
Wallet: network preferences text description
2024-01-02 13:45:21 +04:00
Alexander 4a9ca80bc2
Share screen design review (#18148)
* Share screen design review

* Small update

* Update

* Style fix
2024-01-02 10:23:38 +01:00
Ibrahem Khalil e392608697
Fix no message preview on long press on the reaction (#18292) 2023-12-30 11:25:01 +02:00
Parvesh Monu 7af62c04eb
Keep chat screen loaded (#17839) 2023-12-29 14:55:12 +05:30
Ulises Manuel 107d1a80c9
Fix token images not being displayed (#18288)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-12-27 12:43:47 -03:00
Omar Basem 01e8c7e480
Wallet: about tab fixes (#18298)
* wallet: about tab fixes
2023-12-27 19:14:09 +04:00
Ajay Sivan bec51b7d0e
Add :wallet/accounts-with-customization-color subscription (#18302) 2023-12-26 08:12:20 -08:00
Icaro Motta 0b4a1545ae
Fix component tests, upgrade Jest & friends, and a few other goodies (#18276)
Fix all component tests after the latest RN upgrade.

Fixes https://github.com/status-im/status-mobile/issues/18157
Closes https://github.com/status-im/status-mobile/pull/18235

Dependency changes

- Upgraded Jest: from 26.6.3 to latest 29.7.0.
- Upgraded @testing-library/jest-native: from 5.3.0 to latest 5.4.3
- Upgraded @testing-library/react-native: from 11.5.4 to 12.4.2
- Removed explicit dependency on jest-circus, this is now the default test
  runner.
- Removed explicit dependency on jest-environment-node. This is handled by the
  package manager.
- Added jest-silent-reporter at version 0.5.0.

### Why component tests were failing?

Many tests were failing because we were using RN Testing Library (RNTL) in an
unreliable fashion. With the recent library upgrades, the unreliability was
excerbated. Other times, the tests were incorrectly arranging data.

### with-redefs does not work with async code

Generally speaking, with-redefs should not be used with async code, assume the
worst. The scope of the macro will cease to exist by the time the async code
runs. In many tests we were using with-redefs, then calling render, but for some
components that use use-effect, JS timers, animations, etc it's unreliable and
were the reason for failures.

It's easy to reproduce too:

```clojure
(defn foo []
  :foo)

(foo)
;; => :foo

(with-redefs [foo (constantly :bar)]
  (foo))
;; => :bar

(js/setTimeout
 (fn []
   (tap> [:calling-foo (foo)]))
 100)
;; Taps [:calling-foo :foo]
;; As you would expect, when running without with-redefs, it prints :foo.

;; So far so good, but whatch what happens with async code:

(with-redefs [foo (constantly :bar)]
  (js/setTimeout
   (fn []
     (tap> [:calling-foo (foo)]))
   100))
;; Taps [:calling-foo :foo]
;; ====> PROBLEM: Taps :foo, not :bar as one might expect
```

### Not waiting on wait-for

When test-helpers.component/wait-for is used, subsequent assertions/etc should
be done after the promise returned by wait-for is resolved. But remember to not
perform side-effects inside the wait-for callback (check out the docs
https://callstack.github.io/react-native-testing-library/docs/api#waitfor).
Most, if not all of our usages of wait-for were not waiting.

#### Improvement 1 - Silence Jest on demand

If you need to re-run component tests frequently, you may want to reduce the
output verbosity. By passing JEST_USE_SILENT_REPORTER=true to make
component-test or make component-test-watch you will see a lot less noise and be
able to focus on what really matters to you.

#### Improvement 2 - Selectively focus/disable tests

Because of our need to first compile CLJS to JS before running tests via Jest,
we couldn't easily skip or focus on specific tests. From this commit onwards, we
should never again have to change the list of requires in files core_spec.cljs.
Commenting out required namespaces gives a bad DX because it causes constant
rebasing issues.

#### Improvement 3 - Translations now work as in prod code (but only English)

Translations performed by *-by-translation-text can be done now without any
workaround under the hood. The query functions are now linted just like
i18n/label, which means static translation keywords must be qualified with :t/,
which is good for consistency.
2023-12-26 11:58:23 -03:00
flexsurfer 31acb8e9c4
improve profile screen performance (#18281) 2023-12-22 16:59:12 +01:00
Jamie Caprani eda8c0ccb0
fix(quo): truncation on wallet account card long name (#18259)
---------

Co-authored-by: Paul Fitzgerald <paulfitz99@gmail.com>
2023-12-22 15:48:57 +00:00
codemaster 7915ba85ab
fix: theming toast component (#17918) 2023-12-23 01:29:50 +10:00
Omar Basem 5eb0baa64d
Wallet: best route UI (#18266)
* Wallet: best route UI
2023-12-22 09:40:43 +04:00
yqrashawn a4dc268bc3
feat: spectate community before join (#18070) 2023-12-22 10:21:10 +08:00
Ulises Manuel 5fa9c0cab6
[#17964] emoji screen performance (#18213)
* Fix `->` style in emoji-picker.data

* Make `temp-empty-symbol` component code safer to avoid app crashing

* fix `->` style in `emoji-picker.utils`

* Pass sheet-animating? ratom to bottom-sheet's content component

* Improve emoji picker performance
2023-12-21 15:44:33 -06:00
Omar Basem 4f9544d20c
Wallet: receive screen (#18167)
* wallet: receive screen
2023-12-21 22:07:27 +04:00
flexsurfer ad8d537b9c
move status-im from utils (#18249) 2023-12-21 18:16:59 +01:00
Jamie Caprani 4c3d1667ca
chore: add outline for transacation-progress page (#18217) 2023-12-21 15:37:18 +00:00
Flavio Fraschetti e59e34d0da
Communities: Present the list of airdrop addresses (#18189)
Co-authored-by: Flavio Fraschetti <frasqueti@gmail.com>
Co-authored-by: Ajay Sivan <ajayesivan@gmail.com>
2023-12-21 01:27:59 -08:00
Mohamed Javid 60dfd6ce78
Added assets skeleton in wallet home and account screen (#18197)
This commit:

- Updates the "skeleton-list" component to support the "assets" type
- Adds the assets skeleton to the assets tab in the wallet home and account screen

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-21 13:28:52 +05:30
Ajay Sivan 4ca533a534
Move disabled component tests outside of require block to fix lint messup (#18265) 2023-12-20 22:18:59 -08:00
Ulises Manuel 7cf31651b3
[#18083] Implement Page top component (#18163)
* Add container style and fix `:auto-complete` parameter in address-input

* Add container style to recovery-phrase input

* Add container style and accessibility-label to search-input

* Add page-top component and tests

* Add page top preview
2023-12-20 13:17:39 -06:00
Ajay Sivan 04184b41e5
Wallet/Account Permissions Quo Component (#18224) 2023-12-20 07:54:13 -08:00
Lungu Cristian d0e624afd7
Biometrics button on login screen (#18106)
* feat: login with biometry when switching accounts

* feat: biometry button on login screen

* fix: addressed review comments

* fix: biometry button background

* ref: moved biometrics constants to main constants file

* fix: hide biometric button when not enabled

* feat: standard_auth blur prop

* fix: leftover rename
2023-12-20 17:15:51 +02:00
Volodymyr Kozieiev bf55a2a974
Activity tab on collectible page (#18220) 2023-12-20 14:53:29 +00:00
Omar Basem 8225d91ee0
Wallet: home top insets
Wallet: home top insets
2023-12-20 18:23:27 +04:00
Mohsen f631e1fe9d
[#17393] feat: add new setting ui (#18118) 2023-12-20 17:03:49 +03:00
Andrea Maria Piana 32cfd214ca
Add fetch messages behind a toggle & some advanced settings
This PR does a few things:

1) Add fetch messages implementation on any kind of chat. It's behind a
   toggle (on by default) as design is still unsure whether we want it,
   but it's very useful for debugging.
2) Allow setting light client from mobile

It also partially remove node config management from the clojure part,
as it's better if that's not explicitly managed by clients.
Some parts are still relying on it but they are not functional
(keycard), while others are still using it and will need to be updated
eventually (syncing), in order to get rid completely of node config.

Sets fleet to shards.test

90c31afe...1adcf02f
2023-12-20 13:04:29 +00:00
flexsurfer 800ca19c08
move keycard native module, removed outdated code (#18252) 2023-12-20 13:53:53 +01:00
mmilad75 b70493691c
Implement Link Card component (#18080)
* add basics

* finalize component

* add test structure

* add tests

* fix lint issues

* move color to props

* move variants to props

* change file structure

* working

* finalize loader

* fix tests

* fix lint issues

* fix style issues

* fix typos

* resolve comments

---------

Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com>
2023-12-20 14:07:04 +03:30
Ajay Sivan a40862c5a9
Disable component tests that use `wait-for` helper function (#18243) 2023-12-20 02:26:57 -08:00
Parvesh Monu 17c442a373
Add placeholder illustration in jump-to screen (#18229) 2023-12-20 14:56:33 +05:30
Parvesh Monu c74461db3a
remove unused react-native-intersection-observer library (#18230) 2023-12-20 14:21:07 +05:30
yqrashawn 4bc5efb855
fix: universal link regex (#18020)
Co-authored-by: Yevheniia Berdnyk <ie.berdnyk@gmail.com>
2023-12-20 11:25:09 +08:00
flexsurfer 602b27105b
FINAL BOSS! rename status-im2 to status-im (#18241) 2023-12-19 20:59:07 +01:00
flexsurfer f89fd8ca54
move status-im under legacy (#18237) 2023-12-19 18:41:30 +01:00
flexsurfer 842203a4d0
move community code to status-im2 (#18218) 2023-12-19 15:59:50 +01:00
Brian Sztamfater a4f99de8d5
feat: implement getSuggestedRoutes in the wallet Send Flow (#18104)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-12-19 02:59:58 -08:00
Parvesh Monu d40f70dca4
Optimize chat screen navigation view (#18055) 2023-12-19 16:01:13 +05:30
Alexander 1df96ae3e0
Invite friends (#17570) (#18124)
* Invite friends (#17570)

* Small update

* Update

* Fix
2023-12-19 10:36:49 +01:00
Mohamed Javid da61233302
Wallet - Watched Account UI Updates (#18190)
This commit:

- Updates the account switcher in the "page-nav" component to use "account-avatar" instead of "dropdown"
- Updates the account avatar (on the top right corner of the account screen) to display the watched account variant correctly
- Updates the accounts list in the account switcher to display the correct background for the watched account with the eye icon

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-18 23:31:36 +05:30
Jamie Caprani 8a869be01c
chore(wallet): add images to select address page (#18119) 2023-12-18 03:55:42 -08:00
Parvesh Monu 8ba9f45e44
Upgrade react-native-reanimated to 3.6.1 (#18216) 2023-12-18 09:44:53 +05:30
frank e06d8cb106
fix: App gets stuck on syncing process screen when scanning QR code v… (#18140)
* fix: App gets stuck on syncing process screen when scanning QR code via recovered profile with different passwords

* update comment
2023-12-16 10:25:39 +08:00
Ibrahem Khalil f8e935c58d
Close chat when closing group chat details (#18149) 2023-12-15 20:28:30 +02:00
Ajay Sivan 5507ae4fa2
Community: Request to join - Show addresses shared (#18180) 2023-12-15 09:13:32 -08:00
Volodymyr Kozieiev 2a5c102b1c
Add collectible menu (#18185) 2023-12-15 15:37:08 +00:00
Parvesh Monu 9e27a36f5e
Fix empty chat in opened on pressing hashtag in a community channel (#18111) 2023-12-15 18:14:08 +05:30
Ajay Sivan 31dea1ca13
Quo Wallet/Required-Tokens Component (#18164) 2023-12-14 23:54:42 -08:00
Omar Basem 6f3bf98e83
Wallet: share address (#18121)
* wallet: share address
2023-12-15 08:11:06 +04:00
Mohamed Javid ed53fecf47
Added support for different currencies in wallet accounts price calculation (#18078)
This commit:

- adds support for different currencies in token price calculation in the new wallet UI.
- fixes the token units and prices displayed in the individual account screen

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-15 01:08:16 +05:30
flexsurfer 16a52b38e8
move input events (#18183) 2023-12-14 16:24:36 +01:00
Ajay Sivan c1a17d9d53
Show component name in quo preview header (#18175) 2023-12-14 04:43:06 -08:00
Lungu Cristian e790f7177d
Chat fixes based on design feedback (#18059)
* fix: chat header position when only a few messages

* fix: system_message add contact icon margin

* fix: fixed last grouped message vertical padding

* fix: show message user info on long press of grouped message

* feat: added mute button to chat's channel-actions

* fix: no custom color in message list background

* fix: composer placeholder color (light theme)

* draft: fix android initial chat position

* fix: scrolling chat to top changed content size

* fix: chat message list header animation and behavior

* fix: android initial chat state

* fix: adjusted the chat avatar animation position

* fix: chat content change with keyboard visible

* ref: small refactor and added some notes

* fix: removed broken require

* fix: mute label for channel chat

* fix: merge conflict fixes
2023-12-14 13:03:21 +02:00
Mohamed Javid b668e4dea4
[Feature] Wallet - Account Switcher for send flow (#18100)
This commit:

- adds another variant ("Select account" bottom sheet) of the account switcher for wallet - send flow
- adds watch-only? key in the account to prevent repetitive account type checks across the codebase

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-13 22:49:54 +05:30
Parvesh Monu 879a82c35f
Add comment related to refactoring (#18171) 2023-12-13 22:05:00 +05:30
flexsurfer 0eb424bb74
Feature/clean metro logs remove old wallet UI (#18165) 2023-12-13 16:11:30 +01:00
Mohsen 835e97d672
[#17518] fix: try again when sync has error outside the onboarding flow (#17890) 2023-12-13 14:40:33 +03:00
andrey 406904025d
remove extra sub 2023-12-13 12:15:57 +01:00
Alexander cb3a19f98f
#17945 Scanned address persists in ETH address textbox after reopening 'Add address to watch' screen (#17957) 2023-12-13 10:03:42 +01:00
Omar Basem 424a7b17b0
Wallet: Token item fixes (#18136)
* Wallet: token item fixes
2023-12-13 11:29:57 +04:00
Jamie Caprani 457c42c5f0
chore(wallet): add flow for selecting own accounts in send flows (#18071) 2023-12-12 05:38:21 -08:00
Nikolay 7564113cb5
feat(wallet) - implement network configuration on an account (#17862) 2023-12-12 05:22:51 -08:00
BalogunofAfrica f1bcc6259a
feat: finish enable notifications (#18084) 2023-12-12 13:46:01 +01:00
Parvesh Monu 0dd63490f8
Remove toggle for disabling shell navigation 2023-12-12 17:55:29 +05:30
Ajay Sivan e5179d308b
Add Test Networks Enabled option in settings (#17879) 2023-12-12 00:36:43 -08:00
codemaster fc8590a05f
fix: no avatar for the first message in 1-1 chat (#18099) 2023-12-11 12:13:16 -08:00
andrey e31db856df
ops 2023-12-11 20:47:57 +01:00
flexsurfer 5570181896
move reactions events (#18150) 2023-12-11 17:50:52 +01:00
Siddarth Kumar 761a7df06f
upgrade react-native to 0.72.5 (#17241)
This commit does many things :
- Upgrade `react-native ` to `0.72.5`
- Upgrade `react-native-reanimated` to  `3.5.4`
- Upgrade `react-native-navigation` to `7.37.0`
- `ndkVersion` has been bumped to `25.2.9519653`
- `cmakeVersion` has been bumped to `3.22.1`
- `kotlinVersion` has been bumped to `1.7.22`
- `AGP` has been bumped to `7.4.2`
- `Gradle` has been upgraded to `8.0.1`
- Android `CompileSDK` and `TargetSDK` have been bumped to 33
- `@react-native-async-storage/async-storage` has been upgraded to `1.19.3`
- `@walletconnect/client` has been nuked
- some of the old `react-native-reanimated` code has been nuked
- `react-native-keychain` fork has been replaced with `8.1.2`

- On Android we are currently relying on `Hermes` Engine.
- On iOS we are currently relying on `JSC`
- We are not enabling new architecture for now (I have plans for that in the future) ref: https://github.com/status-im/status-mobile/issues/18138

IOS only PR : https://github.com/status-im/status-mobile/pull/16721
Android only PR : https://github.com/status-im/status-mobile/pull/17062

- `make run-metro` now has a target of `android` which was `clojure` earlier, this will increase the time it takes to start metro terminal but this is needed otherwise you will get a nasty error while developing for android locally.
2023-12-11 21:22:23 +05:30
BalogunofAfrica f155d95d92
fix: 1:1 chat concerns (#17795) 2023-12-11 14:42:41 +01:00
yqrashawn 72f518d70b
feat: add encoded data for profile sharing url (#18019) 2023-12-11 20:35:39 +08:00
Ajay Sivan 3cd230fed0
Addresses to share cards (#18123) 2023-12-11 00:53:14 -08:00
Ulises Manuel 0ba057ae9d
[#17965] Create token component (#18018)
* Create token component

* Replace token images by new token component

The new component is being used in the following components:
 - token-input
 - network-amount
 - token-tag
 - summary-tag
 - context-tag
 - token-value
 - token-network
 - preview-list

* Rename token image file: eth-token -> eth

* Remove resources/get-token function
2023-12-08 14:13:11 -06:00
Ulises Manuel 8b919f4058
[#17896] Raw balances using big number (#17920)
* Add `utils.money/add` version able to work with `nil`s

* Store token raw-balance as big-number

* Improve account balance calculations using `utils.money` existing functions

* Update `:wallet/tokens-filtered` sub

* Make `prettify-balance` able to work with bignumbers
2023-12-08 13:40:26 -06:00
flexsurfer f79860fb97
move blob to rn, remove unused code, move images events to status-im2 (#18117) 2023-12-08 17:27:21 +01:00
Parvesh Monu 7a6f05a440
fix sometimes add contact screen is closed by itself after scanning QR code (#18101) 2023-12-08 18:53:56 +05:30
Ulises Manuel de4e233884
[#17974] text combinations - username component (#17987)
* Move docstring to be available while using `colors/resolve-color`
* Add text combinations - username component and tests
* Add username related svg icons
2023-12-07 17:44:24 -06:00
Jamie Caprani 55a99da2f5
feat: enable biometrics for standard-auth (#17992) 2023-12-07 08:44:16 -08:00
Parvesh Monu 9cf4556b9d
fix app is not opened on the last viewed chat after reopening (#18090) 2023-12-07 17:44:13 +05:30
flexsurfer 536ebf56cb
remove obsolete code (#18094) 2023-12-07 11:40:23 +01:00
Omar Basem dc587e493f
Wallet: generate new keypair UI (#18045)
* feat: new keypair flow ui
2023-12-07 09:43:36 +04:00
Omar Basem f692ae2222
Wallet: ENS (#18000)
* wallet: ens
2023-12-07 08:00:56 +04:00
frank aa89ebdb93
fix: Marking AC notification as read does not affect correspondent message in chat (#18058) 2023-12-07 10:16:25 +08:00
Brian Sztamfater 198a4d74a5
feat: transaction confirmation page ui (#17812)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-12-06 20:16:08 -03:00
Icaro Motta 03444ae4ff
Request to join screen - show modal title and community context tag (#18077) 2023-12-06 18:10:47 -03:00
Flavio Fraschetti 2bc7b62324
Communities - Display community rules at request to join (#18082)
This update introduces a feature that displays community rules to users as they join.
2023-12-06 13:21:17 -03:00
Roman Volosovskyi 195f0cfa40
Mark mnemonic as shown on revealing it to the user 2023-12-06 13:51:38 +01:00
Omar Basem ab61d8d5c0
Wallet: Set color and emoji (#17906)
* wallet: set color and emoji
2023-12-06 16:02:53 +04:00
mmilad75 aaf0b8e423
Implement transaction progress component (#17933)
* copy codes

* refactor preview

* refactor deprecated codes in view

* change condition structure in view-internal

* comment unused codes

* refactor title

* fix title style

* fix icon style

* fix context tag

* fix icon and row

* refactor icon-internal

* rename network-state and network-type

* fix progress-container style

* fix progress-box-container style

* fix progress container naming and style

* change progress-bar component

* fix progress box component

* convert to functional component and bring back the animation

* fix progress box for arbitrum-optimism network

* fix text-steps

* fix status-row

* refactor code style

* refactor get-network-text

* resolve comment

* add translations

* remove btn-title prop

* fix dark mode border color

* fix dark mode icon color

* move interval to preview

* add tests ns

* add tests

* fix lint issues

* fix rendering issue

* fix lint issue

* add arbitrum and optimism as separate networks

* create const for progress percentage

* fix progress bar component and preview

* refactor text-steps

* refactor names

* fix lint issues

* rename arbitrum-progress-percentage and optimism-progress-percentage

* update tests

* convert hard-coded color to customization-color

* fix progress_bar tests

* separate state for each network

* add progress percentage for each network and refactor params of functions

* separate epoch number for  each network

* update tests

* fix lint issues

* refactor codes

* fix lint issues

* resolve comments

* add confirmation progress

* use confirmation-progress component in transaction-progress

* fix preview

* add tests

* fix lint issue

* resolve comment

* refactor networks

* change sending state style

* update tests

* fix lint issues

* remove unused code

* add helper for calculate counter step

* add assoc-props to view-networks

* change text-internal props order

* fix colors/resolve-color usage

* refactor view codes

* add get-networks to preview

* add max-value to progress bar style

* remove threading macros in the previews

* remove inline functional components in the previews

* remove optimism-arbitrum checks in the view

* fix lint issues

* add max-progress and min-progress to confirmation-progress

* refactor text-steps

* fix counter structure in transaction-progress

* fix counter structure in confirmation-progress

* fix resolve-color usage

* fix lint issue

* fix tests

* resolve comments

* fix color issue

* fix margins

* fix lint issue
2023-12-06 14:09:52 +03:30
BalogunofAfrica 7e14846f0b
fix: use custom color for confirm select (#18068) 2023-12-06 05:10:08 +01:00
frank 5ebd133c63
group ens names with chain-id (#18001) 2023-12-06 10:04:39 +08:00
Icaro Motta 563f1c588d
Improve test failure readability (#18049)
Problem: failed equality checks as in "(is (= expected actual))" will give a
single, long line of output that for anything but the simplest data structures
is unreadable by humans, and the output doesn't give a useful diff.

Solution: use library https://github.com/nubank/matcher-combinators and its test
directive "match?" which will pinpoint where two data structures differ. Then,
instead of "(is (= ...", use "(is (match? expected actual)". It works
beautifully.

The library offers other nice matchers, but the majority of the time match? is
sufficient.

Can we use another test runner like Kaocha? kaocha-cljs2
(https://github.com/lambdaisland/kaocha-cljs2) would be able to print better
test errors out of the box, among other features, but I have no clue if it would
work well or at all in our stack (in theory yes, but it's a larger piece of
work).
2023-12-05 17:20:54 -03:00
Parvesh Monu 6ef113e821
fix messages are marked as read automatically in 1-1/group chats after opening a link (#18066) 2023-12-05 22:27:03 +05:30
Jamie Caprani c25f44c2a0
chore: make new wallet UI default, move set currency to legacy settings, remove add eth network on wallet init (#18027) 2023-12-05 06:35:27 -08:00
Alexander a4f1f23d3c
Style fixes for pinned messages (#18061)
* Style fixes for pinned messages

* Small code style update
2023-12-05 11:31:45 +01:00
flexsurfer fe20fa4e99
move transport (#18062) 2023-12-05 09:35:17 +01:00
Omar Basem 5c30fd847a
Wallet: account real data (#17821)
* wallet: account real data
2023-12-05 10:56:37 +04:00
John Ngei 64de325678
update scan qr code page
* update scan qr code page

* update scan qr code page

* fixed: populate the search input with new identity

* dismiss keyboard when scan qr page is activated
2023-12-05 02:56:27 +03:00
Volodymyr Kozieiev 489557c1a3
Match the changes in collectibles api in status-go (#18033) 2023-12-04 16:44:56 +00:00
Icaro Motta 439fdfa12c
Rename effects to :effects.*/* and move them to separate namespaces (#18047) 2023-12-04 12:55:57 -03:00
Mohsen f695dbf115
[#17909] fix: unhandled error when app launched in offline mode (#17973) 2023-12-04 17:48:45 +03:00
flexsurfer 64453716b0
rename onboarding 2 (#18060) 2023-12-04 14:49:05 +01:00
Mohamed Javid 56d135f1f8
Implemented Wallet - Account Switcher (#18003)
This commit:

- Implements the Wallet Account Switcher for easy switching between wallet accounts
- Updates the About tab in the accounts screen to display the correct account address and derivation path along with the profile.
- Updates the account-item component to pass the state from the parent and refactors the depreciated color functions
- Moves the handle-bar in the bottom sheet to a standalone component 
- Adds customization-color in account-origin component

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-04 18:47:03 +05:30
Mohsen a7178a4950
[#17572] fix: 'Join Community' notification is not getting dismissed (#17834) 2023-12-04 15:24:06 +03:00
Siddarth Kumar 3cd302b271
fix: get rid of `:redef-in-file` warning (#18053) 2023-12-04 14:18:43 +05:30
frank 8ff67bf344
fix: Cannot mark as read messages in communities (#18029)
* fix: Cannot mark as read messages in communities

* rename messenger-response to _messenger-response
2023-12-02 09:05:21 +08:00
Ulises Manuel 3fee21c73a
[#17923] text combinations - standard title component (#17939)
* Simplify tag components by turning them to from-1

* Add standard-title component, preview screen and tests
2023-12-01 15:49:49 -06:00
Jamie Caprani f9f328107d
chore: add ability to create watch address & some related ui changes on account page (#17868) 2023-12-01 04:29:01 -08:00
Alexander 52f7fc59ee
Updated `data-item`, monospaced & aligned address (#18008)
* Upd

* Fix
2023-12-01 10:03:08 +01:00
Mohamed Javid b5202b4d28
[Feature] Added activity check on entered watch address (#17970)
This commit 
 - implements the activity check for the entered watch address.
 - added warning colors
 - fixes bottom inset in add address to watch screen

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-12-01 00:28:09 +05:30
Lungu Cristian ed270b2162
Enabling biometry without password during sync (#17960)
* feat: added migration for the keychain hashed password

* feat: added sync biometry without password entry

* fix: biometry typo from develop

* ref: moved migration side-effects outside the event

* ref: some renaming for keychain migration

* ref: addressed @cammellos' review comments

* ref: removed unnecessary anon fn

* fix: addressed @ilmotta's review comments

* ref: removed theme from enable-biometrics

* ref: addressed J-Son89's review comments

* test: added tests for mask-data and hash-masked-password

* test: added schema to hash-masked-password and fixed test

* fix: forgot the threading

* ref: improved the masked data schema

* fix: no biometry error when canceled by user

* fix: biometry error wasn't propagated during login

* fix: alert dismiss button not passed properly

* fix: show biometrics NOT_ENROLLED error only once

* lint: removed unused require
2023-11-30 13:40:29 +02:00
Andrea Maria Piana d412fa3c63
Set up skeleton for communities request to join 2023-11-30 09:49:43 +00:00
Volodymyr Kozieiev bfa23c182f
Add requirement for component tests (#18015) 2023-11-29 18:50:49 +00:00
Mohsen 6b721265af
[#17986] feat: implement new settings ui, header section (#17991) 2023-11-29 20:54:11 +03:00
Jamie Caprani 589a581298
chore(wallet): add ui for send page (#17786) - merged in (#18017)
---------
Co-authored-by: Rende11 <artamonovn@gmail.com>
2023-11-29 05:12:21 -08:00
Parvesh Monu e5ce7fed3a
fix position of the last item in the community chat list and the position of the jump-to button (#17999) 2023-11-29 16:45:30 +05:30
Ibrahem Khalil 6ccea1ddb2
Continue button is invisible behind keyboard in Add Address To Watch … (#17940) 2023-11-28 18:38:06 +02:00
Alex Tumanov a9a17aaae8
Implement dropdown-input based on the original dropdown component (#17927) 2023-11-28 15:21:15 +00:00
Andrea Maria Piana 6d69c278cd
Update key in tests 2023-11-28 10:57:10 +00:00
frank d309aa366d
chore: specify light client mode for wakuv2 (#18002) 2023-11-28 14:48:58 +08:00
Jamie Caprani f124ca4252
chore(wallet): add common page-nav component for account switcher (#17946) 2023-11-27 09:16:31 -08:00
Brian Sztamfater 1385e27cf4
feat: select asset screen ui (#17780)
feat: select asset screen ui

Signed-off-by: Brian Sztamfater <brian@status.im>
2023-11-27 11:03:02 -03:00
Volodymyr Kozieiev f82d28c6c9
Show network info on collectible info page (#17980) 2023-11-27 12:29:12 +00:00
Omar Basem a2856cf1c3
Wallet: Emoji picker performance (#17891)
Wallet: Emoji picker navigation perf
2023-11-27 09:57:29 +04:00
alwx 671aa67002
Detect image dimensions correctly 2023-11-23 09:28:38 +00:00
Omar Basem dbc8df251a
Wallet: Keypair follow up (#17953)
* Wallet: Keypair follow up
2023-11-23 10:00:22 +04:00
Ulises Manuel 279993b658
Add channel-name component (#17903) 2023-11-22 15:54:52 -06:00
Volodymyr Kozieiev 0c1a18b444
Connect collectible overview page to backend (#17884) 2023-11-22 19:40:26 +00:00
Omar Basem 73e9f67dbd
Wallet: illustrations (#17931)
* wallet: illustrations
2023-11-21 10:55:46 +04:00
Jamie Caprani 86c5505c94
chore(wallet): hook up qr scanner on watch only flow. (#17829) 2023-11-19 16:26:00 -08:00
Icaro Motta c1dcd7a764
Introduce malli library (#17867)
This commit is the foundational step to start using malli
(https://github.com/metosin/malli) in this project.

Take in consideration we will only be able to realize malli's full power in
future iterations.

For those without context: the mobile team watched a presentation about malli
and went through a light RFC to put everyone on the same page, among other
discussions here and there in PRs.

To keep things relatively short:

1. Unit, integration and component tests will short-circuit (fail) when
   inputs/outputs don't conform to their respective function schemas (CI should
   fail too).
2. Failed schema checks will not block the app from initializing, nor throw an
   exception that would trigger the LogBox. Exceptions are only thrown in the
   scope of automated tests.
3. There's zero performance impact in production code because we only
   instrument. Instrumentation is removed from the compiled code due to the
   usage of "^boolean js.goog/DEBUG".
4. We shouldn't expect any meaningful slowdown during development.

**What are we instrumenting in this PR?**

Per our team's agreement, we're only instrumenting the bare minimum to showcase 2 examples.

- Instrument a utility function utils.money/format-amount using the macro
  approach.
- Instrument a quo component quo.components.counter.step.view/view using the
  functional approach.

Both approaches are useful, the functional approach is powerful and allow us to
instrument anonymous functions, like the ones we pass to subscriptions or event
handlers, or the higher-order function quo.theme/with-theme. The macro approach
is perfect for functions already defined with defn.

**I evaluated the schema or function in the REPL but nothing changes**

- If you evaluate the source function, you need to evaluate schema/=> or
  schema/instrument as well.
- Remember to *var quote* when using schema/instrument.
- You must call "(status-im2.setup.schema/setup!)" after any var is
  re-instrumented. It's advisable to add a keybinding in your editor to send
  this expression automatically to the CLJS REPL, or add the call at the end of
  the namespace you are working on (similar to how some devs add "(run-tests)"
  at the end of test namespaces).

**Where should schemas be defined?**

For the moment, we should focus on instrumenting quo components, so define each
function schema in the same namespace as the component's public "view" var.

To be specific:

- A schema used only to instrument a single function and not used elsewhere,
  like a quo component schema, wouldn't benefit from being defined in a separate
  namespace because that would force the developer to constantly open two files
  instead of one to check function signatures.
- A common schema reused across the repo, like ":schema.common/theme" should be
  registered in the global registry "schema.registry" so that consumers can just
  refer to it by keyword, as if it was a built-in malli schema.
- A common schema describing status-go entities like message, notification,
  community, etc can be stored either in the respective
  "src/status_im2/contexts/*" or registered globally, or even somewhere else.
  This is yet to be defined, but since I chose not to include schemas for them,
  we can postpone this guideline.
2023-11-18 11:04:48 -03:00
Jamie Caprani 2e2d15adfb
chore: add floating button page component (#17737)
Co-authored-by: Ulises M <ulises.ssb@hotmail.com>
2023-11-17 09:16:55 -08:00
John Ngei 88dd5e04bb
enable biometric when user signs in with syncing (#17627) 2023-11-17 17:58:51 +03:00
Lungu Cristian 8f8c8dede2
Composer collapsing when editing canceled/done (#17785)
* fix: composer height when entering and canceling edit

* fix: blur the composer input when canceling edit

* fix: focusing animation and composer height after blur

* fix: input height when canceling edit while unfocused

* ref: removed arbitrary keyboard check

* fix: moved edit-mentions logic to use-edit to fix unresolved mention

* fix: composer edit should put the cursor at the end

* fix: (potentially) fixing the mention not resolved during edit

* fix: emoji-kb handler changing the height when default kb appears

* Fix text content when editing and reentering chat

* prevent composer when focusing on opening chat with edit/reply

* clean

* Clauxx comments

* Apply for reply

* Lintil soup = yummy

* refactor variable name

* Extract the focusing logic from the data setting logic

* Edge case

* fix: composer mention key & edit re-enter issues

* fix: reply cancel input blur and smooth reply focus

---------

Co-authored-by: Ibrkhalil <vampirekid017@gmail.com>
2023-11-17 11:32:31 +02:00
Flavio Fraschetti ec4046e543
Hide channel list at token-gated communities overview (#17901)
This commit hides the categorized channel list for token-gated communities overview.
2023-11-16 10:46:17 +00:00
Icaro Motta b9353b1ccd
Fix: actually run integration tests (#17900)
Integration tests weren't running since https://github.com/status-im/status-mobile/pull/17762 was merged a week ago.

This commit also allows individual integration test namespaces to run if you change the :ns-regexp option in shadow-cljs. This is quite handy, since they are relatively slow.

Fixes https://github.com/status-im/status-mobile/issues/17895
2023-11-15 19:51:09 -03:00
flexsurfer 7153e4da48
[#17854] [IOS] The tutorial video animation keeps playing after openi… (#17915) 2023-11-15 16:24:27 +01:00
Icaro Motta c7cba5b4d3
Fix: unable to join token-gated communities (#17894)
Fixes the bug by explicitly passing all available addresses to be revealed
to wakuext_requestToJoinCommunity and picking up the first available address
as the airdrop address. This is a temporary solution while we work on the
feature to allow users to choose which addresses to expose.

Fixes https://github.com/status-im/status-mobile/issues/17861

*Areas that may be impacted*: join community flows.

    ----------------------------------------------------------------------
    Community "Request to join" option is enabled.
    User holds more than X ETH.
    Anyone who holds <X> ETH is allowed to Become member in <COMMUNITY>.
    
    Expected: request to join is received by desktop client and accepted,
    mobile user joins the community.
    ----------------------------------------------------------------------
    
    ----------------------------------------------------------------------
    Community "Request to join" option is enabled.
    User holds less than X ETH.
    Anyone who holds <X> ETH is allowed to View and post in <CHANNEL>.
    
    Expected: request to join is received by desktop client and accepted, mobile
    user joins the community, but can't post in <CHANNEL>.
    ----------------------------------------------------------------------
    
    ----------------------------------------------------------------------
    Community "Request to join" option is enabled.
    No token permissions.
    
    Expected: request to join is received by desktop client and accepted,
    mobile user joins the community.
    ----------------------------------------------------------------------
2023-11-15 06:39:12 -03:00
Ulises Manuel 45df308dd0
[#17823] Refactor tokens data app-db (#17880)
* Refactor edit-account view and events:

 - Fix `(fn [])` code style.
 - Avoid overriding clojure.core/type by destructuring the `:type` key.
 - Split the toast callback to a different function.
 - `:wallet/save-account` receives `:on-success` instead of `:callback` to improve readability.

* Refactor app-db for `:wallet/tokens` & `:wallet/tokens-loading?`

- Remove the root sub `:wallet/tokens-loading?`, now it's in app-db in `[:wallet :ui :tokens-loading?]`.
- Remove the root subs `:wallet/tokens`, now the value is returned along with the account data by the sub
  `:wallet/accounts`, it's stored in app-db in `[:wallet :address "0x..." :tokens]`.
- Fix the format of the token data returned by the endpoint `"wallet_getWalletToken"` and the fn `js->clj`,
    - Addresses are no longer keywords (since keywords mustn't start with a number).
    - Keys are now kebab-case.
    - Chain-ids are no longer keywords, now they are integers.
- Update tests.

* Move logic to calculate `:wallet/balances` and change value returned

- Move logic to `status-im2.contexts.wallet.common.utils`
- The `:wallet/balances` value returned by the sub had the following structure:
  [{:address "0x1...", :balance 12345}
   {:address "0x2...", :balance 67890} ...]
  This required a helper function to get the balance for an address (`get-balance-by-address`)
  It has been changed to a map:
  {"0x1..." 12345
   "0x2..." 67890, ...}
  So now we don't need a helper function (just the hashmap itself or `clojure.core/get`).
- Because of the previous change, now the `get-balance-by-address` has been removed.
- The function `get-account-by-address` has zero uses, so it has been removed.
- The test for the sub has been updated.

* Create sub `:wallet/account-cards-data`

This sub returns a vector of maps to render the account cards in the wallet page.
This logic was previously in the `view` namespace, but it was completely calculated from
the subs `:wallet/accounts`, `:wallet/balances` and `:wallet/tokens-loading?`, so it was
clear that's a derived value.
2023-11-14 10:54:26 -06:00
Brian Sztamfater a74c934936
feat: implement summary tag component (#17858)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-11-14 11:50:58 -03:00
andrey c150070cfe
remove empty files 2023-11-13 14:50:45 +01:00
Ibrahem Khalil 1b745857e8
[17634] Start rendering syncing UI ASAP (#17755)
* Start rendering syncing UI ASAP

* Consolidating values

* fix: show syncing ui immediately

* fix: error validation

---------

Co-authored-by: balogunofafrica <balogunakanbi.k@gmail.com>
2023-11-13 12:15:53 +01:00
Omar Basem 87c9946092
Wallet: Keypair Screen (#17775)
* wallet: keypair screen
2023-11-13 14:43:43 +04:00
Omar Basem f3e47ac1a2
Wallet: watch address - select random color (#17859)
Wallet: randomize color picker
2023-11-13 14:25:44 +04:00
yqrashawn b4919261cb
fix: nav conflicts when return from bg from link (#17853) 2023-11-10 09:15:02 +08:00
Icaro Motta ffeb06f36c
Communities - Token gated community fixes (#17799)
- Fix: when there are only channel token permissions, don't show the text "You
  hold 0 of these:" because there are no requirements to show.
- Fix: do not show channel token permissions when the user wants to join a
  community. In other words: only "become admin", "become member", "become token
  master", and "become token owner" are taken in consideration.
- Fix: render correct channel lock icon in 3 states (no permission, with
  permissions and locked and with permissions and unlocked).
- Fix: Previously, before having joined a community, all channels had a lock
  icon closed, now the lock icon is only closed when there's a permission set,
  otherwise no icon is shown (the lock is never open before the user joins the
  community).
- Fix: small UI spacing fix, only display community tags component when there's
  at least one tag.
- Bonus fix: community Overview and Discover screens top bar had a regression,
  see the screenshots.

Fixes https://github.com/status-im/status-mobile/issues/17267

### Areas that may be impacted

- Community overview, before and after joining a community.

### Steps to test

Code tested using the Goerli network and with the testnet flag enabled in the
Desktop client. Out of scope: minted tokens.
2023-11-09 20:19:26 -03:00
flexsurfer 69f87ce8b0
[#17611] move status-im.utils.universal-links.core (#17855) 2023-11-09 21:22:15 +01:00
Ajay Sivan e48a5c4e83
Quo community-stat component (#17851) 2023-11-09 04:39:42 -08:00
Mohamed Javid 595b1cfc40
[Fix] Move category selector height to emoji picker (#17844)
This commit moves the emoji categories selector height from the "showcase-nav" component to the "emoji-picker" as we should not use any "quo" ns (except "quo.core") inside the "status-im2" ns.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-11-08 23:56:56 +05:30
Volodymyr Kozieiev e573fc914a
Respect status-go API changes for collectibles request (#17857) 2023-11-08 18:01:33 +00:00
Mohamed Javid 6bb1779723
Implement edit account and refactor wallet accounts events & subs (#17798)
This commit updates the following:

- Allow users to create new wallet accounts without having to re-login (latest account data is fetched immediately)
- Updates the max length of the wallet account name to 20
- Updates the account cards in the wallet home screen to render the actual account colour
- Updates the (individual) account screen to show the correct color, emoji, name and address
- Allows users to edit account name, colour and emoji
- The rest of the wallet screens would see the updated account information immediately
- Fixes the color (uses profile color) of the context tag and button color in the authentication (enter password) bottom sheet
- Fixes the overflowing of the "+" card in the wallet home when there are two or more accounts.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-11-08 20:09:32 +05:30
codemaster 742c451000
fix: message content text alignment and spacing (#17606) 2023-11-08 05:40:26 -08:00
Alex Tumanov 569036c1d8
Add a button to address watch screen; (#17781)
Add account creation screen

remove icons

remove extra utility and create a new one that would use conventional way of getting an emoji

fix lint

Use button component instead of bottom-actions

Provide global customization color to buttons

Use conventional approach to extract account name

Move to another address

Move to another namespace

Refactor bottom-actions to have button props in maps

Update doc with new icon location

Add spaces between styles

Work on pr comments

Use :on-change-text instead of :on-change for input component
Subscribe to :profile/customization-color directly
Use bottom button from the create-or-edit-account wrapper

Remove extra code
Sort requires

Move ns to proper fileˆ

Fix styles
2023-11-07 16:40:24 +00:00
Brian Sztamfater 188f7f461e
feat: address (mocked) suggestions (#17579)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-11-07 12:04:37 -03:00
David Martin cb005afff2
Split up integration tests (#17762) 2023-11-07 16:47:02 +05:30
Omar Basem a6d7502455
Wallet: bridge screen (#17758)
* wallet: bridge screen
2023-11-07 07:22:38 +04:00
yqrashawn 701df811b0
feat: lint direct require quo component outside src/quo (#17828) 2023-11-07 10:21:58 +08:00
Dmitri Akatov b47c97a4fd
Mark utils.re-frame/defn as deprecated (#17788)
Also suggest to use utils.re-frame/reg-event-fx instead of utils.re-frame/defn
2023-11-06 19:09:40 -03:00
Volodymyr Kozieiev 4490676398
Collectibles list on accounts page connected to backend (#17751)
* Collectibles list displayed
2023-11-06 16:39:49 +00:00
Ibrahem Khalil ee019f79f2
Show success toast when user joins community. (#17815) 2023-11-06 16:22:15 +02:00
Alexander dc571b6067
Getting rid of status-im.multiaccounts.core + removing three word random names (#17384) 2023-11-06 14:38:14 +01:00
Dmitri Akatov fb8a7d2d8e
proper use of ens-username-owned-continue translation key (#17819) 2023-11-06 09:00:00 +01:00
Dmitri Akatov ac8458d304
remove outdated i18n-test namespace (#17816) 2023-11-06 08:59:34 +01:00
Ajay Sivan aa6d44bee1
Adapt to status-go API Changes for Request to Join Community Flow (#17800) 2023-11-03 08:57:56 -07:00
Ibrahem Khalil 132e53844c
New TopBar animation (#17582) 2023-11-03 14:20:10 +02:00
Mohsen 8d3558f1c3
[#17647] fix: generate keys title overlap (#17752) 2023-11-03 14:35:42 +03:00
Alex Tumanov 0eef5204c8
Implement wallet user avatar to match designs (#17703) 2023-11-02 20:29:09 +01:00
Mohamed Javid 9a5ed62e1f
[Refactor] selectors component (#17763)
This commit updates the following in the selectors component:

- Introduces the "type" prop (Figma 1-1 property) to the selectors component for easy switching between the selector types while using it on lists.
- Updates the component styles to use the "resolve-color" function as the "custom-color" function is deprecated
- Updates the component usage across the codebase

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-11-02 23:54:59 +05:30
flexsurfer e6068fd4c1
small ns changes (#17793) 2023-11-02 14:23:34 +01:00
yqrashawn 859cb19886
fix(universal-link): more new link format, handle old link format (#17721)
Co-authored-by: pavloburykh <pavlo@status.im>
2023-11-02 15:31:49 +08:00
Omar Basem 2d92b515b8
Documentation: composer (#17756)
* Docs: composer
2023-11-02 08:53:22 +04:00
Icaro Motta 972e1eee01
Composer - Fix conflicting touchable and gesture (#17680)
Fix the unreliable swipe behavior of link previews in the chat composer. In many
occasions, we noticed the horizontal scroll wasn't being triggered properly or
not at all. In other occasions, the swipe gesture would incorrectly register a
press on the parent `Touchable` component.

Fixes https://github.com/status-im/status-mobile/issues/16599
2023-11-01 13:31:14 -03:00
Ibrahem Khalil 6c2b437e62
Follow up to fix color picker on wallet (#17748) 2023-11-01 15:18:53 +02:00
Nikolay 94a3e266a9
Edit derivation path (#17741) 2023-11-01 14:04:21 +01:00
Lungu Cristian 716007dc3c
fix: removed bounce from lightbox text-sheet (#17664)
fix: improving UI and gestures

fix: expanding on press now works reliably

fix: center text and disable gestures for short messages

feat: added styling for one-lined messages

fix: small opacity fix

ref: small condition change

fix: horizontal swiping being unreliable with vertical scrolling

ref: reusing shared value from lightbox animations

fix: text-sheet bottom gradient not visible on android

fix: addressed qa issues 1,2,4

fix: zoomable-image stuck if moved vertically when full screen

clean: removed unused var

chore: removed unused require

fix: don't allow returning text-sheet down and up in one move

fix: text-sheet bar styling was wrong

fix: adjusted gradient animation with designs

fix: text-sheet bar opacity
2023-11-01 13:20:10 +02:00
Mohsen 233d1b3261
[#17288] refactor: migrate previews to new api (#17776) 2023-11-01 11:31:32 +03:00
Yevheniia Berdnyk 25381b601f
e2e: test for sending image with camera 2023-10-31 23:23:04 +02:00
Ulises Manuel 4a874ce48d
[#17023] Share qr code variants (#17736)
* Align docstring

* Create share-qr-code component

* Remove empty style file

* Implement common.share-qr-code including call to media server

* Add share-qr-code preview screen

* Use share-qr-code component in shell's share screen

* Add tests and some fixes
2023-10-31 12:35:28 -06:00
mmilad75 ca822ff51d
Connect Wallet Home Page to backend - Accounts card (#17447)
* add functionality

* fix lint issues

* change class component to functional component

* fix refactor-data function

* rename events and fix reagent-render structure

* change rf/defn to re-frame/reg-event-fx

* convert camelCase to kebab-case

* refactor on-error callback

* refactor on-success callback

* replace merge with assoc and conj

* refactor calculate-balance structure

* rename reagent-render

* move calculate-balance into a sub

* use created sub in the view

* fix lint issues

* move calculate-balance function to wallet sub

* change on-success callback

* revert podfile.lock

* remove extra line

* add template for test

* edit calculate-balance and calculate-raw-balance

* add tests

* revert podfile.lock and fix lint issues

* rename refactor-data

* add toFixed to get-balance

* fix lint issues

* finalize code

* replace re-frame/reg-event-fx with rf/defn

* resolve comments

* remove use-fixtures in the test

* break down calculate-balance

* fix lint issues

* fix placeholder color

* move accounts to view-internal

* remove accounts param in wallet-2/get-wallet-token

* Connect Wallet Account Page to backend (basic) (#17700)

* pass address to wallet-accounts screen

* move get-balance-by-address to common/utils

* add functionality

* fix lint issues

* move logic to sub

* convert filter+first to some

* change code structure

* rename wallet-2 to wallet

* add tests

* fix lint issues

* fix style

* remove unused code

* remove view-internal defn

* fix lint issues

* fix networks param issue

* fix .toFixed issue
2023-10-31 21:48:21 +03:30
Mohamed Javid dd8beeb848
[Fix] "network-routing" component test (#17760)
This commit moves the "network-routing" component test to the quo ns from quo2 ns.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-10-30 20:51:31 +05:30
Ajay Sivan abbf29d4ca
Remove all status-im.ui.components.react usages in status-im2 (#17750) 2023-10-30 06:37:28 -07:00
Parvesh Monu cebec10aa5
fix bottom message in the chat history is hidden behind the composer with an image in it (#17757) 2023-10-30 15:46:16 +05:30
Omar Basem 68ad4fe086
Wallet: Address Text (#17732)
* Wallet: address text
2023-10-30 09:40:39 +04:00
Jamie Caprani 06c31f3a12
chore: add sub to get network info (#17650) 2023-10-27 03:54:58 -07:00
Lungu Cristian 954373105d
Visual debugging of components (#17729)
* feat: debug/show components from the REPL

* ref: some renames and cleanup

* chore: removed comments/imports

* feat: added remount on every eval & small changes

* doc: added tip to debugging doc

* doc: formatting

* doc: more formatting

* fix: fixed docs and other review comments

* fix: moved & renamed into the dev.component-preview ns

* style: adjusted debugging readme spacing

* fix: removed trailing line
2023-10-27 13:14:01 +03:00
Mohsen 2aeafa30bd
[#17423] fix: update sync flow (#17731) 2023-10-27 11:16:56 +03:00
Ulises Manuel 1f71883fa4
[#16755] - Network routing component (#17457)
* Add network routing component & animations
* Add basic tests and accessibility labels
2023-10-26 16:07:44 -06:00
mmilad75 6ebd5b421c
Fix account-card component UI (#17589)
* add new type

* fix lint issues

* add tests

* refactor get-test-data function

* resolve comments

* fix imports

* resolve comments

* fix lint issues

* remove extra code

* fix height
2023-10-26 16:46:24 +03:30
Ibrahem Khalil 901644e023
Make color selector take full 0device width to match Figma and add dynamic width (#17465) 2023-10-26 13:20:40 +03:00
Mohsen df256bf2b4
[#17534] fix: Add contact scan QR screen back handler issue (#17694) 2023-10-26 12:38:47 +03:00
Jamie Caprani 56492949f1
feat (wallet): add ability to create new account (#17496) 2023-10-26 01:45:33 -07:00
frank ab2ad0ec12
Don't sync AC notifications, only decisions/state (#17600)
* fix outgoing contact request state not show correctly

* update status-go-version.json
2023-10-26 14:44:06 +08:00
Ibrahem Khalil fe2272b703
Fix Composer not focusing on edit/reply (#17640) 2023-10-26 05:43:49 +03:00
Nikolay 876b020a32
Token network component (#17667) 2023-10-25 13:35:42 -07:00
Omar Basem 125c117bac
wallet: token value drawer (#17730)
* wallet: token value drawer
2023-10-25 15:45:45 +04:00
Parvesh Monu 078976806a
Don't display "Add Unknown as contact to send a Message" if chat is not loaded (#17704) 2023-10-25 16:38:01 +05:30
Omar Basem 07dd42a7d3
Wallet: Network Preferences drawer (#17710)
* Wallet: Network Preferences drawer
2023-10-25 14:55:17 +04:00
Ajay Sivan 3197adf855
Refactor tag preview screens to new api (#17549) 2023-10-25 03:19:37 -07:00
Ibrahem Khalil 8296bda85b
Fix recent album not showing count (#17498) 2023-10-24 17:23:16 +03:00
flexsurfer ca2b3abb1c
old wallet fixes (#17697) 2023-10-24 15:36:10 +03:00
Ibrahem Khalil b910f05286
Update `react-native-camera-kit` to latest beta to enable programmitcal zooming (#17708) 2023-10-24 11:48:36 +03:00
Mohsen c42fc5153d
[#17288] refactor: migrate previews to new api (#17695) 2023-10-23 20:40:22 +03:00
codemaster 221c501279
fix: remove qa-only features(unicorn, skull) (#17594) 2023-10-23 22:33:09 +10:00
yqrashawn 04a7f76271
feat: support new universal/deep link format (#17480) 2023-10-22 09:50:48 +08:00
Icaro Motta ca6fd3df66
Upgrade Clojure libraries (#17690)
Upgrades and cleans up all production Clojure dependencies and 1 dev-only
dependency (com.taoensso/tufte).

- Remove warning "WARNING: update-keys already refers to:
  #'clojure.core/update-keys in namespace: io.aviso.exception"
- Remove hickory and mvxcvi/alphabase dependencies they are not used.
- Upgrade com.taoensso/tufte from 2.1.0 to 2.6.3
- Upgrade transit-cljs from 0.8.248 to 0.8.280
- Upgrade cljs-bean from 1.3.0 to 1.9.0
- Remove workaround for com.taoensso/timbre in shadow-cljs.edn
- Upgrade com.taoensso/timbre from 4.10 (Status fork) to 6.3.1
2023-10-20 20:47:23 -03:00
Lungu Cristian 337b1d77d0
fix: crash when selecting photos from cameraroll (#17691) 2023-10-20 22:19:44 +03:00
R Adithya Kumar 7642adf32c
[#17395] Temporarily disables image options in edit mode (#17488)
Co-authored-by: Lungu Cristian <lungucristian95@gmail.com>
2023-10-20 14:02:31 +03:00
flexsurfer 4a8a23a4c4
rename to wallet-legacy (#17673) 2023-10-19 13:50:55 +02:00
Ajay Sivan e71c167e8a
Fix: Messages/Author component text overflow (#17414) 2023-10-19 00:48:42 -07:00
Mohamed Javid d5da921e1c
Implement Edit Wallet Account Screen (base) (#17637)
This commit

- Adds the base Screen base for the Create/Edit Account/Address
- Adds the Wallet Edit Account screen
- Adds the gradient in the account options bottom sheet
- Adds a new key/prop "right-icon" in the data-item component to prevent overlapping with the icon used in the description and updates its usage.
- Updates the "section-label" component to receive "container-style" (this will prevent adding a wrapping view in the screens)

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-10-18 17:38:58 +05:30
Omar Basem f19ec2a93f
Wallet: Buy Tokens drawer (#17654)
* Wallet: buy tokens drawer
2023-10-18 15:24:25 +04:00
Ulises Manuel b6e2e8cba4
[#16858] Input text multiline height (#17536)
* Fix preview screen receiving wrong parameter
* Fix input multiline style on iOS and counter label always showed
* Fix icon metadata and wrong values passed to svg icons
* Use quo/input in add contact sheet
2023-10-17 16:45:03 -06:00
Brian Sztamfater 5829eaf77b
feat: scan account from QR (#17464)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-10-17 13:47:21 -03:00
Parvesh Monu e6e29a8521
Implement animations for discover communities screen 2023-10-17 21:48:46 +05:30
flexsurfer 6f9bcd1bb1
rename quo2 (#17660) 2023-10-17 17:27:18 +02:00
Mohsen fc284f466f
[#17507] fix: image placeholder issue in create-profile (#17645) 2023-10-17 17:28:00 +03:00
yqrashawn 428d79607e
fix: long press & bg color animation for deleted message (#17428) 2023-10-17 13:29:47 +08:00
Omar Basem be6b02304b
Wallet: Activity Tab (#17643)
* Wallet: activity tab
2023-10-17 08:00:22 +04:00
Icaro Motta 7ae96e86f1
Enable ns sorting linter and clean+sort all namespaces (#17618) 2023-10-16 22:03:18 +00:00
flexsurfer 27cd7d4edd
remove quo lib (#17626) 2023-10-16 18:34:00 +02:00
Mohsen ff2dfe1a2f
[#17533] fix: 'Sign in' page overlaps 'Main' page (#17608) 2023-10-16 17:57:47 +03:00
Alex Tumanov 024f053af8
implement bottom actions component (#17190) 2023-10-16 07:07:28 -07:00
flexsurfer b970b723a5
move legacy subs step 1 (#17648) 2023-10-16 15:47:20 +02:00
Mohsen ea8b8d142b
[#17288] refactor: migrate previews to new api (#17624) 2023-10-16 11:52:58 +03:00
Jamie Caprani dd20d8896f
remove custom-color-by-theme method, add resolve-color method (#17567) 2023-10-16 01:20:37 -07:00
Icaro Motta 9078c3b61b
Composer - Link previews - Adjust for upcoming API breaking changes in status-go (#17573)
Adapt the JSON RPC response to the new shape returned by `wakuext_unfurlURLs` on
v0.170.0. The changes were introduced PR
https://github.com/status-im/status-go/pull/4033. There are no behavioral
changes in the API as far as mobile is concerned at the moment.
2023-10-13 17:10:38 +00:00
Omar Basem a2794a120a
Wallet: Account Options (#17612)
* wallet: account options
2023-10-13 17:19:14 +04:00
BalogunofAfrica 65e37feb17
fix: chat over scroll (#17568) 2023-10-13 12:44:48 +01:00
flexsurfer ca88de162a
[#17435] migrate status-im.notifications (#17603) 2023-10-13 12:40:50 +02:00
Brian Sztamfater edd6b8d62c
feat: implement address list item component (#17617)
Signed-off-by: Brian Sztamfater <brian@status.im>
2023-10-12 14:59:34 -03:00
BalogunofAfrica 6f8a7bb151
fix: image preview padding (#17545)
* fix: image preview padding

* fix: clear icon

* fix: revert clear icon color
2023-10-12 17:13:04 +01:00
Jamie Caprani 1b348943be
Quo2: add tags/ tiny tag component (#17613)
Co-authored-by: Rende11 <artamonovn@gmail.com>
2023-10-12 04:49:02 -07:00
Icaro Motta 7f960f9be5
Add custom linter for i18n/label translation keywords (#17610)
This commit adds a custom linter to verify i18n/label is called with a qualified
keyword, like :t/foo. More sophisticated linters are possible too.

We also set the stage for other developers to consider more lint automation
instead of manually reviewing conventions in PRs.

If you want to understand how to write custom linters, check out
https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md. You can fire
the Clojure JVM REPL in status-mobile and play with the clj-kondo hook too, it
works beautifully.

Why do we care? By making sure all translation keywords are qualified with "t",
it is trivial to grep or replace them because they're unique in the repo, and
can't be confused with other words if you search by ":t/<something>".

Note: It's a best practice to commit clj-kondo configuration from external
libraries in the .clj-kondo directory. The directory .clj-kondo/babashka is
auto-generated, that's why it was added.
2023-10-11 18:53:34 -03:00
Mohamed Javid 54e347eaea
Bottom Sheet Fixes (#17609)
This commit fixes the following issues in the bottom sheet:

- the sheet is cut off at the bottom in the shell (dark blur) theme (the drawers in the onboarding/login flow)
- the incorrect background in the shell (dark blur) theme (the drawers in the onboarding/login flow)
Bug	
- the spacing at the bottom is doubled
- the gradient cover is not shown in the bottom sheet
- the spacing between the selected item and the bottom sheet
- the bottom sheet type in "Create Profile" and "Activity Center" screens

---------

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-10-11 22:05:07 +05:30
John Ngei 5ceca3201d
remove left over logs 2023-10-11 17:09:42 +03:00
Jamie Caprani b532966e85
chore: slider button - add error type, blur variant and fix small ui bug (#17473) 2023-10-11 03:39:26 -07:00
Volodymyr Kozieiev 919ee4b9ab
wallet activity design followup fixes (#17590) 2023-10-10 14:54:26 +01:00
Omar Basem d664653921
Wallet: dApps Tab (#17587)
* feat: dapps tab
2023-10-10 16:28:05 +04:00
Mohsen 36dd828a55
[#17446] fix: Display name is not shown in chats after sync (#17591) 2023-10-10 14:36:40 +03:00
Omar Basem bcc175041a
Wallet: About Tab (#17556)
* wallet about tab
2023-10-10 09:30:10 +04:00
Ibrahem Khalil d4cc0189d2
Disable scroll to the bottom button when composer is active. 2023-10-09 20:33:20 +03:00
Volodymyr Kozieiev 1770ff24ce
Collectible details page (#17520)
Collectible details page
2023-10-09 14:18:43 +01:00
Lungu Cristian 265d9be6c2
Follow-up quo2 reaction selector components (#17304)
* ref: refactored react/react-selector/reactions-selector

feat: added preview multi-select descriptor

feat: finished component

ref: fixed linting

feat: added pinned styles to all reactions

lint: fixed linting

ref: preview customizer for reactions-selector

lint: fixed linting

fix: preview select bg

ref: destructured reaction

* feat: added pinned prop in chat messages

* fix: removed status_im2 require inside quo2 component

* fix: addressed review comments

* lint: fixed linting

* fix: added missing theme arg to theme-color

* chore: removed unnecessary FIXME

* fix: message reactions not working on press
2023-10-09 12:44:12 +03:00
Lungu Cristian b432aab701
Changes to onboarding/new-to-status (quo/fonts/spacings/copy) (#17562)
* fix: changes to onboarding/new-to-status (quo/fonts/spacings/copy)

* e2e: updated button  locator

---------

Co-authored-by: Yevheniia Berdnyk <ie.berdnyk@gmail.com>
2023-10-09 10:45:28 +03:00
Ulises Manuel 1abd1e9420
[#16329] QR code variants (#17221)
* Rename wallet-user-avatar's `:color` prop to `:customization-color`
* Refactor QR code component and implement all variants
  - Improve preview screen
* Update QR code usages
* Remove `status-im2.common.qr-code-viewer.view/qr-code-view` component
to keep only one implementation.
* Remove the node dependency:
  "qrcode": "^1.4.1"
2023-10-08 17:42:58 -06:00
Ibrahem Khalil 4dc834b079
Faded first line of composer (#17489) 2023-10-07 11:12:10 +03:00
Mohamed Javid c6a9148e20
[Fix] SVG Icon color (#17561)
This commit fixes the "X" mark in the clear icon displayed in inputs and URL preview components by updating the props for "svg-icon" to add the "color" and "color-2" keys only if it's present and valid.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
2023-10-07 13:20:44 +05:30
BalogunofAfrica b88dcf1072
fix: back button on 1:1 chat (#17544)
* fix: back button on 1:1 chat

* fix: show close icon only for 1:1 and community chat

* fix: use close icon for only 1:1 chat
2023-10-06 12:47:29 +01:00
yqrashawn afbd890a04
fix: several bugs in 1.25 design feedback (#17548) 2023-10-06 15:32:33 +08:00
John Ngei 933a5a1a9e
1-1 chats bug fixes
* removed horizontal padding for separator line

* fixed: page-nav button backgrounds visibility

* updated top margin

* updated selected item top margin

* fixed: author and  message margins
2023-10-06 00:45:26 +03:00
Icaro Motta 6e897f0ea6
Migrate away from rf/defn and rf/merge (first step) (#17451)
This commit shows how to move away from rf/defn
f12c7401d1/src/utils/re_frame.clj (L1-L90)
& rf/merge
f12c7401d1/src/utils/re_frame.cljs (L39-L85)
and why we should do it.

## Problems

Before jumping to solutions, let's understand the problems first, in no order of
importance.

### Problem 1: Cyclic dependencies

If you ever tried to move event handlers or the functions used inside them to
different files in status-mobile, you probably stumbled in cyclic dependency
errors.

When an event is registered in re-frame, it is globally available for any other
place to dispatch. The dispatch mechanism relies on globally unique keywords,
the so called event IDs, e.g. :chat/mute-successfully. This means that event
namespaces don't need to require other event namespaces, just like you don't
need to require subscription namespaces in views.

rf/merge increases the likelihood of cyclic dependencies because they force
event namespaces to require each other. Although not as common, this happened a
few times with devs in the team and it can be a big hassle to fix if you are
unlucky. It is a problem we should not have in the first place (at least not as
easily).

### Problem 2: We are not linting thousands of lines of code

The linter (clj-kondo) is incapable of understanding the rf/defn macro. In
theory, we could teach clj-kondo what the macro produces. I tried this, but gave
up after a few tries.

This is a big deal, clj-kondo can catch many issues and will continue to catch
more as it continue to evolve. It's hard to precisely count how many lines are
affected, but `find src/ -type f -name 'events.cljs' -exec wc -l {} +` gives us
more than 4k LOC.

### Problem 3: Blocking RN's UI thread for too long

Re-frame has a routing mechanism to manage events. When an event is dispatched,
it is enqueued and scheduled to run some time later (very soon). This process is
asynchronous and is optimized in such a way as to balance responsiveness vs the
time to empty the queue.

>[...] when processing events, one after the other, do ALL the currently queued
>events. Don't stop. Don't yield to the browser. Hog that CPU.
>
>[...] but if any new events are dispatched during this cycle of processing,
>don't do them immediately. Leave them queued.
>
>-- https://github.com/day8/re-frame/blob/master/src/re_frame/router.cljc#L8-L60

Decisions were made (way back in 2017) to reduce the number of registered
re-frame events and, more importantly, to coalesce events into bigger ones with
the rf/merge pattern. I tried to find evidence of real problems that were trying
to be solved, but my understanding is that decisions were largely based on
personal architectural preferences.

Fast-forward to 2023, and we are in a situation where we have many heavy events
that process a LOT of stuff in one go using rf/merge, thus blocking the UI
thread longer than we should. See, for example,
[status-im2.contexts.profile.login.events/login-existing-profile](3082605d1e/src/status_im2/contexts/profile/login/events.cljs (L69)),
[status-im2.contexts.profile.login.events/get-chats-callback](3082605d1e/src/status_im2/contexts/profile/login/events.cljs (L98)),
and many others.

The following excerpt was generally used to justify the idea that coalescing
events would make the app perform better.

> We will reduce the the amount of subscription re-computations, as for each
> distinct action, :db effect will be produced and swapped into app-db only once
>
> -- https://github.com/status-im/swarms/issues/31#issuecomment-346345981

This is in fact incorrect. Re-frame, ever since 2015 (so before the original
discussions in 2017) uses a concept of batching to process events, which means
subscriptions won't re-run after every dispatched event, and thus components
won't re-render either. Re-frame is smarter than that.

> groups of events queued up will be handled in a batch, one after the other,
> without yielding to the browser (previously re-frame yielded to the browser
> before every single event).
>
> -- 39adca9367/docs/releases/2015.md (050--2015-11-5)

Here's a practical example you can try in a shadow-cljs :mobile REPL to see the
batching behavior in practice.

```clojure
;; A dummy event that toggles between DEBUG and INFO levels.
(re-frame/reg-event-fx :dummy-event
  (fn [{:keys [db]}]
    {:db (update-in db
                    [:profile/profile :log-level]
                    (fn [level]
                      (if (= "DEBUG" level)
                        "INFO"
                        "DEBUG")))}))

(def timer
  (js/setInterval #(re-frame/dispatch [:dummy-event])
                  50))

;; 1. In component status-im.ui.screens.advanced-settings.views/advanced-settings,
;; add a print call to see when it's re-rendered by Reagent because the
;; subscription :log-level/current-log-level will be affected by our dummy event.
;;
;; 2. Also add a print call to the subscription :log-level/current-log-level to
;; see that the subscription does NOT re-run on every dispatch.

;; Remember to eval this expression to cancel the timer.
(js/clearInterval timer)
```

If you run the above timer with 50ms interval, you'll see a fair amount of
batching happening. You can infer that's the case because you'll see way less
than 20 print statements per second (so way less than 20 recomputations of the
subscription, which is the max theoretical limit).

When the interval is reduced even more, to say 10ms (to simulate lots of
dispatches in a row), sometimes you don't see a single recomputation in a 5s
window because re-frame is too busy processing events.

This shows just how critical it is to have event handlers finishing as soon as
possible to relinquish control back to the UI thread, otherwise responsiveness
is affected. It also shows that too many dispatches in a row can be bad, just as
big event handlers would block the batch for too long. You see here that
dispatching events in succession does NOT cause needless re-computations.

Of course there's an overhead of using re-frame.core/dispatch instead of calling
a Clojure function, but the trade-off is clearly documented: the more we
process in a single event, the less responsive the app may be because re-frame
won't be able to relinquish control back to the UI thread. The total time to
process the batch increases, but re-frame can't stop in the middle compared to
when different dispatches are used.

Thus, I believe this rf/merge pattern is harmful as a default practice in an
environment such as ours, where it's desirable end-users feel a snappy RN app. I
actually firmly believe we can improve the app's responsiveness by not
coalescing events by default. We're also preventing status-mobile from taking
the most advantage from future improvements in re-frame's scheduler. I can
totally see us experimenting with other algorithms in the scheduler to best fit
our needs. We should not blindly reduce the number of events as stated here
https://github.com/status-im/status-mobile/pull/2634#discussion_r155243127.

Solution: only coalesce events into one pile when it's strictly desirable to
atomically update the app db to avoid inconsistencies, otherwise, let the
re-frame scheduler do its job by using fx, not rf/merge. When needed, embrace
*eventual app db consistency* as a way to achieve lower UI latency, i.e. write
fast and short events, intentionally use :dispatch-later or other timing effects
to bend the re-frame's scheduler to your will.

There's another argument in favor of using something like rf/merge which I would
like to deconstruct. rf/merge gives us a way to reuse computations from
different events, which is nice. The thing here is that we don't need rf/merge
or re-frame to reuse functions across namespaces. rf/merge complects re-frame
with the need to reuse transformations.

Instead, the solution is as trivial as it gets, reuse app db "transformers"
across events by extracting the logic to data store namespaces
(src/status_im/data_store). This solution has the added benefit of not causing
cyclic dependency errors.

### Problem 4: Clojure's language server doesn't understand code under rf/defn

Nowadays, many (if not most) Clojure devs rely on the Clojure Language Server
https://github.com/clojure-lsp/clojure-lsp to be more effective. It is an
invaluable tool, but it doesn't work well with the macro rf/defn, and it's a
constant source of frustration when working in event namespaces. Renaming
symbols inside the macro don't work, finding references, jumping to local
bindings, etc.

Solution: don't use rf/defn, instead use re-frame's reg-event-fx function and
clojure-lsp will understand all the code inside event handlers.

### Problem 5: Unit tests for events need to "test the world"

Re-frame's author strongly recommends testing events that contain non-trivial
data transformations, and we do have many in status-mobile (note: let's not
confuse with integration tests in status_im/integration_test.cljs). That, and
non-trivial layer-3 subscriptions should be covered too. The reasoning is that
if we have a well developed and tested state layer, many UI bugs can be
prevented as the software evolves, since the UI is partially or greatly derived
from the global state. See re-frame: What to Test?
39adca9367/docs/Testing.md (what-to-test).
See PR Introduce subscription tests
https://github.com/status-im/status-mobile/pull/14472, where I share more
details about re-frame's testing practices.

When we use rf/merge, we make unit testing events a perennial source of
frustration because too many responsibilities are aggregated in a single event.
Unfortunately, we don't have many devs in the team that attempted to write unit
tests for events to confirm my claim, but no worries, let's dive into a real
example.

In a unit test for an event, we want to test that, given a cofx and args, the
event handler returns the expected map of effects with the correct values
(usually db transformations).

Let's assume we need to test the following event. The code is still using the
combo rf/defn & rf/merge.

```clojure
(rf/defn accept-notification-success
  {:events [:activity-center.notifications/accept-success]}
  [{:keys [db] :as cofx} notification-id {:keys [chats]}]
  (when-let [notification (get-notification db notification-id)]
    (rf/merge cofx
              (chat.events/ensure-chats (map data-store.chats/<-rpc chats))
              (notifications-reconcile [(assoc notification :read true :accepted true)]))))
```

As you can see, we're "rf/merging" two other functions, namely ensure-chats and
notifications-reconcile. In fact, ensure-chats is not registered in re-frame,
but it's 99% defined as if it's one because it needs to be "mergeable" according
to the rules of rf/merge. Both of these "events" are quite complicated under the
hood and should be unit tested on their own.

Now here goes the unit test. Don't worry about the details, except for the expected output.

```clojure
(deftest accept-notification-success-test
  (testing "marks notification as accepted and read, then reconciles"
    (let [notif-1          {:id "0x1" :type types/private-group-chat}
          notif-2          {:id "0x2" :type types/private-group-chat}
          notif-2-accepted (assoc notif-2 :accepted true :read true)
          cofx             {:db {:activity-center {:filter        {:type types/no-type :status :all}
                                                   :notifications [notif-2 notif-1]}}}

          expected {:db         {:activity-center {:filter        {:type 0 :status :all}
                                                   :notifications [notif-2-accepted notif-1]}
                                 :chats           {}
                                 :chats-home-list nil}
                    ;; *** HERE ***
                    :dispatch-n [[:activity-center.notifications/fetch-unread-count]
                                 [:activity-center.notifications/fetch-pending-contact-requests]]}
          actual   (events/accept-notification-success cofx (:id notif-2) nil)]
      (is (= expected actual)))))
```

Notice the map has a :dispatch-n effect and other stuff inside of it that are
not the responsibility of the event under test to care about. This happens
because rf/merge forces the event handler to compute/call everything in one go.
And things get MUCH worse when you want to test an event A that uses rf/merge,
but A calls other events B and C that also use rf/merge (e.g. event
:profile.login/get-chats-callback). At that point you flip the table in horror
😱, but testing events and maintaining them should be trivial.

Solution: Use re-frame's `fx` effect.

Here's the improved implementation and its accompanying test.

```clojure
(defn accept-notification-success
  [{:keys [db]} [notification-id {:keys [chats]}]]
  (when-let [notification (get-notification db notification-id)]
    (let [new-notifications [(assoc notification :read true :accepted true)]]
      {:fx [[:dispatch [:chat/ensure-chats (map data-store.chats/<-rpc chats)]]
            [:dispatch [:activity-center.notifications/reconcile new-notifications]]]})))

(re-frame/reg-event-fx :activity-center.notifications/accept-success accept-notification-success)

(deftest accept-notification-success-test
  (testing "marks notification as accepted and read, then reconciles"
    (let [notif-1          {:id "0x1" :type types/private-group-chat}
          notif-2          {:id "0x2" :type types/private-group-chat}
          notif-2-accepted (assoc notif-2 :accepted true :read true)
          cofx             {:db {:activity-center {:filter        {:type types/no-type :status :all}
                                                   :notifications [notif-2 notif-1]}}}

          ;; *** HERE ***
          expected {:fx [[:dispatch [:chat/ensure-chats []]]
                         [:dispatch [:activity-center.notifications/reconcile [notif-2-accepted]]]]}
          actual   (events/accept-notification-success cofx [(:id notif-2) nil])]
      (is (= expected actual)))))
```

Notice how the test expectation is NOT verifying what other events do (it's
actually "impossible" now). Using fx completely decouples events and makes
testing them a joy again.

### Problem 6: Unordered effects

status-mobile still uses the legacy way to describe the effects map, which has
the problem that their order is unpredictable.

> Prior to v1.1.0, the answer is: no guarantees were provided about ordering.
> Actual order is an implementation detail upon which you should not rely.
>
> -- 39adca9367/docs/Effects.md (order-of-effects)

> In fact, with v1.1.0 best practice changed to event handlers should only
> return two effects :db and :fx, in which case :db was always done first and
> then :fx, and within :fx the ordering is sequential. This new approach is more
> about making it easier to compose event handlers from many smaller functions,
> but more specificity around ordering was a consequence.
>
> -- 39adca9367/docs/Effects.md (order-of-effects)

### Problem 7: Usage of deprecated effect dispatch-n

We have 35 usages, the majority in new code using dispatch-n, which has been
officially deprecated in favor of multiple dispatch tuples in fx. See
39adca9367/docs/api-builtin-effects.md (L114)

### Problem 8: Complexity 🧙‍♂️

Have you ever tried to understand and/or explain how rf/merge and rf/defn work?
They have their fare share of complexity and have tripped up many contributors.

This is not ideal if we want to create a project where contributors can learn
re-frame as quickly as possible. Re-frame is already complicated enough to grasp
for many, the added abstractions should be valuable enough to justify.

Interestingly, rf/merge is a stateful function, and although this is not a
problem in practice, it is partially violating re-frame's spirit of only using
pure functions inside event handlers.

### Problem 9: Using a wrapping macro rf/defn instead of global interceptors

When rf/defn was created inside status-mobile, re-frame didn't have global
interceptors yet (which were introduced 3+ years ago). We no longer have this
limitation after we upgraded our old re-frame version in PR
https://github.com/status-im/status-mobile/pull/15997.

Global interceptors are a simple and functional abstraction to specify functions
that should run on every event, for example, for debugging during development,
logging, etc. This PR already shows this is possible by removing the wrapping
function utils.re-frame/register-handler-fx without causing any breakage.

## Conclusion

By embracing re-frame's best practices for describing effects
39adca9367/docs/FAQs/BestPractice.md (use-the-fx-effect),
we can solve long standing issues that affect every contributor at different
levels and bring the following benefits:

- Simplify the codebase.
- Bring back the DX we all deserve, i.e. Clojure Language Server and clj-kondo
  fully working in event namespaces.
- Greatly facilitate the testability of events.
- Give devs more flexibility to make the app more responsive, because the new
  default would not coalesce events, which in turn, would block the UI thread
  for shorter periods of time. At least that's the theory, but exceptions will
  be found.

The actions to achieve those benefits are:

- Don't use the macro approach, replace rf/defn with
  re-frame.core/reg-event-fx.
- Don't use rf/merge, simply use re-frame's built-in effect :fx.
- Don't call event handlers as normal functions, just as we don't directly call
  subscription handlers. Use re-frame's built-in effect :fx.

## How do we refactor the remainder of the code?

Some numbers first:

- There are 228 events defined with rf/defn in src/status-im2/.
- There are 34 usages of rf/merge in src/status_im2/.

## Resources

- Release notes where fx was introduced in re-frame:
  39adca9367/docs/releases/2020.md (110-2020-08-24)
2023-10-05 16:11:45 -03:00
Icaro Motta b73ac6b107
Upgrade clj-kondo and configure new linters (#17543)
- Upgrade clj-kondo to latest version to take advantage of new linters. From
  version 2023.04.14
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to
  2023.09.07
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907
- Use new linter ":unused-alias" and set at WARN level for the moment, because
  otherwise the PR would increase a bit too much, but it did catch many unused
  "require" aliases. Added in version 2023.09.07
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907
- Use new linter ":case-symbol-test" and fix the reported errors, added in
  version 2023.07.13
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713
- Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported
  errors, added in version 2023.05.18
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518
- Raise level from WARN to ERROR for linter "uninitialized-var".
- Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version
  2023.07.13
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713
- Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version
  2023.07.13
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713
- Explicitly add ":deprecated-namespace" to clj-kondo config, added in version
  2023.07.13
  https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713

Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 15:50:57 -03:00
Anton Iakimov d80fb0b3de
update status/wakuv2 fleets DNS discovery enrtree
e1354016...9034f0a9

https://github.com/status-im/infra-misc/issues/171
2023-10-05 18:22:42 +01:00
Andrea Maria Piana ef80fc567f
Update waku nodes
e1354016...b8041fc8
2023-10-05 18:22:10 +01:00
Siddarth Kumar 7043e03dd4
Enter scan code tab in Syncing (#16852)
* feat: add enter scan code view

This commit adds the enter sync code UI.

Fixes : #16062

Design link : https://www.figma.com/file/V6nlpAWIf2e1XU8RJ9yQPe/Syncing-for-Mobile?node-id=675%3A179729&mode=dev

Review notes :
We do not make use of quo2/input here because currently that component does not allow stretching to fit in sync code which spans upto 3 lines.
2023-10-05 21:05:54 +05:30