Skip to content

Commit

Permalink
✨ :: Write the logic login
Browse files Browse the repository at this point in the history
  • Loading branch information
diejdkll committed Jan 15, 2024
1 parent 73f04be commit 6db8e6d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions feature/login/src/main/java/com/goms/login/LoginScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,40 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.goms.common.Event
import com.goms.design_system.component.button.AuthButton
import com.goms.design_system.component.text.LinkText
import com.goms.design_system.component.view.GAuthWebView
import com.goms.design_system.icon.GomsIcon
import com.goms.design_system.theme.GomsTheme
import com.goms.design_system.util.lockScreenOrientation
import com.goms.login.component.LoginText
import com.goms.login.viewmodel.AuthViewModel
import com.goms.model.request.auth.LoginRequest

@Composable
fun LoginRoute(
onEmailLoginClick: () -> Unit
onEmailLoginClick: () -> Unit,
viewModel: AuthViewModel = hiltViewModel()
) {
LoginScreen(
onEmailLoginClick = onEmailLoginClick,
loginCallBack = {}
loginCallBack = { code ->
viewModel.login(body = LoginRequest(code))
}
)
}

suspend fun login(viewModel: AuthViewModel) {
viewModel.loginResponse.collect {
when (it) {
is Event.Success -> {}
else -> {}
}
}
}

@Composable
fun LoginScreen(
onEmailLoginClick: () -> Unit,
Expand Down

0 comments on commit 6db8e6d

Please sign in to comment.