mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 04:28:55 +01:00
Show empty screen when a category is empty (#8690)
* Show empty screen when a category is empty * Review changes * Review changes #2 Co-authored-by: arkon <arkon@users.noreply.github.com>
This commit is contained in:
@@ -58,6 +58,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
fun ExtensionScreen(
|
||||
state: ExtensionsState,
|
||||
contentPadding: PaddingValues,
|
||||
searchQuery: String? = null,
|
||||
onLongClickItem: (Extension) -> Unit,
|
||||
onClickItemCancel: (Extension) -> Unit,
|
||||
onInstallExtension: (Extension.Available) -> Unit,
|
||||
@@ -75,10 +76,17 @@ fun ExtensionScreen(
|
||||
) {
|
||||
when {
|
||||
state.isLoading -> LoadingScreen(modifier = Modifier.padding(contentPadding))
|
||||
state.isEmpty -> EmptyScreen(
|
||||
textResource = R.string.empty_screen,
|
||||
modifier = Modifier.padding(contentPadding),
|
||||
)
|
||||
state.isEmpty -> {
|
||||
val msg = if (!searchQuery.isNullOrEmpty()) {
|
||||
R.string.no_results_found
|
||||
} else {
|
||||
R.string.empty_screen
|
||||
}
|
||||
EmptyScreen(
|
||||
textResource = msg,
|
||||
modifier = Modifier.padding(contentPadding),
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
ExtensionContent(
|
||||
state = state,
|
||||
|
||||
Reference in New Issue
Block a user