Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PC-292] 로그인 화면, 번호 인증 화면 ui 구현 #30

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

sksowk156
Copy link
Contributor

@sksowk156 sksowk156 commented Jan 11, 2025

PC-292

1. ⭐️ 변경된 내용

  • login 페이지 ui 구현
  • verification 페이지 ui 구현

2. 🖼️ 스크린샷(선택)

KakaoTalk_20241225_161047624
KakaoTalk_20250111_155255449.mp4

3. 💡 알게된 부분

4. 📌 이 부분은 꼭 봐주세요!

  • timer 기능을
        timerJob = viewModelScope.launch {
            while (true) {
                delay(1000L)
                withState { currentState ->
                    if (currentState.remainingTimeInSec <= 0) {
                        setState {
                            copy(
                                remainingTimeInSec = 0,
                                verificationCodeStatus = VerificationState.VerificationCodeStatus.TIME_EXPIRED,
                            )
                        }
                        return@withState
                    }

                    setState {
                        copy(remainingTimeInSec = currentState.remainingTimeInSec - 1)
                    }
                }
            }
        }

이렇게 while(true)로 처리했어요! 혹시 더 좋은 방법이 있을까요?

@sksowk156 sksowk156 added UI/UX 🎨 디자인 시스템, 디자인 리소스 관련 코드 🎨 리뷰 원해요🔥 피어의 리뷰를 기다리는 ing.. 🔥 ㅈㅎ찐혁 🌙 훗날 세상을 아우를 남자, sksowk156 labels Jan 11, 2025
@sksowk156 sksowk156 requested a review from tgyuuAn January 11, 2025 06:58
@sksowk156 sksowk156 self-assigned this Jan 11, 2025
Copy link
Member

@tgyuuAn tgyuuAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진혁님 고생하셨습니다!!!!!!!!

코멘트에 제 생각을 가득 담아봤습니다!!

꼼꼼히 살펴보시고 의견 주세용~~~~~~~😋😋😋😋

Comment on lines +3 to +6
interface VerificationCodeRepository {
suspend fun requestVerificationCode(phoneNumber: String): Boolean
suspend fun verify(code: String): Boolean
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4)

서버 명세에 이미 해당 기능은 나와있는데, PieceApi에 아래와 같은 메서드 명으로 정의했어요.

아래와 같은 메서드 명으로 변경하는 것은 어떨까요 ?!

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 api가 정의되어 있었군요! 좋아요!! 이 네이밍이 좋은 거 같아요!

@@ -1,21 +1,42 @@
package com.puzzle.auth.graph.login

import android.util.Log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3) 불필요한 import는 지워도 될 것 같아요!!!!!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

Comment on lines +132 to +162
Button(
onClick = loginKakao,
enabled = true,
shape = RoundedCornerShape(8.dp),
colors = ButtonDefaults.buttonColors(
containerColor = Color(0xFFFFE812),
contentColor = PieceTheme.colors.white,
disabledContainerColor = PieceTheme.colors.light1,
disabledContentColor = PieceTheme.colors.white,
),
modifier = Modifier
.height(52.dp)
.fillMaxWidth(),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
Image(
painter = painterResource(R.drawable.ic_kakao_login),
contentDescription = null,
modifier = Modifier.size(20.dp),
)

Text(
text = "카카오로 시작하기",
style = PieceTheme.typography.bodyMSB,
color = PieceTheme.colors.black,
)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3)

이 부분 DesignSystem Component에 정의되어있는 버튼인데,

Component로 빼는 것은 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영해두겠습니다!!


Spacer(modifier = Modifier.height(20.dp))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Padding을 사용하지 않고 Spacer를 사용한 이유는 무엇인가요 ?!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 그러네요! ui 상으로 padding으로 처리하는게 맞는 거 같아요...!!! 👍

Comment on lines +118 to +155
Text(
text = stringResource(R.string.verification_subtitle),
style = PieceTheme.typography.bodySM,
color = PieceTheme.colors.dark3,
modifier = Modifier.fillMaxWidth(),
)

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

PhoneNumberBody(
isValidPhoneNumber = state.isValidPhoneNumber,
hasStarted = state.hasStarted,
onRequestVerificationCodeClick = onRequestVerificationCodeClick,
)

if (state.hasStarted) {
Spacer(modifier = Modifier.height(32.dp))

VerificationCodeBody(
remainingTimeInSec = state.remainingTimeInSec,
verificationCodeStatus = state.verificationCodeStatus,
onVerifyClick = onVerifyClick,
)
}

