diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt
similarity index 81%
rename from feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpBottomSheet.kt
rename to core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt
index cfc257be2..3ac38ff49 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpBottomSheet.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt
@@ -1,4 +1,4 @@
-package com.terning.feature.onboarding.signup.component
+package com.terning.core.designsystem.component.bottomsheet
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
@@ -11,28 +11,33 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
+import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
+import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
-import com.terning.core.designsystem.component.bottomsheet.TerningBasicBottomSheet
+import com.terning.core.R
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.extension.noRippleClickable
-import com.terning.feature.R
+import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SignUpBottomSheet(
modifier: Modifier = Modifier,
onDismiss: () -> Unit,
- onStartDialog: () -> Unit
+ onSaveClick: () -> Unit
) {
+ val scope = rememberCoroutineScope()
+ val sheetState = rememberModalBottomSheetState()
+
TerningBasicBottomSheet(
content = {
Column {
@@ -52,13 +57,21 @@ fun SignUpBottomSheet(
paddingVertical = 19.dp,
cornerRadius = 10.dp,
text = R.string.sign_up_dialog_start,
- onButtonClick = { onStartDialog() },
+ onButtonClick = {
+ scope.launch { sheetState.hide() }
+ .invokeOnCompletion {
+ if (!sheetState.isVisible) {
+ onSaveClick()
+ }
+ }
+ },
modifier = modifier.padding(horizontal = 24.dp)
)
Spacer(modifier = modifier.padding(bottom = 15.dp))
}
},
- onDismissRequest = { onDismiss() }
+ onDismissRequest = { onDismiss() },
+ sheetState = sheetState
)
}
diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt
index ed923e9bd..cc4f86985 100644
--- a/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt
@@ -5,7 +5,6 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.padding
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
@@ -22,8 +21,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.terning.core.R
-import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey150
+import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningMain2
import com.terning.core.designsystem.theme.TerningPointTheme
@@ -55,7 +54,7 @@ fun TerningBasicButton(
containerColor = backgroundColor,
contentColor = White,
disabledContainerColor = Grey150,
- disabledContentColor = Black
+ disabledContentColor = Grey350
),
shape = shape,
onClick = { onButtonClick() }
diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt
index f022fff93..8a6d8ced0 100644
--- a/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/NameTextField.kt
@@ -7,26 +7,25 @@ import androidx.compose.ui.graphics.SolidColor
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.Grey400
-import com.terning.core.designsystem.theme.Grey500
-import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningTheme
@Composable
fun NameTextField(
- text: String,
+ value: String,
onValueChange: (String) -> Unit,
hint: String,
+ drawLineColor: Color,
helperMessage: String,
+ helperColor: Color,
helperIcon: Int? = null,
- helperColor: Color = TerningMain,
) {
TerningBasicTextField(
- value = text,
+ value = value,
onValueChange = onValueChange,
modifier = Modifier,
textStyle = TerningTheme.typography.detail1,
textColor = Black,
- drawLineColor = Grey500,
+ drawLineColor = drawLineColor,
cursorBrush = SolidColor(Grey400),
hint = hint,
hintColor = Grey300,
diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt
index e540c905c..21d181551 100644
--- a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt
@@ -34,6 +34,7 @@ fun SearchTextField(
leftIconColor = TerningMain,
enabled = enabled,
readOnly = readOnly,
- onDoneAction = onDoneAction
+ onDoneAction = onDoneAction,
+ helperColor = TerningMain
)
}
\ No newline at end of file
diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt
index 45feb21b6..e73c1a3d5 100644
--- a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt
@@ -51,8 +51,8 @@ fun TerningBasicTextField(
hint: String = "",
helperMessage: String = "",
helperIcon: Int? = null,
- helperColor: Color = TerningMain,
enabled: Boolean = true,
+ helperColor: Color,
readOnly: Boolean = false,
onDoneAction: (() -> Unit)? = null,
) {
diff --git a/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt b/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt
index 2f6e297ad..cabda466c 100644
--- a/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt
+++ b/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt
@@ -43,7 +43,8 @@ fun TerningBasicTopAppBar(
IconButton(
onClick = {
onBackButtonClick.invoke()
- }) {
+ }
+ ) {
Icon(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = stringResource(id = R.string.ic_back),
diff --git a/feature/src/main/res/drawable/ic_character1.xml b/core/src/main/res/drawable/ic_character1.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character1.xml
rename to core/src/main/res/drawable/ic_character1.xml
diff --git a/feature/src/main/res/drawable/ic_character2.xml b/core/src/main/res/drawable/ic_character2.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character2.xml
rename to core/src/main/res/drawable/ic_character2.xml
diff --git a/feature/src/main/res/drawable/ic_character3.xml b/core/src/main/res/drawable/ic_character3.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character3.xml
rename to core/src/main/res/drawable/ic_character3.xml
diff --git a/feature/src/main/res/drawable/ic_character4.xml b/core/src/main/res/drawable/ic_character4.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character4.xml
rename to core/src/main/res/drawable/ic_character4.xml
diff --git a/feature/src/main/res/drawable/ic_character5.xml b/core/src/main/res/drawable/ic_character5.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character5.xml
rename to core/src/main/res/drawable/ic_character5.xml
diff --git a/feature/src/main/res/drawable/ic_character6.xml b/core/src/main/res/drawable/ic_character6.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_character6.xml
rename to core/src/main/res/drawable/ic_character6.xml
diff --git a/feature/src/main/res/drawable/ic_selected_character.xml b/core/src/main/res/drawable/ic_selected_character.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_selected_character.xml
rename to core/src/main/res/drawable/ic_selected_character.xml
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index faa2d3afc..3de74512c 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -20,4 +20,9 @@
정렬 기준
공고 정렬 순서
+
+ 프로필 이미지 선택
+ 회원가입 바텀시트
+ 저장하기
+
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt
index 30f0aa83a..859ae0c3a 100644
--- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt
+++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt
@@ -12,7 +12,7 @@ import androidx.navigation.navOptions
import com.terning.feature.calendar.navigation.navigateCalendar
import com.terning.feature.home.navigation.navigateHome
import com.terning.feature.mypage.navigation.navigateMyPage
-import com.terning.feature.search.search.navigation.Search
+import com.terning.feature.onboarding.signin.navigation.SignIn
import com.terning.feature.search.search.navigation.navigateSearch
class MainNavigator(
@@ -22,7 +22,7 @@ class MainNavigator(
@Composable get() = navController
.currentBackStackEntryAsState().value?.destination
- val startDestination = Search
+ val startDestination = SignIn
val currentTab: MainTab?
@Composable get() = MainTab.find { tab ->
diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt
index 4ed5692a3..305ed227c 100644
--- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt
+++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt
@@ -23,6 +23,7 @@ import com.terning.core.util.NoRippleInteractionSource
import com.terning.feature.calendar.navigation.calendarNavGraph
import com.terning.feature.home.navigation.homeNavGraph
import com.terning.feature.mypage.navigation.myPageNavGraph
+import com.terning.feature.onboarding.filtering.navigation.filteringNavGraph
import com.terning.feature.onboarding.signin.navigation.signInNavGraph
import com.terning.feature.onboarding.signup.navigation.signUpNavGraph
import com.terning.feature.search.search.navigation.searchNavGraph
@@ -56,7 +57,8 @@ fun MainScreen(
searchNavGraph(navHostController = navigator.navController)
myPageNavGraph()
signInNavGraph(navHostController = navigator.navController)
- signUpNavGraph()
+ signUpNavGraph(navHostController = navigator.navController)
+ filteringNavGraph(navHostController = navigator.navController)
searchProcessNavGraph(navHostController = navigator.navController)
}
}
diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt
index bf1e1ec23..f4c413bba 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt
@@ -1,9 +1,17 @@
package com.terning.feature.onboarding.filtering
+import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
-import com.terning.feature.onboarding.filtering.navigation.FilteringNavigation
+import androidx.navigation.NavController
@Composable
-fun FilteringRoute(){
+fun FilteringRoute(
+ navController: NavController
+) {
+ FilteringScreen()
+}
-}
\ No newline at end of file
+@Composable
+fun FilteringScreen() {
+ Text(text = "filtering")
+}
diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt
index 6dcc12e7b..e69874fbd 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt
@@ -1,4 +1,30 @@
package com.terning.feature.onboarding.filtering.navigation
-class FilteringNavigation {
-}
\ No newline at end of file
+import androidx.navigation.NavController
+import androidx.navigation.NavGraphBuilder
+import androidx.navigation.NavHostController
+import androidx.navigation.NavOptions
+import androidx.navigation.compose.composable
+import com.terning.core.navigation.Route
+import com.terning.feature.onboarding.filtering.FilteringRoute
+import kotlinx.serialization.Serializable
+
+fun NavController.navigateFiltering(navOptions: NavOptions? = null) {
+ navigate(
+ route = Filtering,
+ navOptions = navOptions
+ )
+}
+
+fun NavGraphBuilder.filteringNavGraph(
+ navHostController: NavHostController
+) {
+ composable {
+ FilteringRoute(
+ navController = navHostController
+ )
+ }
+}
+
+@Serializable
+data object Filtering : Route
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt
index c1c6a22c7..ac1bac7a8 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt
@@ -26,6 +26,7 @@ import com.terning.core.extension.toast
import com.terning.feature.R
import com.terning.feature.home.navigation.navigateHome
import com.terning.feature.onboarding.signin.component.KakaoButton
+import com.terning.feature.onboarding.signup.navigation.navigateSignUp
@Composable
fun SignInRoute(
@@ -41,7 +42,7 @@ fun SignInRoute(
.collect { sideEffect ->
when (sideEffect) {
is SignInSideEffect.ShowToast -> context.toast(sideEffect.message)
- is SignInSideEffect.NavigateToHome -> navController.navigateHome()
+ is SignInSideEffect.NavigateToHome -> navController.navigateSignUp()
}
}
}
@@ -56,7 +57,6 @@ fun SignInScreen(
modifier: Modifier = Modifier,
onSignInClick: () -> Unit = {},
) {
-
Column(
modifier = modifier
.wrapContentHeight()
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/navigation/SignInNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/navigation/SignInNavigation.kt
index 0c3d35760..cba8bfc7c 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signin/navigation/SignInNavigation.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/signin/navigation/SignInNavigation.kt
@@ -5,7 +5,7 @@ import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.NavOptions
import androidx.navigation.compose.composable
-import com.terning.core.navigation.MainTabRoute
+import com.terning.core.navigation.Route
import com.terning.feature.onboarding.signin.SignInRoute
import kotlinx.serialization.Serializable
@@ -27,4 +27,4 @@ fun NavGraphBuilder.signInNavGraph(
}
@Serializable
-data object SignIn : MainTabRoute
\ No newline at end of file
+data object SignIn : Route
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt
index 9d3d3d411..a85d688f2 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt
@@ -1,13 +1,126 @@
package com.terning.feature.onboarding.signup
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.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.platform.LocalFocusManager
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.unit.dp
+import androidx.hilt.navigation.compose.hiltViewModel
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import androidx.navigation.NavController
+import com.terning.core.designsystem.component.button.RectangleButton
+import com.terning.core.designsystem.component.textfield.NameTextField
+import com.terning.core.designsystem.theme.TerningTheme
+import com.terning.core.extension.addFocusCleaner
+import com.terning.core.extension.noRippleClickable
+import com.terning.feature.R
+import com.terning.feature.onboarding.filtering.navigation.navigateFiltering
+import com.terning.core.designsystem.component.bottomsheet.SignUpBottomSheet
+import com.terning.feature.onboarding.signup.component.SignUpProfile
@Composable
-fun SignUpRoute() {
- SignUpScreen()
+fun SignUpRoute(
+ signUpViewModel: SignUpViewModel = hiltViewModel(),
+ navController: NavController
+) {
+ val signUpState by signUpViewModel.state.collectAsStateWithLifecycle()
+
+ SignUpScreen(
+ signUpViewModel = signUpViewModel,
+ signUpState = signUpState,
+ onButtonClick = { navController.navigateFiltering() }
+ )
}
@Composable
-fun SignUpScreen() {
+fun SignUpScreen(
+ modifier: Modifier = Modifier,
+ signUpState: SignUpState,
+ signUpViewModel: SignUpViewModel,
+ onButtonClick: () -> Unit
+) {
+ val focusManager = LocalFocusManager.current
+ var showBottomSheet by remember { mutableStateOf(false) }
-}
\ No newline at end of file
+ Column(
+ modifier = modifier
+ .fillMaxSize()
+ .addFocusCleaner(focusManager)
+ ) {
+ Spacer(modifier = modifier.weight(1f))
+ Text(
+ text = stringResource(id = R.string.sign_up_title),
+ style = TerningTheme.typography.heading2,
+ modifier = modifier.padding(
+ bottom = 42.dp,
+ start = 24.dp
+ )
+ )
+ if (showBottomSheet) {
+ SignUpBottomSheet(
+ onDismiss = { showBottomSheet = false },
+ onSaveClick = { showBottomSheet = false }
+ )
+ }
+ Text(
+ text = stringResource(id = R.string.sign_up_profile_image),
+ style = TerningTheme.typography.body2,
+ modifier = modifier
+ .padding(
+ start = 24.dp,
+ bottom = 20.dp
+ )
+ )
+ Column(
+ modifier = modifier
+ .align(Alignment.CenterHorizontally)
+ .padding(bottom = 52.dp)
+ ) {
+ SignUpProfile(
+ modifier = modifier.noRippleClickable {
+ showBottomSheet = true
+ }
+ )
+ }
+ Column(
+ modifier = modifier
+ .align(Alignment.CenterHorizontally)
+ .padding(horizontal = 24.dp)
+ ) {
+ Text(
+ text = stringResource(id = R.string.sign_up_name),
+ modifier = modifier.padding(bottom = 20.dp)
+ )
+ NameTextField(
+ value = signUpState.name,
+ onValueChange = { name ->
+ signUpViewModel.isInputValid(name)
+ },
+ hint = stringResource(id = R.string.sign_up_hint),
+ drawLineColor = signUpState.drawLineColor,
+ helperMessage = signUpState.helper,
+ helperIcon = signUpState.helperIcon,
+ helperColor = signUpState.helperColor
+ )
+ }
+ Spacer(modifier = modifier.weight(5f))
+ RectangleButton(
+ style = TerningTheme.typography.button1,
+ paddingVertical = 20.dp,
+ text = R.string.sign_up_next_button,
+ onButtonClick = { onButtonClick() },
+ modifier = modifier.padding(bottom = 12.dp),
+ isEnabled = signUpState.isButtonValid
+ )
+ }
+}
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt
new file mode 100644
index 000000000..b6a1e59fb
--- /dev/null
+++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt
@@ -0,0 +1,16 @@
+package com.terning.feature.onboarding.signup
+
+import androidx.compose.ui.graphics.Color
+import com.terning.core.designsystem.theme.Grey400
+import com.terning.core.designsystem.theme.Grey500
+import com.terning.feature.onboarding.signup.SignUpViewModel.Companion.HELPER
+
+data class SignUpState(
+ val name: String = "",
+ val character: Int = 0,
+ val drawLineColor: Color = Grey500,
+ val helper: String = HELPER,
+ val helperIcon: Int? = null,
+ val helperColor: Color = Grey400,
+ val isButtonValid : Boolean = false
+)
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt
index b0778653a..a01379d30 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt
@@ -1,10 +1,62 @@
package com.terning.feature.onboarding.signup
import androidx.lifecycle.ViewModel
+import com.terning.core.designsystem.theme.Grey400
+import com.terning.core.designsystem.theme.Grey500
+import com.terning.core.designsystem.theme.TerningMain
+import com.terning.core.designsystem.theme.WarningRed
+import com.terning.feature.R
import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject
@HiltViewModel
-class SignUpViewModel @Inject constructor() : ViewModel(){
+class SignUpViewModel @Inject constructor() : ViewModel() {
-}
\ No newline at end of file
+ private val _state: MutableStateFlow = MutableStateFlow(SignUpState())
+ val state: StateFlow get() = _state.asStateFlow()
+
+ fun isInputValid(name: String) {
+ val nameErrorRegex = Regex(NAME_ERROR)
+ val trimmedName = if (name.length > MAX_LENGTH) name.substring(0, MAX_LENGTH) else name
+
+ when {
+ nameErrorRegex.containsMatchIn(trimmedName) -> _state.value = _state.value.copy(
+ name = trimmedName,
+ drawLineColor = WarningRed,
+ helper = HELPER_ERROR,
+ helperIcon = R.drawable.ic_sign_up_error,
+ helperColor = WarningRed,
+ isButtonValid = false
+ )
+
+ trimmedName.isEmpty() -> _state.value = _state.value.copy(
+ name = trimmedName,
+ drawLineColor = Grey500,
+ helper = HELPER,
+ helperIcon = null,
+ helperColor = Grey400,
+ isButtonValid = false
+ )
+
+ else -> _state.value = _state.value.copy(
+ name = trimmedName,
+ drawLineColor = TerningMain,
+ helper = HELPER_AVAILABLE,
+ helperIcon = R.drawable.ic_check,
+ helperColor = TerningMain,
+ isButtonValid = true
+ )
+ }
+ }
+
+ companion object {
+ const val NAME_ERROR = "[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/]"
+ const val HELPER = "12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가"
+ private const val MAX_LENGTH = 12
+ private const val HELPER_ERROR = "이름에 특수문자는 입력할 수 없어요"
+ private const val HELPER_AVAILABLE = "이용 가능한 이름이에요"
+ }
+}
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpProfile.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpProfile.kt
new file mode 100644
index 000000000..8fd593bcd
--- /dev/null
+++ b/feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpProfile.kt
@@ -0,0 +1,38 @@
+package com.terning.feature.onboarding.signup.component
+
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.layout.Box
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
+import com.terning.feature.R
+
+@Composable
+fun SignUpProfile(
+ modifier: Modifier = Modifier
+) {
+ Box {
+ Image(
+ painterResource(id = R.drawable.ic_sign_up_profile),
+ contentDescription = stringResource(id = R.string.sign_up_profile_image)
+ )
+ Box(
+ modifier = modifier.align(Alignment.BottomEnd)
+ ) {
+ Image(
+ painterResource(id = R.drawable.ic_sign_up_button),
+ contentDescription = stringResource(id = R.string.sign_up_profile_button),
+
+ )
+ }
+ }
+}
+
+@Preview(showBackground = true)
+@Composable
+fun SignUpProfilePreview() {
+ SignUpProfile()
+}
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/navigation/SignUpNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/navigation/SignUpNavigation.kt
index 1379d0a64..b8c4bf412 100644
--- a/feature/src/main/java/com/terning/feature/onboarding/signup/navigation/SignUpNavigation.kt
+++ b/feature/src/main/java/com/terning/feature/onboarding/signup/navigation/SignUpNavigation.kt
@@ -2,9 +2,11 @@ package com.terning.feature.onboarding.signup.navigation
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
+import androidx.navigation.NavHostController
import androidx.navigation.NavOptions
import androidx.navigation.compose.composable
import com.terning.core.navigation.MainTabRoute
+import com.terning.core.navigation.Route
import com.terning.feature.onboarding.signup.SignUpRoute
import kotlinx.serialization.Serializable
@@ -15,11 +17,13 @@ fun NavController.navigateSignUp(navOptions: NavOptions? = null) {
)
}
-fun NavGraphBuilder.signUpNavGraph() {
+fun NavGraphBuilder.signUpNavGraph(
+ navHostController: NavHostController
+) {
composable {
- SignUpRoute()
+ SignUpRoute(navController = navHostController)
}
}
@Serializable
-data object SignUp : MainTabRoute
\ No newline at end of file
+data object SignUp : Route
\ No newline at end of file
diff --git a/feature/src/main/res/drawable/ic_check.xml b/feature/src/main/res/drawable/ic_check.xml
index 3982b4d78..6c2547e9d 100644
--- a/feature/src/main/res/drawable/ic_check.xml
+++ b/feature/src/main/res/drawable/ic_check.xml
@@ -3,16 +3,16 @@
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
-
-
-
+
+
+
\ No newline at end of file
diff --git a/feature/src/main/res/drawable/ic_sign_up_button.xml b/feature/src/main/res/drawable/ic_sign_up_button.xml
new file mode 100644
index 000000000..b5b8d45dd
--- /dev/null
+++ b/feature/src/main/res/drawable/ic_sign_up_button.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/feature/src/main/res/drawable/ic_warning.xml b/feature/src/main/res/drawable/ic_sign_up_error.xml
similarity index 100%
rename from feature/src/main/res/drawable/ic_warning.xml
rename to feature/src/main/res/drawable/ic_sign_up_error.xml
diff --git a/feature/src/main/res/drawable/ic_sign_up_profile.xml b/feature/src/main/res/drawable/ic_sign_up_profile.xml
new file mode 100644
index 000000000..e7a473ec6
--- /dev/null
+++ b/feature/src/main/res/drawable/ic_sign_up_profile.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml
index 54b8f98d8..390a5972c 100644
--- a/feature/src/main/res/values/strings.xml
+++ b/feature/src/main/res/values/strings.xml
@@ -17,18 +17,17 @@
로그인을 취소하였습니다
- 프로필 이미지 선택
- 회원가입 바텀시트
- 저장하기
-
-
- 이름을 입력해주세요
- 12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가
- 이름에 특수문자는 입력할 수 없어요
- 이용 가능한 이름이에요
-
-
+ 반가워요!\n이름을 알려주세요
+ 프로필 이미지
+ 프로필 버튼
+ 이름
+ 이름을 입력해주세요
+ 12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가
+ 다음으로
+
+
관심있는 인턴 공고 키워드를 검색해보세요
+
요즘 대학생들에게 인기 있는 공고
지금 조회수가 많은 공고들이에요
지금 스크랩 수가 많은 공고들이에요