Skip to content

Commit

Permalink
Updates after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintPatrck committed Apr 13, 2024
1 parent a850807 commit 58b0132
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.x8bit.bitwarden.authenticator.ui.authenticator.feature.navbar.AUTHENT
import com.x8bit.bitwarden.authenticator.ui.authenticator.feature.navbar.authenticatorNavBarDestination
import com.x8bit.bitwarden.authenticator.ui.authenticator.feature.qrcodescan.navigateToQrCodeScanScreen
import com.x8bit.bitwarden.authenticator.ui.authenticator.feature.qrcodescan.qrCodeScanDestination
import com.x8bit.bitwarden.authenticator.ui.authenticator.feature.search.navigateToSearch

const val AUTHENTICATOR_GRAPH_ROUTE = "authenticator_graph"

Expand All @@ -37,12 +38,16 @@ fun NavGraphBuilder.authenticatorGraph(
route = AUTHENTICATOR_GRAPH_ROUTE
) {
authenticatorNavBarDestination(
onNavigateToSearch = { navController.navigateToSearch() },
onNavigateToQrCodeScanner = { navController.navigateToQrCodeScanScreen() },
onNavigateToManualKeyEntry = { navController.navigateToManualCodeEntryScreen() },
onNavigateToEditItem = { navController.navigateToEditItem(itemId = it) },
)
itemListingGraph(
navController = navController,
navigateToSearch = {
navController.navigateToSearch()
},
navigateToQrCodeScanner = {
navController.navigateToQrCodeScanScreen()
},
Expand All @@ -68,7 +73,8 @@ fun NavGraphBuilder.authenticatorGraph(
.show()
/*navController.navigateToSyncWithBitwardenScreen()*/
},
onNavigateToImportScreen = { /*navController.navigateToImportScreen()*/ }
onNavigateToImportScreen = { /*navController.navigateToImportScreen()*/ },
onNavigateToSearch = { navController.navigateToSearch() },
)
editItemDestination(
onNavigateBack = { navController.popBackStack() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const val ITEM_LISTING_GRAPH_ROUTE = "item_listing_graph"
*/
fun NavGraphBuilder.itemListingGraph(
navController: NavController,
navigateToSearch: () -> Unit,
navigateToQrCodeScanner: () -> Unit,
navigateToManualKeyEntry: () -> Unit,
navigateToEditItem: (String) -> Unit,
Expand All @@ -29,7 +30,7 @@ fun NavGraphBuilder.itemListingGraph(
) {
itemListingDestination(
onNavigateBack = { navController.popBackStack() },
onNavigateToSearch = { navController.navigateToSearch() },
onNavigateToSearch = navigateToSearch,
onNavigateToQrCodeScanner = navigateToQrCodeScanner,
onNavigateToManualKeyEntry = navigateToManualKeyEntry,
onNavigateToEditItemScreen = navigateToEditItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.x8bit.bitwarden.authenticator.ui.platform.base.util.composableWithSta
const val AUTHENTICATOR_NAV_BAR_ROUTE: String = "AuthenticatorNavBarRoute"

fun NavGraphBuilder.authenticatorNavBarDestination(
onNavigateToSearch: () -> Unit,
onNavigateToQrCodeScanner: () -> Unit,
onNavigateToManualKeyEntry: () -> Unit,
onNavigateToEditItem: (itemId: String) -> Unit,
Expand All @@ -17,6 +18,7 @@ fun NavGraphBuilder.authenticatorNavBarDestination(
onNavigateToQrCodeScanner = onNavigateToQrCodeScanner,
onNavigateToManualKeyEntry = onNavigateToManualKeyEntry,
onNavigateToEditItem = onNavigateToEditItem,
onNavigateToSearch = onNavigateToSearch,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import kotlinx.parcelize.Parcelize
fun AuthenticatorNavBarScreen(
viewModel: AuthenticatorNavBarViewModel = hiltViewModel(),
navController: NavHostController = rememberNavController(),
onNavigateToSearch: () -> Unit,
onNavigateToQrCodeScanner: () -> Unit,
onNavigateToManualKeyEntry: () -> Unit,
onNavigateToEditItem: (itemId: String) -> Unit,
Expand Down Expand Up @@ -104,6 +105,7 @@ fun AuthenticatorNavBarScreen(
settingsTabClickedAction = {
viewModel.trySendAction(AuthenticatorNavBarAction.SettingsTabClick)
},
navigateToSearch = onNavigateToSearch,
navigateToQrCodeScanner = onNavigateToQrCodeScanner,
navigateToManualKeyEntry = onNavigateToManualKeyEntry,
navigateToEditItem = onNavigateToEditItem,
Expand All @@ -116,6 +118,7 @@ private fun AuthenticatorNavBarScaffold(
navController: NavHostController,
verificationTabClickedAction: () -> Unit,
settingsTabClickedAction: () -> Unit,
navigateToSearch: () -> Unit,
navigateToQrCodeScanner: () -> Unit,
navigateToManualKeyEntry: () -> Unit,
navigateToEditItem: (itemId: String) -> Unit,
Expand Down Expand Up @@ -160,6 +163,7 @@ private fun AuthenticatorNavBarScaffold(
) {
itemListingGraph(
navController = navController,
navigateToSearch = navigateToSearch,
navigateToQrCodeScanner = navigateToQrCodeScanner,
navigateToManualKeyEntry = navigateToManualKeyEntry,
navigateToEditItem = navigateToEditItem,
Expand Down

0 comments on commit 58b0132

Please sign in to comment.