#58 Add simple screen for login/register
This commit is contained in:
		
							parent
							
								
									66e68493e4
								
							
						
					
					
						commit
						125e0a87d1
					
				
					 3 changed files with 18 additions and 5 deletions
				
			
		|  | @ -0,0 +1,16 @@ | ||||||
|  | package be.ugent.sel.studeez.common.composable | ||||||
|  | 
 | ||||||
|  | import androidx.compose.foundation.layout.PaddingValues | ||||||
|  | import androidx.compose.material.Scaffold | ||||||
|  | import androidx.compose.material.Text | ||||||
|  | import androidx.compose.material.TopAppBar | ||||||
|  | import androidx.compose.runtime.Composable | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | fun SimpleScreenTemplate( | ||||||
|  |     title: String, | ||||||
|  |     content: @Composable (PaddingValues) -> Unit | ||||||
|  | ) { | ||||||
|  |     Scaffold( topBar = { TopAppBar ( title = { Text(text = title) } ) } | ||||||
|  |     ) { paddingValues -> content(paddingValues) } | ||||||
|  | } | ||||||
|  | @ -26,8 +26,7 @@ fun LoginScreen( | ||||||
| ) { | ) { | ||||||
|     val uiState by viewModel.uiState |     val uiState by viewModel.uiState | ||||||
| 
 | 
 | ||||||
|     // TODO Make this a separate kind of screen? |     SimpleScreenTemplate(title = resources().getString(AppText.sign_in)) { | ||||||
|     SecondaryScreenTemplate(title = resources().getString(AppText.sign_in), {}) { |  | ||||||
|         Column( |         Column( | ||||||
|             modifier = modifier |             modifier = modifier | ||||||
|                 .fillMaxWidth() |                 .fillMaxWidth() | ||||||
|  |  | ||||||
|  | @ -6,8 +6,6 @@ import androidx.compose.foundation.layout.fillMaxHeight | ||||||
| import androidx.compose.foundation.layout.fillMaxWidth | import androidx.compose.foundation.layout.fillMaxWidth | ||||||
| import androidx.compose.foundation.rememberScrollState | import androidx.compose.foundation.rememberScrollState | ||||||
| import androidx.compose.foundation.verticalScroll | import androidx.compose.foundation.verticalScroll | ||||||
| import androidx.compose.material.icons.Icons |  | ||||||
| import androidx.compose.material.icons.filled.Person |  | ||||||
| import androidx.compose.runtime.Composable | import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.runtime.getValue | import androidx.compose.runtime.getValue | ||||||
| import androidx.compose.ui.Alignment | import androidx.compose.ui.Alignment | ||||||
|  | @ -29,7 +27,7 @@ fun SignUpScreen( | ||||||
|     val uiState by viewModel.uiState |     val uiState by viewModel.uiState | ||||||
|     val fieldModifier = Modifier.fieldModifier() |     val fieldModifier = Modifier.fieldModifier() | ||||||
| 
 | 
 | ||||||
|     SecondaryScreenTemplate(title = resources().getString(AppText.create_account), {}) { |     SimpleScreenTemplate(title = resources().getString(AppText.create_account)) { | ||||||
|         Column( |         Column( | ||||||
|             modifier = modifier |             modifier = modifier | ||||||
|                 .fillMaxWidth() |                 .fillMaxWidth() | ||||||
|  |  | ||||||
		Reference in a new issue