Skip to content

Commit

Permalink
renamed every AccessFactorSource to AccessFactorSources
Browse files Browse the repository at this point in the history
  • Loading branch information
giannis-rdx committed Jan 24, 2024
1 parent 7dbd00a commit af736ef
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/babylon/wallet/android/WalletApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.babylon.wallet.android.domain.model.MessageFromDataChannel
import com.babylon.wallet.android.domain.userFriendlyMessage
import com.babylon.wallet.android.presentation.accessfactorsource.accessFactorSourceBottomSheet
import com.babylon.wallet.android.presentation.accessfactorsources.accessFactorSources
import com.babylon.wallet.android.presentation.dapp.authorized.login.dAppLoginAuthorized
import com.babylon.wallet.android.presentation.dapp.unauthorized.login.dAppLoginUnauthorized
import com.babylon.wallet.android.presentation.main.MAIN_ROUTE
Expand Down Expand Up @@ -104,7 +104,7 @@ fun WalletApp(
}
HandleAccessFactorSourcesEvents(
navController = navController,
statusEvents = mainViewModel.accessFactorSourceEvents
statusEvents = mainViewModel.accessFactorSourcesEvents
)
HandleStatusEvents(
navController = navController,
Expand Down Expand Up @@ -180,13 +180,13 @@ private fun SyncStatusBarWithScreenChanges(navController: NavHostController) {
@Composable
private fun HandleAccessFactorSourcesEvents(
navController: NavController,
statusEvents: Flow<AppEvent.AccessFactorSource.ToCreateAccount>
statusEvents: Flow<AppEvent.AccessFactorSources.ToCreateAccount>
) {
LaunchedEffect(Unit) {
statusEvents.collect { event ->
when (event) {
is AppEvent.AccessFactorSource.ToCreateAccount -> {
navController.accessFactorSourceBottomSheet()
is AppEvent.AccessFactorSources -> {
navController.accessFactorSources()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package com.babylon.wallet.android.presentation.accessfactorsource
package com.babylon.wallet.android.presentation.accessfactorsources

import androidx.compose.ui.window.DialogProperties
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.dialog

fun NavController.accessFactorSourceBottomSheet() {
fun NavController.accessFactorSources() {
navigate("access_factor_source_bottom_sheet")
}

fun NavGraphBuilder.accessFactorSourceBottomSheet(
fun NavGraphBuilder.accessFactorSources(
onDismiss: () -> Unit
) {
dialog(
route = "access_factor_source_bottom_sheet",
dialogProperties = DialogProperties(usePlatformDefaultWidth = false)
) {
AccessFactorSourceBottomSheet(
AccessFactorSourcesDialog(
viewModel = hiltViewModel(),
onDismiss = onDismiss
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.babylon.wallet.android.presentation.accessfactorsource
package com.babylon.wallet.android.presentation.accessfactorsources

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
Expand All @@ -18,9 +18,9 @@ import com.babylon.wallet.android.presentation.ui.composables.BottomSheetDialogW
import com.babylon.wallet.android.utils.biometricAuthenticate

@Composable
fun AccessFactorSourceBottomSheet(
fun AccessFactorSourcesDialog(
modifier: Modifier = Modifier,
viewModel: AccessFactorSourceViewModel,
viewModel: AccessFactorSourcesViewModel,
onDismiss: () -> Unit
) {
val context = LocalContext.current
Expand Down Expand Up @@ -68,7 +68,7 @@ private fun AccessFactorSourceBottomSheetContent(

@Preview
@Composable
fun AccessFactorSourceBottomSheetPreview() {
fun AccessFactorSourcesDialogPreview() {
AccessFactorSourceBottomSheetContent(
onDismiss = {}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.babylon.wallet.android.presentation.accessfactorsource
package com.babylon.wallet.android.presentation.accessfactorsources

import com.babylon.wallet.android.presentation.common.StateViewModel
import com.babylon.wallet.android.presentation.common.UiState
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class AccessFactorSourceViewModel @Inject constructor() : StateViewModel<AccessFactorSourceViewModel.AccessFactorSourceUiState>() {
class AccessFactorSourcesViewModel @Inject constructor() : StateViewModel<AccessFactorSourcesViewModel.AccessFactorSourceUiState>() {

override fun initialState(): AccessFactorSourceUiState = AccessFactorSourceUiState()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class MainViewModel @Inject constructor(
.events
.filterIsInstance<AppEvent.Status>()

val accessFactorSourceEvents = appEventBus
val accessFactorSourcesEvents = appEventBus
.events
.filterIsInstance<AppEvent.AccessFactorSource.ToCreateAccount>()
.filterIsInstance<AppEvent.AccessFactorSources.ToCreateAccount>()

val isDevBannerVisible = getProfileStateUseCase().map { profileState ->
when (profileState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import com.babylon.wallet.android.presentation.accessfactorsource.accessFactorSourceBottomSheet
import com.babylon.wallet.android.presentation.accessfactorsources.accessFactorSources
import com.babylon.wallet.android.presentation.account.AccountScreen
import com.babylon.wallet.android.presentation.account.createaccount.ROUTE_CREATE_ACCOUNT
import com.babylon.wallet.android.presentation.account.createaccount.confirmation.CreateAccountRequestSource
Expand Down Expand Up @@ -236,7 +236,7 @@ fun NavigationHost(
}
)
}
accessFactorSourceBottomSheet(
accessFactorSources(
onDismiss = {
navController.popBackStack()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ sealed interface AppEvent {
val derivedPublicKeyHex: String
) : AppEvent

sealed interface AccessFactorSource : AppEvent {
data object ToCreateAccount : AccessFactorSource
sealed interface AccessFactorSources : AppEvent {
data object ToCreateAccount : AccessFactorSources
}

sealed class Status : AppEvent {
Expand Down

0 comments on commit af736ef

Please sign in to comment.