Skip to content

Commit

Permalink
[Chore/#6] -
Browse files Browse the repository at this point in the history
  • Loading branch information
SYAAINN committed Sep 18, 2024
1 parent 50e533e commit 98e009d
Showing 1 changed file with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
Expand All @@ -25,7 +24,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand All @@ -52,10 +50,7 @@ fun SignInRoute(
SignInScreen(
onClickSignIn = { id, password, nickname, phoneNumber ->
authNavigator.navigateToHome(
id,
password,
nickname,
phoneNumber
id, password, nickname, phoneNumber
)
},
onClickSignUp = { authNavigator.navigateToSignUp() },
Expand Down Expand Up @@ -88,8 +83,7 @@ fun SignInScreen(
modifier = Modifier
.fillMaxSize()
.background(color = CustomTheme.colors.white)
.padding(30.dp),
horizontalAlignment = Alignment.CenterHorizontally
.padding(30.dp), horizontalAlignment = Alignment.CenterHorizontally
) {
Spacer(modifier = Modifier.height(30.dp))
Text(
Expand All @@ -102,8 +96,7 @@ fun SignInScreen(
AuthTextField(
value = inputId,
onValueChange = { inputId = it },
modifier = Modifier
.fillMaxWidth(),
modifier = Modifier.fillMaxWidth(),
isFocused = isIdTextFieldFocused,
onFocusChanged = { isIdTextFieldFocused = it },
onRemove = { inputId = TextFieldValue("") },
Expand All @@ -116,8 +109,7 @@ fun SignInScreen(
AuthTextField(
value = inputPassword,
onValueChange = { inputPassword = it },
modifier = Modifier
.fillMaxWidth(),
modifier = Modifier.fillMaxWidth(),
isFocused = isPasswordTextFieldFocused,
onFocusChanged = { isPasswordTextFieldFocused = it },
onRemove = { inputPassword = TextFieldValue("") },
Expand All @@ -141,8 +133,7 @@ fun SignInScreen(
)
Spacer(modifier = Modifier.weight(1f))
SignInButton(
modifier = Modifier
.fillMaxWidth(),
modifier = Modifier.fillMaxWidth(),
context = context,
inputId = inputId.text,
inputPassword = inputPassword.text,
Expand Down Expand Up @@ -171,18 +162,15 @@ fun SignInButton(
onClick = {
when {
inputId.isEmpty() || inputPassword.isEmpty() -> showToast(
context,
context.getString(R.string.signin_signin_failure_toast)
context, context.getString(R.string.signin_signin_failure_toast)
)

inputId != id -> showToast(
context,
context.getString(R.string.signin_signin_id_incorrect)
context, context.getString(R.string.signin_signin_id_incorrect)
)

inputPassword != password -> showToast(
context,
context.getString(R.string.signin_signin_password_incorrect)
context, context.getString(R.string.signin_signin_password_incorrect)
)

else -> {
Expand All @@ -196,14 +184,13 @@ fun SignInButton(
shape = RoundedCornerShape(10.dp)
) {
Text(
text = stringResource(R.string.signin_signin_button),
color = CustomTheme.colors.gray01
text = stringResource(R.string.signin_signin_button), color = CustomTheme.colors.gray01
)
}
}

@Preview(showBackground = true)
@Composable
fun show() {
fun ShowSignInScreen() {

}

0 comments on commit 98e009d

Please sign in to comment.