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

[HOTFIX/#86] QA - 온보딩 / 차단 / 기타 반영 #88

Merged
merged 16 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.sopt.withsuhyeon.R
import com.sopt.withsuhyeon.core.util.modifier.noRippleClickable
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.colors
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.typography

@Composable
fun BlockPhoneNumberItem(
phoneNumber: String,
onDeleteClick: () -> Unit,
backgroundColor: Color = colors.Grey25,
phoneNumberColor: Color = colors.Grey900,
font: TextStyle = typography.body03_SB,
Expand All @@ -51,34 +53,11 @@ fun BlockPhoneNumberItem(
modifier = Modifier.padding(10.dp)
) {
Icon(
modifier = Modifier.noRippleClickable(onDeleteClick),
painter = painterResource(id = R.drawable.ic_xclose),
contentDescription = stringResource(R.string.x_close_description),
tint = colors.Grey400
)
}
}
}

@Preview(showBackground = true)
@Composable
fun PreviewBlockPhoneNumberList(
modifier: Modifier = Modifier
) {
WithSuhyeonTheme {
Column(
modifier = modifier
.fillMaxWidth()
.fillMaxHeight()
) {
BlockPhoneNumberItem(
phoneNumber = "01000000000",
)
BlockPhoneNumberItem(
phoneNumber = "01000000000",
)
BlockPhoneNumberItem(
phoneNumber = "01000000000",
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ fun PostProfileInfoRow(
verticalAlignment = Alignment.CenterVertically,
) {

val profileImageResId = when (profileImage) {
stringResource(R.string.suma_img_purple) -> R.drawable.img_purple_suma
stringResource(R.string.suma_img_red) -> R.drawable.img_red_suma
stringResource(R.string.suma_img_green) -> R.drawable.img_green_suma
stringResource(R.string.suma_img_blue) -> R.drawable.img_blue_suma
else -> ""
}

AsyncImage(
model = profileImage,
model = profileImageResId,
contentDescription = stringResource(R.string.post_basic_profile_image_description),
modifier = Modifier
.size(38.dp)
Expand Down Expand Up @@ -66,7 +74,7 @@ fun PostProfileInfoRow(
}
}

@Preview (showBackground = true)
@Preview(showBackground = true)
@Composable
private fun Preview() {
PostProfileInfoRow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.sopt.withsuhyeon.R
import com.sopt.withsuhyeon.core.component.button.BasicButtonForTextField
import com.sopt.withsuhyeon.core.util.KeyStorage.EMPTY_STRING
import com.sopt.withsuhyeon.core.util.KeyStorage.SHORT_TEXTFIELD_MAX_LENGTH
import com.sopt.withsuhyeon.core.util.modifier.addFocusCleaner
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.colors
Expand Down Expand Up @@ -161,7 +162,8 @@ fun BasicShortTextField(
} else if (
!isValid
&& enabled
&& errorMessage.isNotEmpty()
&& errorMessage != EMPTY_STRING
&& value != EMPTY_STRING
) {
Text(
text = errorMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object KeyStorage {

const val LENGTH_ERROR = "lengthError"
const val SPECIAL_CHARACTER_ERROR = "specialError"
const val LENGTH_ERROR_MESSAGE = "최대 12글자 이하로 입력해주세요"
const val LENGTH_ERROR_MESSAGE = "12자까지 입력할 수 있어요"
const val SPECIAL_CHARACTER_ERROR_MESSAGE = "특수기호를 제거해주세요"

const val EMPTY_STRING =""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.sopt.withsuhyeon.core.util.regex

fun String.checkValidPhoneNumber(): Boolean {
val phoneNumberRegex = Regex("^010\\d{8}$")
return this.matches(phoneNumberRegex)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.sopt.withsuhyeon.data.service.GalleryService
import com.sopt.withsuhyeon.data.service.SignUpService
import com.sopt.withsuhyeon.data.service.MyPageService
import com.sopt.withsuhyeon.data.service.HomeService
import com.sopt.withsuhyeon.data.service.MyPageService
import com.sopt.withsuhyeon.data.service.LoginService
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.sopt.withsuhyeon.data.datasource.GalleryDataSource
import com.sopt.withsuhyeon.data.datasource.SignUpDataSource
import com.sopt.withsuhyeon.data.datasource.MyPageDataSource
import com.sopt.withsuhyeon.data.datasource.HomeDataSource
import com.sopt.withsuhyeon.data.datasource.MyPageDataSource
import com.sopt.withsuhyeon.data.datasource.LoginDataSource
import com.sopt.withsuhyeon.data.datasourceimpl.BlockUserDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.DummyDataSourceImpl
Expand All @@ -16,7 +15,6 @@ import com.sopt.withsuhyeon.data.datasourceimpl.GalleryDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.SignUpDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.MyPageDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.HomeDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.MyPageDataSourceImpl
import com.sopt.withsuhyeon.data.datasourceimpl.LoginDataSourceImpl
import dagger.Binds
import dagger.Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import com.sopt.withsuhyeon.data.repositoryimpl.MyPageRepositoryImpl
import com.sopt.withsuhyeon.data.repositoryimpl.HomeRepositoryImpl
import com.sopt.withsuhyeon.data.repositoryimpl.LoginRepositoryImpl
import com.sopt.withsuhyeon.domain.repository.BlockUserRepository
import com.sopt.withsuhyeon.data.repositoryimpl.MyPageRepositoryImpl
import com.sopt.withsuhyeon.domain.repository.DummyRepository
import com.sopt.withsuhyeon.domain.repository.FindSuhyeonRepository
import com.sopt.withsuhyeon.domain.repository.GalleryRepository
import com.sopt.withsuhyeon.domain.repository.SignUpRepository
import com.sopt.withsuhyeon.domain.repository.MyPageRepository
import com.sopt.withsuhyeon.domain.repository.HomeRepository
import com.sopt.withsuhyeon.domain.repository.LoginRepository
import com.sopt.withsuhyeon.domain.repository.MyPageRepository
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sopt.withsuhyeon.data.repositoryimpl

import com.sopt.withsuhyeon.data.dto.base.BaseResponse
import com.sopt.withsuhyeon.data.dto.request.RequestAuthNumberDto
import com.sopt.withsuhyeon.data.dto.request.RequestPhoneNumberAuthDto
import com.sopt.withsuhyeon.data.dto.request.RequestSignUpDto
Expand All @@ -21,7 +22,7 @@ class SignUpRepositoryImpl @Inject constructor(
response.message
}

override suspend fun postVerifyNumber(phoneNumber: String, verifyNumber: String): Result<Unit> =
override suspend fun postVerifyNumber(phoneNumber: String, verifyNumber: String): Result<BaseResponse<Unit>> =
runCatching {
val response = signUpService.verifyAuthNumber(
flow = "signup",
Expand All @@ -30,7 +31,7 @@ class SignUpRepositoryImpl @Inject constructor(
verifyNumber = verifyNumber
)
)
response.message
response
}

override suspend fun getRegionList(): Result<RegionListModel> =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.sopt.withsuhyeon.domain.repository

import com.sopt.withsuhyeon.data.dto.base.BaseResponse
import com.sopt.withsuhyeon.domain.entity.RegionListModel


interface SignUpRepository {
suspend fun postPhoneNumber(phoneNumber: String): Result<Unit>
suspend fun postVerifyNumber(phoneNumber: String, verifyNumber: String): Result<Unit>
suspend fun postVerifyNumber(phoneNumber: String, verifyNumber: String): Result<BaseResponse<Unit>>
suspend fun getRegionList(): Result<RegionListModel>
suspend fun postSignUp(
phoneNumber: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class MainNavigator(
@Composable get() = navController
.currentBackStackEntryAsState().value?.destination

// val startDestination = MainTabRoute.Home
val startDestination = Route.Splash
// val startDestination = Route.BlockUser

val currentTab: MainTab?
@Composable get() = MainTab.entries.find { tab ->
Expand Down Expand Up @@ -114,12 +116,15 @@ class MainNavigator(
fun navigateToBlockUser() {
navController.navigateToBlockUser()
}

fun navigateToMyPageFavoriteLocation() {
navController.navigateToFavoriteLocation()
}

fun navigateToMyPageWithdraw() {
navController.navigateToWithdraw()
}

fun navigateToMyPagePost() {
navController.navigateToMyPagePost()
}
Expand All @@ -146,6 +151,7 @@ class MainNavigator(
}
)
}

fun navigateToGallery(navOptions: NavOptions? = null, category: String? = null) {
navController.navigateToGallery(
navOptions ?: navOptions {
Expand All @@ -157,6 +163,7 @@ class MainNavigator(
category
)
}

fun navigateToGalleryUpload() {
navController.navigateToGalleryUpload()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fun MainNavHost(
onNavigateToSignUpFinish = navigator::navigateToOnboardingFinish,
onNavigateToLoginFinish = navigator::navigateToLoginFinish,
onNavigateToHome = navigator::navigateToHome,
getBackStackUploadViewModel = { navBackStackEntry ->
getBackStackSignUpViewModel = { navBackStackEntry ->
val parentEntry = try {
navigator.navController.getBackStackEntry(Route.OnBoarding)
} catch (e: IllegalArgumentException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.sopt.withsuhyeon.core.component.textfield.BasicShortTextField
import com.sopt.withsuhyeon.core.component.topbar.SubTopNavBar
import com.sopt.withsuhyeon.core.util.KeyStorage.SAVE_BUTTON_TEXT
import com.sopt.withsuhyeon.core.util.modifier.noRippleClickable
import com.sopt.withsuhyeon.core.util.regex.checkValidPhoneNumber
import com.sopt.withsuhyeon.feature.onboarding.viewmodel.BlcokUserViewModel
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.colors
import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.typography
Expand Down Expand Up @@ -112,7 +113,7 @@ fun BlockUserScreen(
value = state.blockNumber,
onValueChange = { input ->
viewModel.selectBlockUserNumber(input)
isValid = input.length == 11
isValid = input.length == 11 && input.checkValidPhoneNumber()
},
hint = stringResource(R.string.block_screen_phone_number_hint),
trailingContent = {
Expand All @@ -124,7 +125,7 @@ fun BlockUserScreen(
}
},
modifier = Modifier,
enabled = true
enabled = isValid
)
}
)
Expand Down Expand Up @@ -177,10 +178,8 @@ fun BlockUserScreen(
) {
items(state.blockNumbers) { phoneNumber ->
BlockPhoneNumberItem(
modifier = Modifier.noRippleClickable {
viewModel.deleteBlockUser(phoneNumber)
},
phoneNumber = phoneNumber,
onDeleteClick = { viewModel.deleteBlockUser(phoneNumber) }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fun FinishLoginScreen(
onButtonClick()
},
text = NEXT_BUTTON_TEXT,
modifier = Modifier.padding(horizontal = 16.dp),
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
isDisabled = false
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sopt.withsuhyeon.feature.onboarding

import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -14,6 +15,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -56,6 +58,12 @@ fun FinishSignUpScreen(
modifier: Modifier = Modifier
) {
val state by viewModel.signUpState.collectAsStateWithLifecycle()
LaunchedEffect(Unit) {
Log.d(
"state 체크",
"${state.phoneNumber} ${state.birthYear} ${state.region} ${state.gender} ${state.nickname} ${state.profileImage}"
)
}
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.signup))
var isAnimationPlaying by remember { mutableStateOf(true) }
val progress by animateLottieCompositionAsState(
Expand Down Expand Up @@ -113,7 +121,7 @@ fun FinishSignUpScreen(
onButtonClick()
},
text = NEXT_BUTTON_TEXT,
modifier = Modifier.padding(horizontal = 16.dp),
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
isDisabled = false
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ fun GenderSelectScreen(
modifier: Modifier = Modifier,
) {
val state by viewModel.signUpState.collectAsStateWithLifecycle()

LaunchedEffect(Unit) {
viewModel.updateProgress(5f / 7)
}


var genderState by remember { mutableStateOf<Boolean?>(null) }
val backgroundMale = if (genderState == true) {
Modifier
Expand Down Expand Up @@ -101,10 +107,6 @@ fun GenderSelectScreen(
)
}

LaunchedEffect(Unit) {
viewModel.updateProgress(state.progress + 1f / 7)
}

Column(
modifier = modifier
.background(color = colors.White)
Expand Down Expand Up @@ -192,7 +194,7 @@ fun GenderSelectScreen(
LargeButton(
onClick = onButtonClick,
text = NEXT_BUTTON_TEXT,
modifier = Modifier.padding(horizontal = 16.dp),
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
isDisabled = genderState == null
)
}
Expand Down
Loading