Skip to content

Commit ab3677b

Browse files
lealobanovclaude
andcommitted
feat: redirect Add Tokens button to React Native screen
- Add ADD_TOKENS to RNBridge.ScreenType and InitialRoute enums - Handle ADD_TOKENS in ReactNativeActivity getScreenName/getRouteName - Replace AddTokenActivity/AddCustomTokenActivity launch in WalletHeaderPresenter with ReactNativeActivity.launch(ADD_TOKENS) for both Flow and EVM accounts Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 08b2fd4 commit ab3677b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

app/src/main/java/com/flowfoundation/wallet/page/wallet/presenter/WalletHeaderPresenter.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import com.flowfoundation.wallet.page.notification.model.Priority
2828
import com.flowfoundation.wallet.page.notification.model.Type
2929
import com.flowfoundation.wallet.page.notification.model.WalletNotification
3030
import com.flowfoundation.wallet.page.profile.subpage.walletconnect.session.model.PendingRequestModel
31-
import com.flowfoundation.wallet.page.token.addtoken.AddTokenActivity
32-
import com.flowfoundation.wallet.page.token.custom.AddCustomTokenActivity
3331
import com.flowfoundation.wallet.page.token.manage.ManageTokenActivity
3432
import com.flowfoundation.wallet.page.wallet.WalletFragmentViewModel
3533
import com.flowfoundation.wallet.page.wallet.dialog.SwapDialog
@@ -93,11 +91,7 @@ class WalletHeaderPresenter(
9391
flAddToken.gone()
9492
} else {
9593
flAddToken.setOnClickListener {
96-
if (WalletManager.isEVMAccountSelected()) {
97-
AddCustomTokenActivity.launch(view.context)
98-
} else {
99-
AddTokenActivity.launch(view.context)
100-
}
94+
ReactNativeActivity.launch(view.context, RNBridge.ScreenType.ADD_TOKENS)
10195
}
10296
cvSwap.setOnClickListener {
10397
activity?.let {

app/src/main/java/com/flowfoundation/wallet/reactnative/ReactNativeActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class ReactNativeActivity : ReactActivity() {
9999
RNBridge.ScreenType.ONBOARDING -> "onboarding"
100100
RNBridge.ScreenType.RECEIVE -> "receive"
101101
RNBridge.ScreenType.ACTIVITY -> "activity"
102+
RNBridge.ScreenType.ADD_TOKENS -> "add-tokens"
102103
}
103104
}
104105

@@ -126,6 +127,7 @@ class ReactNativeActivity : ReactActivity() {
126127
RNBridge.ScreenType.ONBOARDING -> RNBridge.InitialRoute.GET_STARTED.routeName
127128
RNBridge.ScreenType.RECEIVE -> "Receive"
128129
RNBridge.ScreenType.ACTIVITY -> "Activity"
130+
RNBridge.ScreenType.ADD_TOKENS -> RNBridge.InitialRoute.ADD_TOKENS.routeName
129131
}
130132
}
131133

app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/BridgeModels.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class RNBridge {
2323
@SerializedName("token-detail") TOKEN_DETAIL,
2424
@SerializedName("onboarding") ONBOARDING,
2525
@SerializedName("receive") RECEIVE,
26-
@SerializedName("activity") ACTIVITY
26+
@SerializedName("activity") ACTIVITY,
27+
@SerializedName("add-tokens") ADD_TOKENS
2728
}
2829

2930
enum class AccountTypeType {
@@ -423,7 +424,8 @@ class RNBridge {
423424
@SerializedName("SelectTokens") SELECT_TOKENS("SelectTokens"),
424425
@SerializedName("SendTo") SEND_TO("SendTo"),
425426
@SerializedName("SendTokens") SEND_TOKENS("SendTokens"),
426-
@SerializedName("Home") HOME("Home")
427+
@SerializedName("Home") HOME("Home"),
428+
@SerializedName("AddTokens") ADD_TOKENS("AddTokens")
427429
}
428430

429431
enum class NativeScreenName {

0 commit comments

Comments
 (0)