-
-
Save skydoves/4c088ddd077d1dc3c3d5bcac5f3e4395 to your computer and use it in GitHub Desktop.
timeline_content_version
This file contains 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 | |
private fun TimelineContent( | |
timelineViewModel: TimelineViewModel = hiltViewModel(), | |
navigateToDetails: (UiComponent, Int) -> Unit | |
) { | |
val timelineUi by timelineViewModel.timelineUi.collectAsStateWithLifecycle() | |
Column( | |
modifier = Modifier | |
.background(ServerDrivenTheme.colors.background) | |
.fillMaxSize() | |
.padding(12.dp), | |
verticalArrangement = Arrangement.spacedBy(12.dp) | |
) { | |
timelineUi.components.forEach { uiComponent -> | |
uiComponent.Consume( | |
version = timelineUi.uiVersion, | |
navigator = { clickedComponent -> | |
navigateToDetails.invoke(clickedComponent, timelineUi.version) | |
} | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment