diff --git a/data/login/src/commonMain/kotlin/com/b1nd/dodam/data/login/model/Member.kt b/data/login/src/commonMain/kotlin/com/b1nd/dodam/data/login/model/Member.kt index 2ddcd425..734ddc4f 100644 --- a/data/login/src/commonMain/kotlin/com/b1nd/dodam/data/login/model/Member.kt +++ b/data/login/src/commonMain/kotlin/com/b1nd/dodam/data/login/model/Member.kt @@ -4,10 +4,10 @@ import com.b1nd.dodam.network.login.model.LoginResponse data class Member( val accessToken: String, - val role: String + val role: String, ) internal fun LoginResponse.toModel(): Member = Member( accessToken = accessToken, - role = member.role + role = member.role, ) diff --git a/dodam-student/src/main/kotlin/com/b1nd/dodam/student/DodamApp.kt b/dodam-student/src/main/kotlin/com/b1nd/dodam/student/DodamApp.kt index 976e12cd..d604edee 100644 --- a/dodam-student/src/main/kotlin/com/b1nd/dodam/student/DodamApp.kt +++ b/dodam-student/src/main/kotlin/com/b1nd/dodam/student/DodamApp.kt @@ -189,7 +189,7 @@ fun DodamApp( }, ) }, - role = "STUDENT" + role = "STUDENT", ) wakeupSongScreen( onAddWakeupSongClick = { diff --git a/dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/DodamTeacherApp.kt b/dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/DodamTeacherApp.kt index 162a572a..f676a797 100644 --- a/dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/DodamTeacherApp.kt +++ b/dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/DodamTeacherApp.kt @@ -26,7 +26,7 @@ fun DodamTeacherApp() { loginScreen( onBackClick = navHostController::popBackStack, navigateToMain = {}, - role = "TEACHER" + role = "TEACHER", ) } } diff --git a/feature/login/src/commonMain/kotlin/login/LoginScreen.kt b/feature/login/src/commonMain/kotlin/login/LoginScreen.kt index 845a8eb0..86d70adb 100644 --- a/feature/login/src/commonMain/kotlin/login/LoginScreen.kt +++ b/feature/login/src/commonMain/kotlin/login/LoginScreen.kt @@ -43,12 +43,7 @@ import org.koin.compose.viewmodel.koinViewModel @ExperimentalMaterial3Api @Composable -internal fun LoginScreen( - viewModel: LoginViewModel = koinViewModel(), - onBackClick: () -> Unit, - navigateToMain: () -> Unit, - role: String -) { +internal fun LoginScreen(viewModel: LoginViewModel = koinViewModel(), onBackClick: () -> Unit, navigateToMain: () -> Unit, role: String) { val uiState by viewModel.uiState.collectAsState() var idError by remember { mutableStateOf("") } @@ -127,32 +122,30 @@ private fun LoginScreen( var showPassword by remember { mutableStateOf(false) } - if (showDialog) { Dialog( - onDismissRequest = dismissDialog + onDismissRequest = dismissDialog, ) { DodamDialog( title = errorMessage, body = "아직 계정이 승인되지 않았어요.\n" + - "승인을 기다려주세요.", - confirmButton = dismissDialog + "승인을 기다려주세요.", + confirmButton = dismissDialog, ) } } if (showDialog) { Dialog( - onDismissRequest = dismissDialog + onDismissRequest = dismissDialog, ) { DodamDialog( title = errorMessage, - confirmButton = dismissDialog + confirmButton = dismissDialog, ) } } - Scaffold( modifier = Modifier .fillMaxSize() @@ -161,7 +154,7 @@ private fun LoginScreen( topBar = { DodamTopAppBar( title = "아이디와 비밀번호를\n" + - "입력해주세요", + "입력해주세요", onBackClick = onBackClick, type = TopAppBarType.Medium, ) diff --git a/feature/login/src/commonMain/kotlin/login/navigation/LoginNavigation.kt b/feature/login/src/commonMain/kotlin/login/navigation/LoginNavigation.kt index b9f1086b..08507d9a 100644 --- a/feature/login/src/commonMain/kotlin/login/navigation/LoginNavigation.kt +++ b/feature/login/src/commonMain/kotlin/login/navigation/LoginNavigation.kt @@ -29,7 +29,7 @@ fun NavGraphBuilder.loginScreen(onBackClick: () -> Unit, navigateToMain: () -> U LoginScreen( onBackClick = onBackClick, navigateToMain = navigateToMain, - role = role + role = role, ) } } diff --git a/feature/login/src/commonMain/kotlin/login/viewmodel/LoginViewModel.kt b/feature/login/src/commonMain/kotlin/login/viewmodel/LoginViewModel.kt index 69f064a1..09bb4c36 100644 --- a/feature/login/src/commonMain/kotlin/login/viewmodel/LoginViewModel.kt +++ b/feature/login/src/commonMain/kotlin/login/viewmodel/LoginViewModel.kt @@ -45,18 +45,17 @@ class LoginViewModel : ViewModel(), KoinComponent { pw = pw, token = result.data.accessToken, - ) + ) _event.emit(Event.NavigateToMain) } else { _event.emit(Event.ShowDialog) _uiState.update { it.copy( isLoading = false, - error = "선생님만 사용 가능합니다." + error = "선생님만 사용 가능합니다.", ) } } - } is Result.Error -> { diff --git a/network/core/src/commonMain/kotlin/com/b1nd/dodam/network/core/model/MemberResponse.kt b/network/core/src/commonMain/kotlin/com/b1nd/dodam/network/core/model/MemberResponse.kt index ce2c0cd2..343685bc 100644 --- a/network/core/src/commonMain/kotlin/com/b1nd/dodam/network/core/model/MemberResponse.kt +++ b/network/core/src/commonMain/kotlin/com/b1nd/dodam/network/core/model/MemberResponse.kt @@ -12,5 +12,5 @@ data class MemberResponse( val role: String, val status: String, val profileImage: String?, - val phone: String + val phone: String, )