secondaryscreentemplate error
This commit is contained in:
		
							parent
							
								
									c73c06b11c
								
							
						
					
					
						commit
						601740f258
					
				
					 4 changed files with 59 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -18,4 +18,6 @@ object StudeezDestinations {
 | 
			
		|||
 | 
			
		||||
    // Edit screens
 | 
			
		||||
    const val EDIT_PROFILE_SCREEN = "edit_profile"
 | 
			
		||||
 | 
			
		||||
    const val ADD_TIMER_SCREEN = "add_timer"
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
package be.ugent.sel.studeez.screens.timer_overview.add_timer
 | 
			
		||||
 | 
			
		||||
import be.ugent.sel.studeez.domain.LogService
 | 
			
		||||
import be.ugent.sel.studeez.screens.StudeezViewModel
 | 
			
		||||
import dagger.hilt.android.lifecycle.HiltViewModel
 | 
			
		||||
import javax.inject.Inject
 | 
			
		||||
 | 
			
		||||
@HiltViewModel
 | 
			
		||||
class AddTimerViewModel @Inject constructor(
 | 
			
		||||
    logService: LogService
 | 
			
		||||
): StudeezViewModel(logService) {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
package be.ugent.sel.studeez.screens.timer_overview.add_timer
 | 
			
		||||
 | 
			
		||||
import androidx.compose.runtime.Composable
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.SecondaryScreenTemplate
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.drawer.DrawerActions
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.drawer.DrawerViewModel
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.drawer.getDrawerActions
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.navbar.NavigationBarActions
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.navbar.NavigationBarViewModel
 | 
			
		||||
import be.ugent.sel.studeez.common.composable.navbar.getNavigationBarActions
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun AddTimerRoute(
 | 
			
		||||
    open: (String) -> Unit,
 | 
			
		||||
    openAndPopUp: (String, String) -> Unit
 | 
			
		||||
    viewModel: AddTimerViewModel,
 | 
			
		||||
    drawerViewModel: DrawerViewModel,
 | 
			
		||||
    navBarViewModel: NavigationBarViewModel,
 | 
			
		||||
) {
 | 
			
		||||
    addTimerScreen(
 | 
			
		||||
        drawerActions = getDrawerActions(
 | 
			
		||||
            drawerViewModel = drawerViewModel,
 | 
			
		||||
            open = open,
 | 
			
		||||
            openAndPopUp = openAndPopUp
 | 
			
		||||
        ),
 | 
			
		||||
        navigationBarActions = getNavigationBarActions(
 | 
			
		||||
            navigationBarViewModel = navBarViewModel,
 | 
			
		||||
            open = open
 | 
			
		||||
        )
 | 
			
		||||
    )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fun addTimerScreen(
 | 
			
		||||
    drawerActions: DrawerActions,
 | 
			
		||||
    navigationBarActions: NavigationBarActions
 | 
			
		||||
) {
 | 
			
		||||
    SecondaryScreenTemplate(
 | 
			
		||||
        title = ,
 | 
			
		||||
        popUp = { /*TODO*/ }) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in a new issue