feat: auth screen with auto-redirect, sync favorites/history with backend
This commit is contained in:
@@ -12,7 +12,7 @@ import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
fun BottomNavBar(navController: NavController) {
|
||||
val currentRoute = navController.currentBackStackEntryAsState().value?.destination?.route
|
||||
NavigationBar {
|
||||
NavDestinations.items.forEach { destination ->
|
||||
NavDestinations.items.filter { it.showInBottomBar }.forEach { destination ->
|
||||
NavigationBarItem(
|
||||
icon = { Icon(destination.icon, contentDescription = destination.labelRes) },
|
||||
label = { Text(destination.labelRes) },
|
||||
|
||||
@@ -4,20 +4,24 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import com.composables.icons.lucide.Lucide
|
||||
import com.composables.icons.lucide.Heart
|
||||
import com.composables.icons.lucide.History
|
||||
import com.composables.icons.lucide.Home
|
||||
import com.composables.icons.lucide.Mic
|
||||
import com.composables.icons.lucide.Radio
|
||||
import com.composables.icons.lucide.Settings
|
||||
|
||||
sealed class NavDestinations(
|
||||
val route: String,
|
||||
val labelRes: String,
|
||||
val icon: ImageVector
|
||||
val icon: ImageVector,
|
||||
val showInBottomBar: Boolean = true
|
||||
) {
|
||||
data object Stations : NavDestinations("stations", "Радио", Lucide.Home)
|
||||
data object Stations : NavDestinations("stations", "Радио", Lucide.Radio)
|
||||
data object Favorites : NavDestinations("favorites", "Избранное", Lucide.Heart)
|
||||
data object History : NavDestinations("history", "История", Lucide.History)
|
||||
data object Recordings : NavDestinations("recordings", "Записи", Lucide.Mic)
|
||||
data object Settings : NavDestinations("settings", "Настройки", Lucide.Settings)
|
||||
data object Auth : NavDestinations("auth", "Вход", Lucide.Settings, showInBottomBar = false)
|
||||
|
||||
companion object {
|
||||
val items = listOf(Stations, Favorites, History, Settings)
|
||||
val items = listOf(Stations, Favorites, History, Recordings, Settings)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user