Skip to content

Commit

Permalink
Update GithubRepoItemsList.kt: add contentType (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Nov 20, 2023
1 parent 0ad6201 commit 85a0be8
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -78,7 +78,8 @@ internal fun GithubRepoItemsList(
) {
items(
items = items,
key = { it.id }
key = { it.id },
contentType = { "GithubRepoItemRow" },
) { item ->
GithubRepoItemRow(
modifier = Modifier
Expand All @@ -89,21 +90,21 @@ internal fun GithubRepoItemsList(
}

if (isLoading) {
item {
item(contentType = "LoadingIndicator") {
LoadingIndicator(
modifier = Modifier.height(128.dp)
)
}
} else if (error !== null) {
item {
item(contentType = "RetryButton") {
RetryButton(
modifier = Modifier.height(128.dp),
errorMessage = error.getReadableMessage(),
onRetry = onRetry
)
}
} else if (!hasReachedMax) {
item {
item(contentType = "Spacer") {
Spacer(modifier = Modifier.height(128.dp))
}
}
Expand Down

0 comments on commit 85a0be8

Please sign in to comment.