Skip to content

Commit

Permalink
MIFOSAC-258: Implemented compose navigation in about module
Browse files Browse the repository at this point in the history
implemented navigation
  • Loading branch information
itsPronay committed Aug 18, 2024
1 parent 05ab56e commit fdbd57f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.mifos.feature.about.navigation

/**
* Created by Pronay Sarker on 18/08/2024 (2:42 PM)
*/
sealed class AboutScreens(val route: String) {
data object AboutScreen : AboutScreens(route = "about_screen_route")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import com.mifos.feature.about.AboutScreen
/**
* Created by Pronay Sarker on 10/08/2024 (7:56 AM)
*/
const val ABOUT_SCREEN_ROUTE = "about_screen_route"

fun NavController.navigateToAboutScreen() {
this.navigate(ABOUT_SCREEN_ROUTE)
}

fun NavGraphBuilder.aboutScreen(
onBackPressed: () -> Unit
) {
composable(ABOUT_SCREEN_ROUTE) {
composable(AboutScreens.AboutScreen.route) {
AboutScreen(
onBackPressed = onBackPressed
)
}
}
}

fun NavController.navigateToAboutScreen() {
navigate(AboutScreens.AboutScreen.route)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.material.icons.rounded.PowerSettingsNew
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material.icons.rounded.Task
import androidx.compose.ui.graphics.vector.ImageVector
import com.mifos.feature.about.navigation.ABOUT_SCREEN_ROUTE
import com.mifos.feature.checker_inbox_task.navigation.CHECKER_INBOX_TASK_SCREEN_ROUTE
import com.mifos.feature.groups.navigation.GROUP_LIST_SCREEN_ROUTE
import com.mifos.feature.individual_collection_sheet.navigation.GENERATE_COLLECTION_SHEET_SCREEN_ROUTE
Expand Down Expand Up @@ -89,7 +88,7 @@ sealed class HomeDestinationsScreen(

data object AboutScreen : HomeDestinationsScreen(
title = "About",
route = ABOUT_SCREEN_ROUTE,
route = "about_screen_route",
icon = Icons.Rounded.Info
)

Expand Down

0 comments on commit fdbd57f

Please sign in to comment.