-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
Are you sure you want to change the base?
Changes from all commits
a4b7ff5
a362e65
2d69ca4
6ddbc77
eac5db6
589d037
da6b76c
27914c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.puzzle.data.repository | ||
|
||
import com.puzzle.domain.repository.VerificationCodeRepository | ||
import javax.inject.Inject | ||
|
||
class VerificationCodeRepositoryImpl @Inject constructor() : VerificationCodeRepository { | ||
override suspend fun requestVerificationCode(phoneNumber: String): Boolean { | ||
return true | ||
} | ||
|
||
override suspend fun verify(code: String): Boolean { | ||
return true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<group> | ||
<clip-path | ||
android:pathData="M5.722,2L14.61,2A3.556,3.556 0,0 1,18.166 5.556L18.166,14.444A3.556,3.556 0,0 1,14.61 18L5.722,18A3.556,3.556 0,0 1,2.166 14.444L2.166,5.556A3.556,3.556 0,0 1,5.722 2z"/> | ||
<path | ||
android:pathData="M17.846,10.181C17.846,9.614 17.795,9.069 17.701,8.545H10.166V11.639H14.472C14.286,12.639 13.722,13.487 12.875,14.054V16.061H15.461C16.973,14.669 17.846,12.618 17.846,10.181Z" | ||
android:fillColor="#4285F4" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M10.166,18C12.326,18 14.137,17.283 15.46,16.061L12.875,14.054C12.158,14.534 11.242,14.818 10.166,14.818C8.082,14.818 6.318,13.41 5.689,11.519H3.017V13.592C4.333,16.207 7.038,18 10.166,18Z" | ||
android:fillColor="#34A853" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M5.69,11.521C5.53,11.041 5.439,10.528 5.439,10.001C5.439,9.474 5.53,8.961 5.69,8.481V6.408H3.017C2.475,7.488 2.166,8.71 2.166,10.001C2.166,11.292 2.475,12.514 3.017,13.594L5.69,11.521Z" | ||
android:fillColor="#FBBC05" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M10.166,5.182C11.34,5.182 12.395,5.585 13.224,6.378L15.518,4.084C14.133,2.793 12.322,2 10.166,2C7.038,2 4.333,3.793 3.017,6.407L5.689,8.48C6.318,6.589 8.082,5.182 10.166,5.182Z" | ||
android:fillColor="#FF0000" | ||
android:fillType="evenOdd"/> | ||
</group> | ||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M10,15.239C14.418,15.239 18,12.425 18,8.954C18,5.482 14.418,2.668 10,2.668C5.582,2.668 2,5.482 2,8.954C2,11.088 3.354,12.974 5.424,14.11L4.285,17.526L8.199,15.08C8.778,15.184 9.381,15.239 10,15.239Z" | ||
android:fillColor="#1B1A2A" | ||
android:fillType="evenOdd"/> | ||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.puzzle.domain.repository | ||
|
||
interface VerificationCodeRepository { | ||
suspend fun requestVerificationCode(phoneNumber: String): Boolean | ||
suspend fun verify(code: String): Boolean | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
package com.puzzle.auth.graph.login | ||
|
||
import android.util.Log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3) 불필요한 import는 지워도 될 것 같아요!!!!!!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😭 |
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
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.size | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.SpanStyle | ||
import androidx.compose.ui.text.buildAnnotatedString | ||
import androidx.compose.ui.text.withStyle | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.sp | ||
import androidx.compose.ui.unit.dp | ||
import com.airbnb.mvrx.compose.collectAsState | ||
import com.airbnb.mvrx.compose.mavericksViewModel | ||
import com.kakao.sdk.user.UserApiClient | ||
import com.puzzle.auth.graph.login.contract.LoginIntent.Navigate | ||
import com.puzzle.auth.graph.login.contract.LoginState | ||
import com.puzzle.designsystem.R | ||
import com.puzzle.designsystem.component.PieceSubCloseTopBar | ||
import com.puzzle.designsystem.foundation.PieceTheme | ||
import com.puzzle.navigation.AuthGraph | ||
import com.puzzle.navigation.AuthGraphDest | ||
|
@@ -48,29 +69,138 @@ fun LoginScreen( | |
state: LoginState, | ||
loginKakao: () -> Unit, | ||
navigate: (NavigationEvent) -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
modifier = modifier | ||
.fillMaxSize() | ||
.background(PieceTheme.colors.white) | ||
.padding(horizontal = 20.dp) | ||
.clickable { | ||
navigate( | ||
NavigationEvent.NavigateTo( | ||
route = AuthGraphDest.RegistrationRoute, | ||
route = AuthGraphDest.VerificationRoute, | ||
popUpTo = AuthGraph, | ||
) | ||
) | ||
}, | ||
) { | ||
PieceSubCloseTopBar( | ||
title = "", | ||
onCloseClick = { }, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 14.dp), | ||
) | ||
|
||
Spacer(modifier = Modifier.height(20.dp)) | ||
|
||
Text( | ||
text = "카카오 로그인", | ||
fontSize = 30.sp, | ||
modifier = Modifier.clickable { loginKakao() }, | ||
text = buildAnnotatedString { | ||
withStyle(style = SpanStyle(color = PieceTheme.colors.primaryDefault)) { | ||
append("Piece") | ||
} | ||
|
||
append("에서 마음이 통하는\n이상형을 만나보세요") | ||
}, | ||
style = PieceTheme.typography.headingLSB, | ||
color = PieceTheme.colors.black, | ||
modifier = Modifier.fillMaxWidth(), | ||
) | ||
|
||
Spacer(modifier = Modifier.height(12.dp)) | ||
|
||
Text( | ||
text = "AuthRoute", | ||
fontSize = 30.sp, | ||
text = "서로의 빈 곳을 채우며 맞물리는 퍼즐처럼.\n서로의 가치관과 마음이 연결되는 순간을 만들어갑니다.", | ||
style = PieceTheme.typography.bodySM, | ||
color = PieceTheme.colors.dark3, | ||
modifier = Modifier.fillMaxWidth(), | ||
) | ||
|
||
Spacer(modifier = Modifier.height(70.dp)) | ||
|
||
Image( | ||
painter = painterResource(R.drawable.ic_puzzle1), | ||
contentDescription = null, | ||
modifier = Modifier | ||
.size(240.dp) | ||
.align(Alignment.CenterHorizontally), | ||
) | ||
|
||
Spacer(modifier = Modifier.weight(1f)) | ||
|
||
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, | ||
) | ||
} | ||
} | ||
Comment on lines
+132
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3) 이 부분 DesignSystem Component에 정의되어있는 버튼인데, Component로 빼는 것은 어떨까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 반영해두겠습니다!! |
||
|
||
Spacer(modifier = Modifier.height(10.dp)) | ||
|
||
Button( | ||
onClick = loginKakao, | ||
enabled = true, | ||
shape = RoundedCornerShape(8.dp), | ||
colors = ButtonDefaults.buttonColors( | ||
containerColor = PieceTheme.colors.white, | ||
contentColor = PieceTheme.colors.white, | ||
disabledContainerColor = PieceTheme.colors.light1, | ||
disabledContentColor = PieceTheme.colors.white, | ||
), | ||
modifier = Modifier | ||
.height(52.dp) | ||
.fillMaxWidth() | ||
.border( | ||
width = 1.dp, | ||
color = PieceTheme.colors.light1, | ||
shape = RoundedCornerShape(8.dp) | ||
), | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Image( | ||
painter = painterResource(R.drawable.ic_google_login), | ||
contentDescription = null, | ||
modifier = Modifier.size(20.dp), | ||
) | ||
|
||
Text( | ||
text = "구글로 시작하기", | ||
style = PieceTheme.typography.bodyMSB, | ||
color = PieceTheme.colors.black, | ||
) | ||
} | ||
} | ||
|
||
Spacer(modifier = Modifier.height(10.dp)) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p4)
서버 명세에 이미 해당 기능은 나와있는데, PieceApi에 아래와 같은 메서드 명으로 정의했어요.
아래와 같은 메서드 명으로 변경하는 것은 어떨까요 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 api가 정의되어 있었군요! 좋아요!! 이 네이밍이 좋은 거 같아요!