Skip to content

Commit

Permalink
feat: 로그인 수정 (#59) (KAN-135)
Browse files Browse the repository at this point in the history
  • Loading branch information
0114chan committed Nov 6, 2024
1 parent b7985b4 commit 2bbdd65
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions app/src/main/java/com/example/mhnfe/ui/screens/auth/LoginScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.mhnfe.ui.screens.auth

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CheckboxDefaults
Expand All @@ -15,6 +16,8 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.example.mhnfe.R
import com.example.mhnfe.ui.components.MainTextBox
import com.example.mhnfe.ui.components.SubTopBar
Expand All @@ -27,7 +30,7 @@ import com.example.mhnfe.ui.theme.mainGray3
@Composable
fun LoginScreen(
modifier: Modifier = Modifier,
onBackClick: () -> Unit,
navController: NavController,
onLoginClick: () -> Unit
) {
val focusManager = LocalFocusManager.current
Expand All @@ -38,7 +41,7 @@ fun LoginScreen(
topBar = {
SubTopBar(
text = "로그인",
onBack = onBackClick
onBack = { navController.popBackStack() }
)
}
) { paddingValues ->
Expand All @@ -48,14 +51,14 @@ fun LoginScreen(
.fillMaxSize()
.padding(horizontal = 34.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceBetween // 최상위 Column에 SpaceBetween 적용
verticalArrangement = Arrangement.spacedBy(110.dp, alignment = Alignment.Top)
) {
// 상단부 (로고)
Column(
horizontalAlignment = Alignment.CenterHorizontally
modifier = modifier.padding(vertical = 50.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(40.dp, alignment = Alignment.CenterVertically)
) {
Spacer(modifier = Modifier.height(40.dp))

// 로고 이미지
Image(
painter = painterResource(id = R.drawable.logo2),
Expand All @@ -64,12 +67,12 @@ fun LoginScreen(
contentScale = ContentScale.Fit
)

Spacer(modifier = Modifier.height(60.dp))

// 입력 필드들과 자동로그인을 포함하는 Column
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
verticalArrangement = Arrangement.spacedBy(16.dp, alignment = Alignment.CenterVertically),
horizontalAlignment = Alignment.Start
) {
MainTextBox(
Expand All @@ -83,7 +86,7 @@ fun LoginScreen(
)

// 자동 로그인 체크박스
Row( // Column을 Row로 변경
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.offset((-12).dp)
) {
Expand All @@ -100,27 +103,25 @@ fun LoginScreen(
}
}


// 하단부 버튼과 텍스트를 포함하는 Column
Column(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 20.dp),
modifier = modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
// 로그인 버튼
middleButton(
text = "로그인",
onClick = onLoginClick,
modifier = Modifier.fillMaxWidth()
onClick = onLoginClick
)

// 비밀번호 찾기 텍스트
Text(
text = "비밀번호를 잊어버리셨나요?",
textAlign = TextAlign.Center,
color = mainGray,
modifier = Modifier
.clickable { navController.navigate("forgot_password") }

)
}
Expand All @@ -137,7 +138,8 @@ fun LoginScreen(
@Composable
fun LoginScreenPreview() {
LoginScreen(
onBackClick = {},
navController = rememberNavController(),
onLoginClick = {}
)
}
}

0 comments on commit 2bbdd65

Please sign in to comment.