diff --git a/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardActivity.kt b/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardActivity.kt index fa209fe..ecc2842 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardActivity.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/dashboard/DashboardActivity.kt @@ -69,30 +69,35 @@ class DashboardActivity : ComponentActivity() { enableEdgeToEdge() setContent { VastappTheme { - val items = listOf( - Screen.Dashboard, - Screen.Instances, - Screen.Billing, - Screen.Help - ) + DashboardApp(dashboardViewModel = dashboardViewModel) + } + } + } +} - val navController = rememberNavController() +@Composable +fun DashboardApp(dashboardViewModel: DashboardViewModel) { + val items = listOf( + Screen.Dashboard, + Screen.Instances, + Screen.Billing, + Screen.Help + ) - Scaffold( - modifier = Modifier.fillMaxSize(), - bottomBar = { - MyNavigationBar(items, navController = navController) - } - ) { innerPadding -> - Column(modifier = Modifier.padding(innerPadding)) { - NavHost(navController = navController, startDestination = "dashboard") { - composable("dashboard") { DashboardScreen(dashboardViewModel) } - composable("instances") { InstancesScreen(dashboardViewModel) } - composable("billing") { BillingScreen(dashboardViewModel) } - composable("help") { HelpScreen(dashboardViewModel) } - } - } - } + val navController = rememberNavController() + + Scaffold( + modifier = Modifier.fillMaxSize(), + bottomBar = { + MyNavigationBar(items, navController = navController) + } + ) { innerPadding -> + Column(modifier = Modifier.padding(innerPadding)) { + NavHost(navController = navController, startDestination = "dashboard") { + composable("dashboard") { DashboardScreen(dashboardViewModel) } + composable("instances") { InstancesScreen(dashboardViewModel) } + composable("billing") { BillingScreen(dashboardViewModel) } + composable("help") { HelpScreen(dashboardViewModel) } } } }