Skip to content

Commit

Permalink
Merge pull request #155 from Team-Ampersand/feature/152_publishing_home
Browse files Browse the repository at this point in the history
🔀 :: (#151) - publishing sign up
  • Loading branch information
diejdkll authored Jan 25, 2024
2 parents 121456f + cc14720 commit ec2d80e
Show file tree
Hide file tree
Showing 9 changed files with 672 additions and 42 deletions.
27 changes: 26 additions & 1 deletion app/src/main/java/com/msg/dotori/DotoriNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import com.msg.presentation.view.find_password.navigation.findPasswordScreen
import com.msg.presentation.view.home.navigation.mainScreen
import com.msg.presentation.view.home.navigation.navigateToMain
import com.msg.presentation.view.login.navigation.loginScreen
import com.msg.presentation.view.login.navigation.navigateToLogin
import com.msg.presentation.view.massage_chair.navigation.massageChairScreen
import com.msg.presentation.view.music.navigation.musicScreen
import com.msg.presentation.view.notice.navigation.navigateToNotice
Expand All @@ -14,6 +17,11 @@ import com.msg.presentation.view.notice.navigation.noticeDetailScreen
import com.msg.presentation.view.notice.navigation.noticeEditScreen
import com.msg.presentation.view.notice.navigation.noticeScreen
import com.msg.presentation.view.self_study.navigation.selfStudyScreen
import com.msg.presentation.view.signup.navigation.authenticationScreen
import com.msg.presentation.view.signup.navigation.navigateToAuthentication
import com.msg.presentation.view.signup.navigation.navigateToPassword
import com.msg.presentation.view.signup.navigation.navigateToSignUp
import com.msg.presentation.view.signup.navigation.passwordScreen
import com.msg.presentation.view.signup.navigation.signUpScreen
import com.msg.presentation.view.student_info.navigation.studentInfoScreen

Expand All @@ -26,8 +34,25 @@ fun DotoriNavHost(
navController = navController,
startDestination = startDestination
) {
loginScreen(
navigateToMain = { navController.navigateToMain() },
navigateToSignUp = { navController.navigateToSignUp() }
)
signUpScreen(
navigateToBack = { navController.popBackStack() },
navigateToLogin = { navController.navigateToLogin() },
navigateToAuthentication = { navController.navigateToAuthentication() }
)
authenticationScreen(
navigateToBack = { navController.popBackStack() },
navigateToLogin = { navController.navigateToLogin() },
navigateToPassword = { navController.navigateToPassword() }
)
passwordScreen(
navigateToBack = { navController.popBackStack() },
navigateToLogin = { navController.navigateToLogin() }
)
findPasswordScreen()
signUpScreen()
massageChairScreen()
selfStudyScreen()
musicScreen()
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/msg/dotori/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.activity.compose.setContent
import androidx.navigation.compose.rememberNavController
import com.dotori.dotori_components.theme.DotoriTheme
import com.msg.presentation.view.home.navigation.mainRoute
import com.msg.presentation.view.login.navigation.loginRoute
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -14,7 +15,7 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setContent {
DotoriTheme {
DotoriNavHost(navController = rememberNavController(), startDestination = mainRoute)
DotoriNavHost(navController = rememberNavController(), startDestination = loginRoute)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -45,7 +46,8 @@ import com.msg.presentation.viewmodel.util.Event
fun LoginScreen(
modifier: Modifier = Modifier,
loginViewModel: LoginViewModel = hiltViewModel(),
navigateToMain: () -> Unit
navigateToMain: () -> Unit,
navigateToSignUp: () -> Unit
) {
var idText by remember { mutableStateOf("") }
var passwordText by remember { mutableStateOf("") }
Expand All @@ -66,7 +68,10 @@ fun LoginScreen(
.padding(horizontal = 20.dp)
) {
Box(modifier = Modifier.padding(top = 16.dp)) {
ArrowLeft2Icon(contentDescription = "ArrowLeftIcon")
ArrowLeft2Icon(
modifier = Modifier.clickable { },
contentDescription = "ArrowLeftIcon"
)
Text(
modifier = Modifier
.fillMaxWidth()
Expand Down Expand Up @@ -119,7 +124,8 @@ fun LoginScreen(
indication = null,
onClick = { passwordText = "" }
)
) }
) },
visualTransformation = PasswordVisualTransformation()
)
Spacer(modifier = Modifier.height(8.dp))
Text(
Expand Down Expand Up @@ -162,7 +168,9 @@ fun LoginScreen(
modifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) {},
) {
navigateToSignUp()
},
text = "회원가입",
style = DotoriTheme.typography.body2,
color = DotoriTheme.colors.primary10,
Expand All @@ -174,5 +182,7 @@ fun LoginScreen(
@Preview
@Composable
fun LoginScreenPreview() {
LoginScreen {}
LoginScreen(
navigateToMain = {}
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ fun NavController.navigateToLogin() {
this.navigate(loginRoute)
}

fun NavGraphBuilder.loginScreen(navigateToMain: () -> Unit) {
fun NavGraphBuilder.loginScreen(
navigateToMain: () -> Unit,
navigateToSignUp: () -> Unit
) {
composable(loginRoute) {
LoginScreen(navigateToMain = navigateToMain)
LoginScreen(
navigateToMain = navigateToMain,
navigateToSignUp = navigateToSignUp
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
package com.msg.presentation.view.signup

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
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.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.dotori.dotori_components.components.button.DotoriButton
import com.dotori.dotori_components.components.text_field.DotoriTextField
import com.dotori.dotori_components.theme.ArrowLeft2Icon
import com.dotori.dotori_components.theme.DotoriLogoIcon
import com.dotori.dotori_components.theme.DotoriText
import com.dotori.dotori_components.theme.DotoriTheme
import com.dotori.dotori_components.theme.XMarkIcon
import com.msg.presentation.view.signup.component.SignUpDatIndicator

@Composable
fun AuthenticationScreen(
modifier: Modifier = Modifier,
navigateToBack: () -> Unit,
navigateToLogin: () -> Unit,
navigateToPassword: () -> Unit
) {
var emailText by remember { mutableStateOf("") }
var numberText by remember { mutableStateOf("") }
var isEmailClicked by remember { mutableStateOf(false) }
var isNumberClicked by remember { mutableStateOf(false) }

Column(
modifier = modifier
.fillMaxSize()
.background(DotoriTheme.colors.background)
.padding(horizontal = 20.dp)
) {
Box(modifier = Modifier.padding(top = 16.dp)) {
ArrowLeft2Icon(
modifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) { navigateToBack() },
contentDescription = "ArrowLeftIcon"
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 2.dp),
text = "회원가입",
style = DotoriTheme.typography.subTitle2,
color = DotoriTheme.colors.neutral10,
textAlign = TextAlign.Center
)
}
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Row(
modifier = Modifier
.padding(top = 18.5.dp, bottom = 18.5.dp)
.background(DotoriTheme.colors.background),
horizontalArrangement = Arrangement.spacedBy(12.dp),
verticalAlignment = Alignment.CenterVertically
) {
DotoriLogoIcon()
DotoriText()
}
SignUpDatIndicator(index = 2)
}
Spacer(modifier = Modifier.height(8.dp))
Text(
modifier = Modifier.fillMaxWidth(),
text = "이메일",
style = DotoriTheme.typography.smallTitle,
color = DotoriTheme.colors.neutral10,
textAlign = TextAlign.Start
)
Spacer(modifier = Modifier.height(8.dp))
Row(modifier = Modifier.fillMaxWidth()) {
DotoriTextField(
modifier = Modifier
.weight(2f)
.onFocusChanged { isEmailClicked = it.isFocused },
value = emailText,
placeholder = "이메일",
onValueChange = { emailText = it },
trailingIcon = {
if (isEmailClicked && emailText.isNotBlank()) XMarkIcon(
modifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = { emailText = "" }
)
)
}
)
DotoriButton(
modifier = Modifier
.weight(1f)
.height(52.dp),
text = "인증하기"
) {}
}
Spacer(modifier = Modifier.height(24.dp))
Text(
modifier = Modifier.fillMaxWidth(),
text = "인증번호",
style = DotoriTheme.typography.smallTitle,
color = DotoriTheme.colors.neutral10,
textAlign = TextAlign.Start
)
Spacer(modifier = Modifier.height(8.dp))
DotoriTextField(
modifier = Modifier.onFocusChanged { isNumberClicked = it.isFocused },
value = numberText,
placeholder = "인증번호",
onValueChange = { numberText = it },
trailingIcon = {
if (isNumberClicked && numberText.isNotBlank()) XMarkIcon(
modifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = { numberText = "" }
)
)
}
)
Spacer(modifier = Modifier.height(24.dp))
DotoriButton(
modifier = Modifier
.fillMaxWidth()
.height(52.dp),
text = "다음"
) {
navigateToPassword()
}
Spacer(modifier = Modifier.height(16.dp))
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
Text(
text = "이미 회원이라면? ",
style = DotoriTheme.typography.body2,
color = DotoriTheme.colors.neutral20,
)
Text(
modifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) {
navigateToLogin()
},
text = "로그인",
style = DotoriTheme.typography.body2,
color = DotoriTheme.colors.primary10,
)
}
}
}
Loading

0 comments on commit ec2d80e

Please sign in to comment.