Resolve review comments for BrowseSourceScreens (#7912)

This commit is contained in:
Andreas
2022-08-31 22:47:07 +02:00
committed by GitHub
parent 504844a892
commit 2f26982e34
8 changed files with 56 additions and 71 deletions
@@ -1,8 +1,11 @@
package eu.kanade.presentation.browse
import androidx.compose.runtime.Composable
import androidx.glance.LocalContext
import eu.kanade.domain.manga.model.Manga
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
import eu.kanade.tachiyomi.ui.webview.WebViewActivity
@Composable
fun SourceSearchScreen(
@@ -11,6 +14,8 @@ fun SourceSearchScreen(
onFabClick: () -> Unit,
onClickManga: (Manga) -> Unit,
) {
val context = LocalContext.current
BrowseSourceScreen(
presenter = presenter,
navigateUp = navigateUp,
@@ -18,5 +23,10 @@ fun SourceSearchScreen(
onFabClick = onFabClick,
onMangaClick = onClickManga,
onMangaLongClick = onClickManga,
onWebViewClick = f@{
val source = presenter.source as? HttpSource ?: return@f
val intent = WebViewActivity.newIntent(context, source.baseUrl, source.id, source.name)
context.startActivity(intent)
},
)
}