|
1 | 1 | package com.threegap.bitnagil.presentation.login |
2 | 2 |
|
| 3 | +import androidx.compose.foundation.Image |
3 | 4 | import androidx.compose.foundation.background |
| 5 | +import androidx.compose.foundation.layout.Arrangement |
4 | 6 | import androidx.compose.foundation.layout.Box |
| 7 | +import androidx.compose.foundation.layout.Column |
| 8 | +import androidx.compose.foundation.layout.Row |
| 9 | +import androidx.compose.foundation.layout.Spacer |
| 10 | +import androidx.compose.foundation.layout.aspectRatio |
5 | 11 | import androidx.compose.foundation.layout.fillMaxSize |
| 12 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 13 | +import androidx.compose.foundation.layout.height |
6 | 14 | import androidx.compose.foundation.layout.padding |
7 | | -import androidx.compose.material3.Button |
| 15 | +import androidx.compose.foundation.shape.RoundedCornerShape |
8 | 16 | import androidx.compose.material3.Text |
9 | 17 | import androidx.compose.runtime.Composable |
10 | 18 | import androidx.compose.ui.Alignment |
11 | 19 | import androidx.compose.ui.Modifier |
12 | | -import androidx.compose.ui.graphics.Color |
| 20 | +import androidx.compose.ui.layout.ContentScale |
13 | 21 | import androidx.compose.ui.platform.LocalContext |
| 22 | +import androidx.compose.ui.platform.LocalDensity |
| 23 | +import androidx.compose.ui.platform.LocalWindowInfo |
| 24 | +import androidx.compose.ui.res.painterResource |
| 25 | +import androidx.compose.ui.text.style.TextAlign |
14 | 26 | import androidx.compose.ui.tooling.preview.Preview |
15 | 27 | import androidx.compose.ui.unit.dp |
16 | 28 | import androidx.hilt.navigation.compose.hiltViewModel |
17 | 29 | import com.threegap.bitnagil.designsystem.BitnagilTheme |
| 30 | +import com.threegap.bitnagil.designsystem.R |
| 31 | +import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon |
| 32 | +import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple |
18 | 33 | import com.threegap.bitnagil.presentation.login.kakao.KakaoLoginHandlerImpl |
19 | 34 | import com.threegap.bitnagil.presentation.login.model.LoginSideEffect |
20 | 35 | import org.orbitmvi.orbit.compose.collectSideEffect |
@@ -59,25 +74,66 @@ private fun LoginScreen( |
59 | 74 | onKakaoLoginClick: () -> Unit, |
60 | 75 | modifier: Modifier = Modifier, |
61 | 76 | ) { |
62 | | - Box( |
| 77 | + val windowInfo = LocalWindowInfo.current |
| 78 | + val screenHeight = with(LocalDensity.current) { |
| 79 | + windowInfo.containerSize.height.toDp() |
| 80 | + } |
| 81 | + |
| 82 | + Column( |
| 83 | + horizontalAlignment = Alignment.CenterHorizontally, |
63 | 84 | modifier = modifier |
64 | 85 | .fillMaxSize() |
65 | | - .background(Color.White), |
| 86 | + .background(BitnagilTheme.colors.white), |
66 | 87 | ) { |
| 88 | + Spacer(modifier = Modifier.height(screenHeight * 0.0748f)) |
| 89 | + |
67 | 90 | Text( |
68 | | - text = "빛나길 로고", |
69 | | - modifier = Modifier.align(Alignment.Center), |
| 91 | + text = "빛나길에 오신걸 환영해요!", |
| 92 | + color = BitnagilTheme.colors.navy500, |
| 93 | + style = BitnagilTheme.typography.title2Bold, |
| 94 | + textAlign = TextAlign.Center, |
| 95 | + modifier = Modifier.fillMaxWidth(), |
| 96 | + ) |
| 97 | + |
| 98 | + Spacer(modifier = Modifier.height(screenHeight * 0.185f)) |
| 99 | + |
| 100 | + Image( |
| 101 | + painter = painterResource(R.drawable.intro_character), |
| 102 | + contentDescription = null, |
| 103 | + contentScale = ContentScale.Fit, |
| 104 | + modifier = Modifier |
| 105 | + .padding(50.dp) |
| 106 | + .aspectRatio(260f / 295f), |
70 | 107 | ) |
71 | 108 |
|
72 | | - Button( |
73 | | - onClick = onKakaoLoginClick, |
| 109 | + Spacer(modifier = Modifier.weight(1f)) |
| 110 | + |
| 111 | + Box( |
74 | 112 | modifier = Modifier |
75 | | - .align(Alignment.BottomCenter) |
76 | | - .padding(20.dp), |
| 113 | + .padding(start = 16.dp, end = 16.dp, bottom = 20.dp) |
| 114 | + .clickableWithoutRipple { onKakaoLoginClick() } |
| 115 | + .background( |
| 116 | + color = BitnagilTheme.colors.kakao, |
| 117 | + shape = RoundedCornerShape(12.dp) |
| 118 | + ) |
| 119 | + .fillMaxWidth() |
| 120 | + .padding(vertical = 18.dp), |
| 121 | + contentAlignment = Alignment.Center |
| 122 | + |
77 | 123 | ) { |
78 | | - Text( |
79 | | - text = "카카오 로그인버튼", |
80 | | - ) |
| 124 | + Row( |
| 125 | + verticalAlignment = Alignment.CenterVertically, |
| 126 | + horizontalArrangement = Arrangement.spacedBy(8.dp) |
| 127 | + ) { |
| 128 | + BitnagilIcon( |
| 129 | + id = R.drawable.ic_kakao_login, |
| 130 | + ) |
| 131 | + Text( |
| 132 | + text = "카카오로 시작하기", |
| 133 | + color = BitnagilTheme.colors.black, |
| 134 | + style = BitnagilTheme.typography.button2 |
| 135 | + ) |
| 136 | + } |
81 | 137 | } |
82 | 138 | } |
83 | 139 | } |
|
0 commit comments