Spacer(modifier = Modifier.weight(1f))

PieceSolidButton(
label = stringResource(R.string.verification_submit),
onClick = {
onNextClick()
},
enabled = state.isVerified,
modifier = Modifier.fillMaxWidth(),
)

Spacer(modifier = Modifier.height(10.dp))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3)

제가 생각했을 때, 상단 패딩 68, 하단 패딩 189는 화면의 비율로 가져가야 할 것 같아요.

2025-01-11.4.21.34.mov
Suggested change
Text(
text = stringResource(R.string.verification_subtitle),
style = PieceTheme.typography.bodySM,
color = PieceTheme.colors.dark3,
modifier = Modifier.fillMaxWidth(),
)
Spacer(modifier = Modifier.height(70.dp))
PhoneNumberBody(
isValidPhoneNumber = state.isValidPhoneNumber,
hasStarted = state.hasStarted,
onRequestVerificationCodeClick = onRequestVerificationCodeClick,
)
if (state.hasStarted) {
Spacer(modifier = Modifier.height(32.dp))
VerificationCodeBody(
remainingTimeInSec = state.remainingTimeInSec,
verificationCodeStatus = state.verificationCodeStatus,
onVerifyClick = onVerifyClick,
)
}
Spacer(modifier = Modifier.weight(1f))
PieceSolidButton(
label = stringResource(R.string.verification_submit),
onClick = {
onNextClick()
},
enabled = state.isVerified,
modifier = Modifier.fillMaxWidth(),
)
Spacer(modifier = Modifier.height(10.dp))
}
Text(
text = stringResource(R.string.verification_subtitle),
style = PieceTheme.typography.bodySM,
color = PieceTheme.colors.dark3,
modifier = Modifier.fillMaxWidth(),
)
Spacer(modifier = Modifier.weight(0.7f))
PhoneNumberBody(
isValidPhoneNumber = state.isValidPhoneNumber,
hasStarted = state.hasStarted,
onRequestVerificationCodeClick = onRequestVerificationCodeClick,
)
VerificationCodeBody(
remainingTimeInSec = state.remainingTimeInSec,
verificationCodeStatus = state.verificationCodeStatus,
onVerifyClick = onVerifyClick,
modifier = Modifier.padding(top = if(state.hasStarted) 32.dp else 0.dp),
)
Spacer(modifier = Modifier.weight(1.9f))
PieceSolidButton(
label = stringResource(R.string.verification_submit),
onClick = {
onNextClick()
},
enabled = state.isVerified,
modifier = Modifier.fillMaxWidth()
.padding(bottom=10.dp),
)
}

는 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ui상 인증번호 받기를 누르면 보여주신 ui가 나오는데 받기를 누르기 전엔 아래와 같은 ui로 되어 있어요!
KakaoTalk_20241225_161047624
그래서 하단의 높이가 달라지는 순간이 있기 때문에 비율 값을 고정하긴 어려울 것 같아요! 그리고 디자이너님께서 상단 패딩을 기준으로 하단을 잡아달라고 하셔서 weight(1f)로 처리해두었습니다!

state.hasStarted는 인증번호를 요청했는지 유무를 나타내는 변수로 이것이 true이면 인증번호를 입력하는 란이 화면에 나타납니다!

뭔가 hasStarted 네이밍이 적절하지 않았던 거 같아요...!!
isAuthCodeRequested는 어떤가요??

Copy link
Contributor Author

@sksowk156 sksowk156 Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상단이나 하단에 spacer가 아닌 패딩으로 처리가 필요한 부분들은 반영해두겠습니다!!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 그렇군요!

그럼 상단에는 고정값 패딩으로 가고 하단에만 weight(1f) 하면 될 것 같아요.

isAuthCodeRequested 너무 좋습니다!

Comment on lines +30 to +31
# https://developer.android.com/jetpack/androidx/releases/compose-foundation
androidxComposeFoundation = "1.7.6"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 뭐할 때 쓰는 라이브러리 인가용 ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BasicTextField를 쓸려고 한건데, BasicTextField는 기본 컴포넌트에요 Material에 TextField도 있는데 뭔가 제가 원하는데로 디자인이 잘 안되서 BasicTextField를 썼습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI/UX 🎨 디자인 시스템, 디자인 리소스 관련 코드 🎨 ㅈㅎ찐혁 🌙 훗날 세상을 아우를 남자, sksowk156 리뷰 원해요🔥 피어의 리뷰를 기다리는 ing.. 🔥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants