refactor: remove theme toggle from feed top bar (available in Settings)

This commit is contained in:
Paweł Orzech 2026-03-19 11:37:46 +01:00
parent 53c7cdd6a6
commit 85fa89d985
No known key found for this signature in database
2 changed files with 1 additions and 17 deletions

View file

@ -71,8 +71,6 @@ import com.swoosh.microblog.data.model.PostFilter
import com.swoosh.microblog.data.model.PostStats
import com.swoosh.microblog.data.model.QueueStatus
import com.swoosh.microblog.data.model.SortOrder
import com.swoosh.microblog.ui.theme.ThemeMode
import com.swoosh.microblog.ui.theme.ThemeViewModel
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterialApi::class)
@Composable
@ -82,11 +80,9 @@ fun FeedScreen(
onCompose: () -> Unit,
onEditPost: (FeedPost) -> Unit,
onAddAccount: () -> Unit = {},
viewModel: FeedViewModel = viewModel(),
themeViewModel: ThemeViewModel? = null
viewModel: FeedViewModel = viewModel()
) {
val state by viewModel.uiState.collectAsStateWithLifecycle()
val themeMode = themeViewModel?.themeMode?.collectAsStateWithLifecycle()
val activeFilter by viewModel.activeFilter.collectAsStateWithLifecycle()
val sortOrder by viewModel.sortOrder.collectAsStateWithLifecycle()
val searchQuery by viewModel.searchQuery.collectAsStateWithLifecycle()
@ -220,17 +216,6 @@ fun FeedScreen(
IconButton(onClick = { viewModel.activateSearch() }) {
Icon(Icons.Default.Search, contentDescription = "Search")
}
if (themeViewModel != null) {
val currentMode = themeMode?.value ?: ThemeMode.SYSTEM
val (icon, description) = when (currentMode) {
ThemeMode.SYSTEM -> Icons.Default.BrightnessAuto to "Theme: System"
ThemeMode.LIGHT -> Icons.Default.LightMode to "Theme: Light"
ThemeMode.DARK -> Icons.Default.DarkMode to "Theme: Dark"
}
IconButton(onClick = { themeViewModel.cycleThemeMode() }) {
Icon(icon, contentDescription = description)
}
}
SortButton(
currentSort = sortOrder,
onSortSelected = { viewModel.setSortOrder(it) }

View file

@ -56,7 +56,6 @@ fun SwooshNavGraph(
composable(Routes.FEED) {
FeedScreen(
viewModel = feedViewModel,
themeViewModel = themeViewModel,
onSettingsClick = { navController.navigate(Routes.SETTINGS) },
onPostClick = { post ->
selectedPost = post