Created
August 22, 2025 13:02
-
-
Save ifucolo/a3bfcd7a3fe8b6205dcbfb2db17d3716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Composable | |
| fun PrayersRouteComponent( | |
| onShowNavigationBar: (Boolean) -> Unit = {} | |
| ) { | |
| val backStack = rememberNavBackStack<PrayersSubRoute>(PrayersSubRoute.PrayersRoute) | |
| NavDisplay( | |
| backStack = backStack, | |
| onBack = { keysToRemove -> repeat(keysToRemove) { backStack.removeLastOrNull() } }, | |
| entryDecorators = listOf( | |
| rememberSceneSetupNavEntryDecorator(), | |
| rememberSavedStateNavEntryDecorator(), | |
| rememberViewModelStoreNavEntryDecorator() | |
| ), | |
| entryProvider = entryProvider { | |
| onShowNavigationBar(backStack.lastOrNull() == PrayersSubRoute.PrayersRoute) | |
| entry<PrayersSubRoute.PrayersRoute> { | |
| PrayersScreen( | |
| onPrayerClicked = { prayer -> | |
| backStack.add(PrayersSubRoute.PrayerRoute(prayerName = prayer.prayer.name)) | |
| }, | |
| onNovenaClicked = { novena -> | |
| backStack.add(PrayersSubRoute.NovenaRoute(novenaName = novena.novena.name)) | |
| }, | |
| onChapletClicked = { chaplet -> | |
| backStack.add(PrayersSubRoute.ChapletRoute(chapletName = chaplet.terco.name)) | |
| } | |
| ) | |
| } | |
| entry<PrayersSubRoute.PrayerRoute> { route -> | |
| PrayerDetailScreen( | |
| prayerName = route.prayerName, | |
| onBackClick = { backStack.removeLastOrNull() } | |
| ) | |
| } | |
| entry<PrayersSubRoute.ChapletRoute> { route -> | |
| ChapletFlowRouteComponent( | |
| chapletName = route.chapletName, | |
| onClose = { backStack.removeLastOrNull() } | |
| ) | |
| } | |
| entry<PrayersSubRoute.NovenaRoute> { route -> | |
| NovenaFlowRouteComponent( | |
| novenaName = route.novenaName, | |
| onClose = { backStack.removeLastOrNull() } | |
| ) | |
| } | |
| }, | |
| ..... | |
| transitionSpec, | |
| popTransitionSpec, | |
| predictivePopTransitionSpec, | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment