From 46e49b4339e19f0a4a30ed02a05a821e26ab756f Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:43:54 +0900 Subject: [PATCH 01/61] =?UTF-8?q?chore=20::=20signup=20module=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composeApp/build.gradle.kts | 1 + .../team/aliens/dms/kmp/di/FeatureModule.kt | 2 + feature/signup/build.gradle.kts | 71 +++++++++++++++++++ settings.gradle.kts | 1 + 4 files changed, 75 insertions(+) create mode 100644 feature/signup/build.gradle.kts diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 7c6b71ce..7d8777af 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -66,6 +66,7 @@ kotlin { implementation(projects.feature.splash) implementation(projects.feature.signin) + implementation(projects.feature.signup) } jvmMain.dependencies { implementation(compose.desktop.currentOs) diff --git a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/di/FeatureModule.kt b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/di/FeatureModule.kt index 9ab843b9..bf5c57f2 100644 --- a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/di/FeatureModule.kt +++ b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/di/FeatureModule.kt @@ -2,11 +2,13 @@ package team.aliens.dms.kmp.di import org.koin.dsl.module import team.aliens.dms.kmp.feature.signin.di.signInModule +import team.aliens.dms.kmp.feature.signup.di.signUpModule import team.aliens.dms.kmp.feature.splash.di.splashModule internal val featureModule = module { includes( splashModule, signInModule, + signUpModule, ) } diff --git a/feature/signup/build.gradle.kts b/feature/signup/build.gradle.kts new file mode 100644 index 00000000..5249c4e4 --- /dev/null +++ b/feature/signup/build.gradle.kts @@ -0,0 +1,71 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import team.aliens.dms.kmp.buildsrc.ProjectProperties +import team.aliens.dms.kmp.buildsrc.Versions + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.androidLibrary) + alias(libs.plugins.jetbrainsCompose) + alias(libs.plugins.compose.compiler) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.ktlint) +} + +kotlin { + androidTarget { + compilations.all { + compileTaskProvider.configure { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } + } + } + } + + jvm() + + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64(), + ).forEach { + it.binaries.framework { + baseName = "signup" + isStatic = true + } + } + + sourceSets { + commonMain.dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + implementation(compose.material3) + implementation(compose.ui) + implementation(libs.navigation.compose) + + implementation(libs.kotlinx.serialization.json) + implementation(libs.koin.core) + implementation(libs.koin.compose) + implementation(libs.koin.compose.viewmodel) + + implementation(projects.core.common) + implementation(projects.core.designSystem) + } + commonTest.dependencies { + implementation(libs.kotlin.test) + } + } +} + +android { + namespace = "team.aliens.dms.kmp.feature.signup" + compileSdk = ProjectProperties.COMPILE_SDK + defaultConfig { + minSdk = ProjectProperties.MIN_SDK + } + compileOptions { + sourceCompatibility = Versions.java + targetCompatibility = Versions.java + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index b0503445..60458ce4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -42,3 +42,4 @@ include(":core:common") include(":feature:splash") include(":feature:signin") +include(":feature:signup") From 9123e424cc5f6f8cb3367df6deb8ec403286f335 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:44:29 +0900 Subject: [PATCH 02/61] =?UTF-8?q?chore=20::=20kotlin=20serialization=20?= =?UTF-8?q?=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 68e60bbd..c7be2867 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,6 +19,7 @@ koin = "4.0.0" kotlin = "2.0.20" kotlinx-coroutines = "1.9.0" kotlinxDatetime = "0.6.1" +kotlinxSerializationJson = "1.7.3" kottie = "2.0.0" ktor = "2.3.12" lifecycleViewmodelCompose = "2.8.2" @@ -52,6 +53,7 @@ androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", nam androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } kottie = { module = "io.github.ismai117:kottie", version.ref = "kottie" } ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } @@ -72,6 +74,7 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" } jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "jetbrainsKotlinJvm" } sqlDelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } From 3471c6caa9a28db1ef107850069ef424bd659fc9 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:45:07 +0900 Subject: [PATCH 03/61] =?UTF-8?q?feat=20::=20EnterSchoolVerificationCode?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/EnterSchoolVerificationCodeScreen.kt | 77 +++++++++++++++++++ .../EnterSchoolVerificationCodeViewModel.kt | 37 +++++++++ 2 files changed, 114 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt new file mode 100644 index 00000000..9cdcb31f --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt @@ -0,0 +1,77 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.numberfield.DmsNumberField +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeState +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeViewModel + +@Composable +internal fun EnterSchoolVerificationCode( + onBackPressed: () -> Unit, + navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, +) { + val viewModel: EnterSchoolVerificationCodeViewModel = koinInject() + val state by viewModel.state.collectAsState() + + EnterSchoolVerificationCodeScreen( + onBackPressed = onBackPressed, + state = state, + onVerificationCodeChange = viewModel::setVerificationCode, + ) +} + +@Composable +private fun EnterSchoolVerificationCodeScreen( + onBackPressed: () -> Unit, + state: EnterSchoolVerificationCodeState, + onVerificationCodeChange: (String) -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "인증코드를 입력해주세요", + description = "학교 인증코드를 입력해주세요.", + ) + DmsNumberField( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.Large) + .horizontalPadding(), + value = state.verificationCode, + onValueChange = onVerificationCodeChange, + totalLength = 6, + ) + Spacer(modifier = Modifier.weight(1f)) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(PaddingDefaults.Large), + text = "다음", + onClick = { }, + enabled = state.buttonEnabled, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt new file mode 100644 index 00000000..1788f8a7 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt @@ -0,0 +1,37 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class EnterSchoolVerificationCodeViewModel : + BaseViewModel( + EnterSchoolVerificationCodeState.getDefaultState(), + ) { + + internal fun setVerificationCode(verificationCode: String) { + setState { + state.value.copy( + verificationCode = verificationCode, + ) + } + setButtonEnabled() + } + + private fun setButtonEnabled() = setState { + val verificationCode = state.value.verificationCode + state.value.copy(buttonEnabled = verificationCode.isNotEmpty()) + } +} + +data class EnterSchoolVerificationCodeState( + val verificationCode: String, + val buttonEnabled: Boolean, +) { + companion object { + fun getDefaultState() = EnterSchoolVerificationCodeState( + verificationCode = "", + buttonEnabled = false, + ) + } +} + +sealed interface EnterSchoolVerificationCodeSideEffect From 0fc76f70d8a4fb9a0009a087982c69a9f88cc004 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:45:25 +0900 Subject: [PATCH 04/61] =?UTF-8?q?feat=20::=20SignUpNavigation=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/navigation/SignUpNavigation.kt | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt new file mode 100644 index 00000000..4c4f4bb7 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -0,0 +1,36 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavBackStackEntry +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.navigation +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toSignUpData + +const val NAVIGATION_SIGN_UP = "signUp" + +fun NavGraphBuilder.signUp( + onBackPressed: () -> Unit, + navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, +) { + navigation( + route = NAVIGATION_SIGN_UP, + startDestination = NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE, + ) { + enterSchoolVerificationCode( + onBackPressed = onBackPressed, + navigateToEnterSchoolVerificationQuestion = navigateToEnterSchoolVerificationQuestion, + ) + } +} + +fun NavController.navigateToSignUp() { + navigate(NAVIGATION_SIGN_UP) +} + +internal fun NavBackStackEntry.getSignUpData(): SignUpData { + val signUpData = arguments?.getString(ResourceKeys.SIGN_UP) ?: throw NullPointerException() + return signUpData.toSignUpData() +} + From 1e236fa1734dc8013d8eae639ad8e67ad8d32b78 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:45:39 +0900 Subject: [PATCH 05/61] =?UTF-8?q?feat=20::=20SignUpData=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kmp/feature/signup/model/SignUpData.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/model/SignUpData.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/model/SignUpData.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/model/SignUpData.kt new file mode 100644 index 00000000..813b7550 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/model/SignUpData.kt @@ -0,0 +1,22 @@ +package team.aliens.dms.kmp.feature.signup.model + +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +@Serializable +data class SignUpData( + val schoolCode: String = "", + val schoolAnswer: String = "", + val email: String = "", + val authCode: String = "", + val grade: Int = 0, + val classRoom: Int = 0, + val number: Int = 0, + val accountId: String = "", + val password: String = "", + val profileImageUrl: String? = null, +) + +internal fun SignUpData.toJsonString() = Json.encodeToString(this) +internal fun String.toSignUpData() = Json.decodeFromString(this) From ec859e98ed6901f8c973b69bbf1217334c440174 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:45:51 +0900 Subject: [PATCH 06/61] =?UTF-8?q?feat=20::=20SignUpModel=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/di/SignIUpModel.kt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt new file mode 100644 index 00000000..d6fd7eb6 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt @@ -0,0 +1,9 @@ +package team.aliens.dms.kmp.feature.signup.di + +import org.koin.core.module.dsl.viewModelOf +import org.koin.dsl.module +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeViewModel + +val signUpModule = module { + viewModelOf(::EnterSchoolVerificationCodeViewModel) +} From fd460c2d76abaad79b1d830210e4d64dc43bd6af Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:46:05 +0900 Subject: [PATCH 07/61] =?UTF-8?q?feat=20::=20ResourceKeys=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/core/common/utils/ResourceKeys.kt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/ResourceKeys.kt diff --git a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/ResourceKeys.kt b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/ResourceKeys.kt new file mode 100644 index 00000000..7563cbdc --- /dev/null +++ b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/ResourceKeys.kt @@ -0,0 +1,5 @@ +package team.aliens.dms.kmp.core.common.utils + +object ResourceKeys { + const val SIGN_UP = "signUp" +} From 8e19349443eb8afb16ab24f306c4a792d019e979 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 11 Oct 2024 23:46:34 +0900 Subject: [PATCH 08/61] =?UTF-8?q?feat=20::=20EnterSchoolVerificationCodeNa?= =?UTF-8?q?vigation=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterSchoolVerificationCodeNavigation.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt new file mode 100644 index 00000000..24ee55b7 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt @@ -0,0 +1,26 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.EnterSchoolVerificationCode + +const val NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE = "enterSchoolVerificationCode" + +internal fun NavGraphBuilder.enterSchoolVerificationCode( + onBackPressed: () -> Unit, + navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, +) { + composable(NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE) { + EnterSchoolVerificationCode( + onBackPressed = onBackPressed, + navigateToEnterSchoolVerificationQuestion = navigateToEnterSchoolVerificationQuestion + ) + } +} + +fun NavController.navigateToEnterSchoolVerificationCode(signUpData: SignUpData) { + navigate("$NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE/${signUpData.toJsonString()}") +} From 463d4447e9daff67ea9f2000aea31581fa7b4f61 Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 15:34:24 +0900 Subject: [PATCH 09/61] =?UTF-8?q?feat=20::=20SchoolVerificationQuestion=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/kmp/feature/signup/di/SignIUpModel.kt | 2 + ...terSchoolVerificationQuestionNavigation.kt | 33 +++++++ .../signup/navigation/SignUpNavigation.kt | 5 ++ .../EnterSchoolVerificationQuestionScreen.kt | 89 +++++++++++++++++++ ...nterSchoolVerificationQuestionViewModel.kt | 58 ++++++++++++ 5 files changed, 187 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt index d6fd7eb6..164f0723 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt @@ -3,7 +3,9 @@ package team.aliens.dms.kmp.feature.signup.di import org.koin.core.module.dsl.viewModelOf import org.koin.dsl.module import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeViewModel +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuestionViewModel val signUpModule = module { viewModelOf(::EnterSchoolVerificationCodeViewModel) + viewModelOf(::EnterSchoolVerificationQuestionViewModel) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt new file mode 100644 index 00000000..465322f3 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt @@ -0,0 +1,33 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.EnterSchoolVerificationQuestion + +const val NAVIGATION_ENTER_SCHOOL_VERIFICATION_QUESTION = "enterSchoolVerificationQuestion" + +fun NavGraphBuilder.enterSchoolVerificationQuestion( + onBackPressed: () -> Unit, + navigateToSetId: (SignUpData) -> Unit, +) { + composable( + route = "$NAVIGATION_ENTER_SCHOOL_VERIFICATION_QUESTION/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + EnterSchoolVerificationQuestion( + onBackPressed = onBackPressed, + navigateToSetId = navigateToSetId, + signUpData = it.getSignUpData(), + ) + } +} + +fun NavController.navigateToEnterSchoolVerificationQuestion(signUpData: SignUpData) { + navigate("$NAVIGATION_ENTER_SCHOOL_VERIFICATION_QUESTION/${signUpData.toJsonString()}") +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt index 4c4f4bb7..0f16752a 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -13,6 +13,7 @@ const val NAVIGATION_SIGN_UP = "signUp" fun NavGraphBuilder.signUp( onBackPressed: () -> Unit, navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, + navigateToSetId: (SignUpData) -> Unit, ) { navigation( route = NAVIGATION_SIGN_UP, @@ -22,6 +23,10 @@ fun NavGraphBuilder.signUp( onBackPressed = onBackPressed, navigateToEnterSchoolVerificationQuestion = navigateToEnterSchoolVerificationQuestion, ) + enterSchoolVerificationQuestion( + onBackPressed = onBackPressed, + navigateToSetId = navigateToSetId, + ) } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt new file mode 100644 index 00000000..7823071b --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt @@ -0,0 +1,89 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.textfield.DmsTextField +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuestionSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuestionState +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuestionViewModel + +@Composable +internal fun EnterSchoolVerificationQuestion( + onBackPressed: () -> Unit, + navigateToSetId: (SignUpData) -> Unit, + signUpData: SignUpData, +) { + val viewModel: EnterSchoolVerificationQuestionViewModel = koinInject() + val state by viewModel.state.collectAsState() + + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when(it) { + is EnterSchoolVerificationQuestionSideEffect.MoveToSetId -> { + navigateToSetId(signUpData.copy(schoolAnswer = it.schoolAnswer)) + } + } + } + } + EnterSchoolVerificationQuestionScreen( + onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, + state = state, + onVerificationAnswerChange = viewModel::setSchoolVerificationAnswer + ) +} + +@Composable +private fun EnterSchoolVerificationQuestionScreen( + onBackPressed: () -> Unit, + onNextClick: () -> Unit, + state: EnterSchoolVerificationQuestionState, + onVerificationAnswerChange: (String) -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = state.schoolVerificationQuestion, + description = "재학생이 맞는지 확인하는 단계입니다.", + ) + DmsTextField( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.Large) + .horizontalPadding(), + value = state.schoolVerificationAnswer, + onValueChange = onVerificationAnswerChange, + ) + Spacer(modifier = Modifier.weight(1f)) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = onNextClick, + enabled = state.buttonEnabled, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt new file mode 100644 index 00000000..31cf1a61 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt @@ -0,0 +1,58 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class EnterSchoolVerificationQuestionViewModel : + BaseViewModel( + EnterSchoolVerificationQuestionState.getDefaultState(), + ) { + + init { + setSchoolVerificationQuestion() + } + + private fun setSchoolVerificationQuestion() { + val schoolVerificationQuestion = "우리 학교 학생 수를 입력해주세요" + setState { + state.value.copy( + schoolVerificationQuestion = schoolVerificationQuestion, + ) + } + } + + internal fun setSchoolVerificationAnswer(schoolVerificationAnswer: String) { + setState { + state.value.copy( + schoolVerificationAnswer = schoolVerificationAnswer, + ) + } + setButtonEnabled() + } + + private fun setButtonEnabled() = setState { + val schoolVerificationAnswer = state.value.schoolVerificationAnswer + state.value.copy(buttonEnabled = schoolVerificationAnswer.isNotEmpty()) + } + + internal fun onNextClick() { + postSideEffect(EnterSchoolVerificationQuestionSideEffect.MoveToSetId(schoolAnswer = "")) + } +} + +data class EnterSchoolVerificationQuestionState( + val schoolVerificationQuestion: String, + val schoolVerificationAnswer: String, + val buttonEnabled: Boolean, +) { + companion object { + fun getDefaultState() = EnterSchoolVerificationQuestionState( + schoolVerificationQuestion = "", + schoolVerificationAnswer = "", + buttonEnabled = false, + ) + } +} + +sealed interface EnterSchoolVerificationQuestionSideEffect { + data class MoveToSetId(val schoolAnswer: String) : EnterSchoolVerificationQuestionSideEffect +} From 5f091100e90973c4ced455c7a40b0de9e867c30e Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 15:35:05 +0900 Subject: [PATCH 10/61] =?UTF-8?q?refactor=20::=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=B2=98=EB=A6=AC=20=EB=A1=9C=EC=A7=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterSchoolVerificationCodeNavigation.kt | 5 ++-- .../ui/EnterSchoolVerificationCodeScreen.kt | 23 +++++++++++++++---- .../EnterSchoolVerificationCodeViewModel.kt | 13 ++++++++++- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt index 24ee55b7..a5f6cd5f 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt @@ -4,7 +4,6 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import team.aliens.dms.kmp.feature.signup.model.SignUpData -import team.aliens.dms.kmp.feature.signup.model.toJsonString import team.aliens.dms.kmp.feature.signup.ui.EnterSchoolVerificationCode const val NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE = "enterSchoolVerificationCode" @@ -21,6 +20,6 @@ internal fun NavGraphBuilder.enterSchoolVerificationCode( } } -fun NavController.navigateToEnterSchoolVerificationCode(signUpData: SignUpData) { - navigate("$NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE/${signUpData.toJsonString()}") +fun NavController.navigateToEnterSchoolVerificationCode() { + navigate(NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt index 9cdcb31f..17ea9e18 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt @@ -6,10 +6,10 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp import org.koin.compose.koinInject import team.aliens.dms.kmp.core.common.ui.PaddingDefaults import team.aliens.dms.kmp.core.common.ui.bottomPadding @@ -20,9 +20,12 @@ import team.aliens.dms.kmp.core.designsystem.button.DmsButton import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme import team.aliens.dms.kmp.core.designsystem.numberfield.DmsNumberField import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeSideEffect import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeState import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeViewModel +const val VERIFICATION_CODE_LENGTH = 6 + @Composable internal fun EnterSchoolVerificationCode( onBackPressed: () -> Unit, @@ -31,8 +34,19 @@ internal fun EnterSchoolVerificationCode( val viewModel: EnterSchoolVerificationCodeViewModel = koinInject() val state by viewModel.state.collectAsState() + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when (it) { + is EnterSchoolVerificationCodeSideEffect.MoveToEnterSchoolVerificationQuestion -> { + navigateToEnterSchoolVerificationQuestion(SignUpData(schoolCode = it.schoolCode)) + } + } + } + } + EnterSchoolVerificationCodeScreen( onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, state = state, onVerificationCodeChange = viewModel::setVerificationCode, ) @@ -41,6 +55,7 @@ internal fun EnterSchoolVerificationCode( @Composable private fun EnterSchoolVerificationCodeScreen( onBackPressed: () -> Unit, + onNextClick: () -> Unit, state: EnterSchoolVerificationCodeState, onVerificationCodeChange: (String) -> Unit, ) { @@ -61,16 +76,16 @@ private fun EnterSchoolVerificationCodeScreen( .horizontalPadding(), value = state.verificationCode, onValueChange = onVerificationCodeChange, - totalLength = 6, + totalLength = VERIFICATION_CODE_LENGTH, ) Spacer(modifier = Modifier.weight(1f)) DmsButton( modifier = Modifier .fillMaxWidth() .horizontalPadding() - .bottomPadding(PaddingDefaults.Large), + .bottomPadding(), text = "다음", - onClick = { }, + onClick = onNextClick, enabled = state.buttonEnabled, ) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt index 1788f8a7..2ed65bc3 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt @@ -20,6 +20,14 @@ internal class EnterSchoolVerificationCodeViewModel : val verificationCode = state.value.verificationCode state.value.copy(buttonEnabled = verificationCode.isNotEmpty()) } + + internal fun onNextClick() { + postSideEffect( + EnterSchoolVerificationCodeSideEffect.MoveToEnterSchoolVerificationQuestion( + schoolCode = "", + ), + ) + } } data class EnterSchoolVerificationCodeState( @@ -34,4 +42,7 @@ data class EnterSchoolVerificationCodeState( } } -sealed interface EnterSchoolVerificationCodeSideEffect +sealed interface EnterSchoolVerificationCodeSideEffect { + data class MoveToEnterSchoolVerificationQuestion(val schoolCode: String) : + EnterSchoolVerificationCodeSideEffect +} From e2a666e0d3add9cd4b101f612ce18c2aa1c06d04 Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 15:35:33 +0900 Subject: [PATCH 11/61] refactor :: bottomPadding default value change --- .../team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt index 95bf3d93..747d69aa 100644 --- a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt +++ b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt @@ -19,5 +19,5 @@ fun Modifier.topPadding( ): Modifier = padding(top = value) fun Modifier.bottomPadding( - value: Dp = PaddingDefaults.Medium, + value: Dp = PaddingDefaults.Large, ): Modifier = padding(bottom = value) From c64df91815c150e8a81338e985a061514ae8ba12 Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 15:36:07 +0900 Subject: [PATCH 12/61] =?UTF-8?q?refactor=20::=20textfield=20hint=20defaul?= =?UTF-8?q?t=20=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt index 19235229..59037c16 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt @@ -41,7 +41,7 @@ fun DmsTextField( modifier: Modifier = Modifier, label: String? = null, value: String, - hint: String, + hint: String = "", onValueChange: (String) -> Unit, description: String? = null, enabled: Boolean = true, From 1496a1a3666e62983b73d47e95f3225d46824624 Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 15:41:09 +0900 Subject: [PATCH 13/61] =?UTF-8?q?refactor=20::=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EC=9E=85=EB=A0=A5=20=ED=99=94=EB=A9=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../navigation/EnterSchoolVerificationQuestionNavigation.kt | 4 ++-- .../dms/kmp/feature/signup/navigation/SignUpNavigation.kt | 4 ++-- .../signup/ui/EnterSchoolVerificationQuestionScreen.kt | 4 ++-- .../viewmodel/EnterSchoolVerificationQuestionViewModel.kt | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt index 465322f3..575e5cc0 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationQuestionNavigation.kt @@ -14,7 +14,7 @@ const val NAVIGATION_ENTER_SCHOOL_VERIFICATION_QUESTION = "enterSchoolVerificati fun NavGraphBuilder.enterSchoolVerificationQuestion( onBackPressed: () -> Unit, - navigateToSetId: (SignUpData) -> Unit, + navigateToEnterEmail: (SignUpData) -> Unit, ) { composable( route = "$NAVIGATION_ENTER_SCHOOL_VERIFICATION_QUESTION/{${ResourceKeys.SIGN_UP}}", @@ -22,7 +22,7 @@ fun NavGraphBuilder.enterSchoolVerificationQuestion( ) { EnterSchoolVerificationQuestion( onBackPressed = onBackPressed, - navigateToSetId = navigateToSetId, + navigateToEnterEmail = navigateToEnterEmail, signUpData = it.getSignUpData(), ) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt index 0f16752a..6861f4cf 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -13,7 +13,7 @@ const val NAVIGATION_SIGN_UP = "signUp" fun NavGraphBuilder.signUp( onBackPressed: () -> Unit, navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, - navigateToSetId: (SignUpData) -> Unit, + navigateToEnterEmail: (SignUpData) -> Unit, ) { navigation( route = NAVIGATION_SIGN_UP, @@ -25,7 +25,7 @@ fun NavGraphBuilder.signUp( ) enterSchoolVerificationQuestion( onBackPressed = onBackPressed, - navigateToSetId = navigateToSetId, + navigateToEnterEmail = navigateToEnterEmail, ) } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt index 7823071b..56d5c456 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt @@ -27,7 +27,7 @@ import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuest @Composable internal fun EnterSchoolVerificationQuestion( onBackPressed: () -> Unit, - navigateToSetId: (SignUpData) -> Unit, + navigateToEnterEmail: (SignUpData) -> Unit, signUpData: SignUpData, ) { val viewModel: EnterSchoolVerificationQuestionViewModel = koinInject() @@ -37,7 +37,7 @@ internal fun EnterSchoolVerificationQuestion( viewModel.sideEffect.collect { when(it) { is EnterSchoolVerificationQuestionSideEffect.MoveToSetId -> { - navigateToSetId(signUpData.copy(schoolAnswer = it.schoolAnswer)) + navigateToEnterEmail(signUpData.copy(schoolAnswer = it.schoolAnswer)) } } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt index 31cf1a61..808eba69 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationQuestionViewModel.kt @@ -35,7 +35,7 @@ internal class EnterSchoolVerificationQuestionViewModel : } internal fun onNextClick() { - postSideEffect(EnterSchoolVerificationQuestionSideEffect.MoveToSetId(schoolAnswer = "")) + postSideEffect(EnterSchoolVerificationQuestionSideEffect.MoveToEnterEmail(schoolAnswer = "")) } } @@ -54,5 +54,5 @@ data class EnterSchoolVerificationQuestionState( } sealed interface EnterSchoolVerificationQuestionSideEffect { - data class MoveToSetId(val schoolAnswer: String) : EnterSchoolVerificationQuestionSideEffect + data class MoveToEnterEmail(val schoolAnswer: String) : EnterSchoolVerificationQuestionSideEffect } From 0198721a04db7f972a7d74e8d53099a05e0b674a Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 12 Oct 2024 16:36:32 +0900 Subject: [PATCH 14/61] =?UTF-8?q?feat=20::=20EntetEmail=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/navigation/EnterEmailNavigation.kt | 33 +++++++ .../signup/navigation/SignUpNavigation.kt | 5 ++ .../kmp/feature/signup/ui/EnterEmailScreen.kt | 90 +++++++++++++++++++ .../signup/viewmodel/EnterEmailViewModel.kt | 41 +++++++++ 4 files changed, 169 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt new file mode 100644 index 00000000..18f80375 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt @@ -0,0 +1,33 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.EnterEmail + +const val NAVIGATION_ENTER_EMAIL = "enterEmail" + +fun NavGraphBuilder.enterEmail( + onBackPressed: () -> Unit, + navigateEnterEmailVerificationCode: (SignUpData) -> Unit, +) { + composable( + route = "$NAVIGATION_ENTER_EMAIL/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + EnterEmail( + onBackPressed = onBackPressed, + navigateEnterEmailVerificationCode = navigateEnterEmailVerificationCode, + signUpData = it.getSignUpData(), + ) + } +} + +fun NavController.navigateToEnterEmail(signUpData: SignUpData) { + navigate("$NAVIGATION_ENTER_EMAIL/${signUpData.toJsonString()}") +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt index 6861f4cf..2af48f5e 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -14,6 +14,7 @@ fun NavGraphBuilder.signUp( onBackPressed: () -> Unit, navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, navigateToEnterEmail: (SignUpData) -> Unit, + navigateEnterEmailVerificationCode: (SignUpData) -> Unit ) { navigation( route = NAVIGATION_SIGN_UP, @@ -27,6 +28,10 @@ fun NavGraphBuilder.signUp( onBackPressed = onBackPressed, navigateToEnterEmail = navigateToEnterEmail, ) + enterEmail( + onBackPressed = onBackPressed, + navigateEnterEmailVerificationCode = navigateEnterEmailVerificationCode, + ) } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt new file mode 100644 index 00000000..af80387e --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt @@ -0,0 +1,90 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.textfield.DmsTextField +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailState +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailViewModel + +@Composable +internal fun EnterEmail( + onBackPressed: () -> Unit, + navigateEnterEmailVerificationCode: (SignUpData) -> Unit, + signUpData: SignUpData, +) { + val viewModel: EnterEmailViewModel = koinInject() + val state by viewModel.state.collectAsState() + + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when (it) { + is EnterEmailSideEffect.MoveToEnterEmailVerificationCode -> { + navigateEnterEmailVerificationCode(signUpData.copy(email = it.email)) + } + } + } + } + + EnterEmailScreen( + onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, + state = state, + onEmailChange = viewModel::setEmail, + ) +} + +@Composable +private fun EnterEmailScreen( + onBackPressed: () -> Unit, + onNextClick: () -> Unit, + state: EnterEmailState, + onEmailChange: (String) -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "이메일을 입력해주세요", + description = "학교 이메일을 입력해주세요.", + ) + DmsTextField( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.Large) + .horizontalPadding(), + value = state.email, + onValueChange = onEmailChange, + ) + Spacer(modifier = Modifier.weight(1f)) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = onNextClick, + enabled = state.buttonEnabled, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailViewModel.kt new file mode 100644 index 00000000..d10c0479 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailViewModel.kt @@ -0,0 +1,41 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class EnterEmailViewModel : + BaseViewModel(EnterEmailState.getDefaultState()) { + + internal fun setEmail(email: String) { + setState { + state.value.copy( + email = email, + ) + } + setButtonEnabled() + } + + private fun setButtonEnabled() = setState { + val email = state.value.email + state.value.copy(buttonEnabled = email.isNotEmpty()) + } + + internal fun onNextClick() { + postSideEffect(EnterEmailSideEffect.MoveToEnterEmailVerificationCode(email = "")) + } +} + +data class EnterEmailState( + val email: String, + val buttonEnabled: Boolean, +) { + companion object { + fun getDefaultState() = EnterEmailState( + email = "", + buttonEnabled = false, + ) + } +} + +sealed interface EnterEmailSideEffect { + data class MoveToEnterEmailVerificationCode(val email: String) : EnterEmailSideEffect +} From 4bec1cff66efa01bdaa7229b54602154ab29e58e Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 18:34:41 +0900 Subject: [PATCH 15/61] =?UTF-8?q?feat=20::=20CountDownTimer=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/timer/CountDownTimer.android.kt | 28 +++++++++++++++ .../kmp/core/common/timer/CountDownTimer.kt | 17 +++++++++ .../core/common/timer/CountDownTimer.ios.kt | 35 +++++++++++++++++++ .../core/common/timer/CountDownTimer.jvm.kt | 15 ++++++++ 4 files changed, 95 insertions(+) create mode 100644 core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt create mode 100644 core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.kt create mode 100644 core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt create mode 100644 core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt diff --git a/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt b/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt new file mode 100644 index 00000000..715e8cf7 --- /dev/null +++ b/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt @@ -0,0 +1,28 @@ +package team.aliens.dms.kmp.core.common.timer + +import android.os.CountDownTimer + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class CountDownTimer { + private var timer: CountDownTimer? = null + + actual fun start( + durationMillis: Long, + intervalMillis: Long, + listener: CountDownTimerListener, + ) { + timer = object : CountDownTimer(durationMillis,intervalMillis) { + override fun onTick(millisUntilFinished: Long) { + listener.onTick(millisUntilFinished) + } + + override fun onFinish() { + listener.onFinish() + } + }.start() + } + + actual fun stop() { + timer?.cancel() + } +} diff --git a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.kt b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.kt new file mode 100644 index 00000000..f996d651 --- /dev/null +++ b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.kt @@ -0,0 +1,17 @@ +package team.aliens.dms.kmp.core.common.timer + +interface CountDownTimerListener { + fun onTick(timeLeft: Long) + fun onFinish() +} + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +expect class CountDownTimer() { + fun start( + durationMillis: Long, + intervalMillis: Long, + listener: CountDownTimerListener, + ) + + fun stop() +} diff --git a/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt b/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt new file mode 100644 index 00000000..fe784658 --- /dev/null +++ b/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt @@ -0,0 +1,35 @@ +package team.aliens.dms.kmp.core.common.timer + +import platform.Foundation.NSTimer +import kotlin.native.concurrent.freeze + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class CountDownTimer { + private var timer: NSTimer? = null + private var timeLeft: Long = 0 + + actual fun start( + durationMillis: Long, + intervalMillis: Long, + listener: CountDownTimerListener, + ) { + timeLeft = durationMillis + listener.freeze() + val intervalSeconds = intervalMillis / 1000.0 + + timer = NSTimer.scheduledTimerWithTimeInterval(intervalSeconds, true) { + timeLeft -= intervalMillis + if(timeLeft > 0) { + listener.onTick(timeLeft) + } else { + listener.onFinish() + stop() + } + } + } + + actual fun stop() { + timer?.invalidate() + timer = null + } +} diff --git a/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt b/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt new file mode 100644 index 00000000..0adf6ff6 --- /dev/null +++ b/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt @@ -0,0 +1,15 @@ +package team.aliens.dms.kmp.core.common.timer + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class CountDownTimer { + actual fun start( + durationMillis: Long, + intervalMillis: Long, + listener: CountDownTimerListener, + ) { + } + + actual fun stop() { + } + +} From 73e95b7ad1a7a733dde32c62dfe6f80fbf117c81 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 18:54:00 +0900 Subject: [PATCH 16/61] =?UTF-8?q?design=20::=20=EC=95=84=EC=9D=B4=EC=BD=98?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../composeResources/drawable/ic_alarm.xml | 13 +++++++++++++ .../composeResources/drawable/ic_refresh.xml | 13 +++++++++++++ .../dms/kmp/core/designsystem/foundation/DmsIcon.kt | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 core/design-system/src/commonMain/composeResources/drawable/ic_alarm.xml create mode 100644 core/design-system/src/commonMain/composeResources/drawable/ic_refresh.xml diff --git a/core/design-system/src/commonMain/composeResources/drawable/ic_alarm.xml b/core/design-system/src/commonMain/composeResources/drawable/ic_alarm.xml new file mode 100644 index 00000000..6690bebc --- /dev/null +++ b/core/design-system/src/commonMain/composeResources/drawable/ic_alarm.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/core/design-system/src/commonMain/composeResources/drawable/ic_refresh.xml b/core/design-system/src/commonMain/composeResources/drawable/ic_refresh.xml new file mode 100644 index 00000000..23ac28cc --- /dev/null +++ b/core/design-system/src/commonMain/composeResources/drawable/ic_refresh.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt index ed5fdb1b..2fb0e0c9 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt @@ -2,6 +2,7 @@ package team.aliens.dms.kmp.core.designsystem.foundation import dmskmp.core.design_system.generated.resources.Res import dmskmp.core.design_system.generated.resources.ic_add_notes +import dmskmp.core.design_system.generated.resources.ic_alarm import dmskmp.core.design_system.generated.resources.ic_arrow_back import dmskmp.core.design_system.generated.resources.ic_breaking_news import dmskmp.core.design_system.generated.resources.ic_cancel @@ -9,6 +10,7 @@ import dmskmp.core.design_system.generated.resources.ic_delete import dmskmp.core.design_system.generated.resources.ic_edit import dmskmp.core.design_system.generated.resources.ic_home import dmskmp.core.design_system.generated.resources.ic_person +import dmskmp.core.design_system.generated.resources.ic_refresh import dmskmp.core.design_system.generated.resources.ic_symbol_dark import dmskmp.core.design_system.generated.resources.ic_symbol_light import dmskmp.core.design_system.generated.resources.ic_visibility @@ -27,4 +29,6 @@ object DmsIcon { val VisibilityOff = Res.drawable.ic_visibility_off val SymbolLight = Res.drawable.ic_symbol_light val SymbolDark = Res.drawable.ic_symbol_dark + val Alarm = Res.drawable.ic_alarm + val Refresh = Res.drawable.ic_refresh } From a0af8d5bab1052d4fe8067650e7445072c4a1e69 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:22:53 +0900 Subject: [PATCH 17/61] =?UTF-8?q?refactor=20::=20PaddingDefault=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt index 747d69aa..eef563e8 100644 --- a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt +++ b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/ui/PaddingDefaults.kt @@ -7,11 +7,12 @@ import androidx.compose.ui.unit.dp object PaddingDefaults { val Medium = 12.dp - val Large = 24.dp + val Large = 16.dp + val ExtraLarge = 24.dp } fun Modifier.horizontalPadding( - value: Dp = PaddingDefaults.Large, + value: Dp = PaddingDefaults.ExtraLarge, ): Modifier = padding(horizontal = value) fun Modifier.topPadding( From deaf0958347d35d5c33ab9423d487417ecc3129e Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:23:23 +0900 Subject: [PATCH 18/61] =?UTF-8?q?refactor=20::=20padding=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/feature/signin/ui/SignInScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/signin/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signin/ui/SignInScreen.kt b/feature/signin/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signin/ui/SignInScreen.kt index 331aa7c8..1730e7dc 100644 --- a/feature/signin/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signin/ui/SignInScreen.kt +++ b/feature/signin/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signin/ui/SignInScreen.kt @@ -68,7 +68,7 @@ fun SignInScreen( .horizontalPadding(), ) UserInformationInputs( - modifier = Modifier.topPadding(PaddingDefaults.Large), + modifier = Modifier.topPadding(PaddingDefaults.ExtraLarge), accountId = state.accountId, onAccountIdChange = onAccountIdChange, password = state.password, @@ -140,7 +140,7 @@ private fun UnauthorizedActions( Row( modifier = modifier .fillMaxWidth() - .topPadding(PaddingDefaults.Large) + .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding(), horizontalArrangement = Arrangement.spacedBy( space = PaddingDefaults.Medium, From a41144b1831eaf641530584b3b82d8a52c25a210 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:24:15 +0900 Subject: [PATCH 19/61] =?UTF-8?q?feat=20::=20EnterEmailVerificationCode=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/EnterEmailVerificationCodeScreen.kt | 141 ++++++++++++++++++ .../EnterEmailVerificationCodeViewModel.kt | 43 ++++++ 2 files changed, 184 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt new file mode 100644 index 00000000..50a8a625 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt @@ -0,0 +1,141 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +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.material.Icon +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.jetbrains.compose.resources.painterResource +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsIcon +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography +import team.aliens.dms.kmp.core.designsystem.numberfield.DmsNumberField +import team.aliens.dms.kmp.core.designsystem.text.DmsText +import team.aliens.dms.kmp.core.designsystem.timer.DmsTimer +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailVerificationCodeSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailVerificationCodeState +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailVerificationCodeViewModel + +@Composable +internal fun EnterEmailVerificationCode( + onBackPressed: () -> Unit, + navigateToSetId: (SignUpData) -> Unit, + signUpData: SignUpData, +) { + val viewModel: EnterEmailVerificationCodeViewModel = koinInject() + val state by viewModel.state.collectAsState() + + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when (it) { + is EnterEmailVerificationCodeSideEffect.MoveToSetId -> { + navigateToSetId(signUpData.copy(authCode = it.authCode)) + } + } + } + } + EnterEmailVerificationCodeScreen( + onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, + state = state, + onEmailVerificationCodeChange = viewModel::setEmailVerificationCode, + ) +} + +@Composable +private fun EnterEmailVerificationCodeScreen( + onBackPressed: () -> Unit, + onNextClick: () -> Unit, + state: EnterEmailVerificationCodeState, + onEmailVerificationCodeChange: (String) -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "인증코드를 입력해주세요", + description = "입력하신 이메일 주소로 인증코드가 전송되었어요.", + ) + VerificationCode( + emailVerificationCode = state.emailVerificationCode, + onEmailVerificationCodeChange = onEmailVerificationCodeChange, + ) + Spacer(modifier = Modifier.weight(1f)) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = onNextClick, + enabled = state.buttonEnabled, + ) + } +} + +@Composable +fun VerificationCode( + modifier: Modifier = Modifier, + emailVerificationCode: String, + onEmailVerificationCodeChange: (String) -> Unit, +) { + Column( + modifier = modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.ExtraLarge) + .horizontalPadding(), + ) { + DmsTimer() + Spacer(modifier = Modifier.height(PaddingDefaults.Large)) + DmsNumberField( + modifier = Modifier.fillMaxWidth(), + value = emailVerificationCode, + onValueChange = onEmailVerificationCodeChange, + totalLength = 6, + ) + Spacer(modifier = Modifier.height(PaddingDefaults.ExtraLarge)) + Row( + modifier = Modifier.clickable( + onClick = { } + ), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + Icon( + painter = painterResource(DmsIcon.Refresh), + contentDescription = "refresh", + tint = DmsTheme.colors.secondary, + ) + DmsText( + text = "인증문자 재발송", + style = DmsTypography.Body1Medium, + color = DmsTheme.colors.secondary, + ) + } + } +} + + diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt new file mode 100644 index 00000000..5c8c8a16 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt @@ -0,0 +1,43 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class EnterEmailVerificationCodeViewModel : + BaseViewModel( + EnterEmailVerificationCodeState.getDefaultState(), + ) { + + internal fun setEmailVerificationCode(emailVerificationCode: String) { + setState { + state.value.copy( + emailVerificationCode = emailVerificationCode, + ) + } + setButtonEnabled() + } + + private fun setButtonEnabled() = setState{ + val emailVerificationCode = state.value.emailVerificationCode + state.value.copy(buttonEnabled = emailVerificationCode.length == 6) + } + + internal fun onNextClick() { + postSideEffect(EnterEmailVerificationCodeSideEffect.MoveToSetId(authCode = "")) + } +} + +data class EnterEmailVerificationCodeState( + val emailVerificationCode: String, + val buttonEnabled: Boolean, +) { + companion object { + fun getDefaultState() = EnterEmailVerificationCodeState( + emailVerificationCode = "", + buttonEnabled = false, + ) + } +} + +sealed interface EnterEmailVerificationCodeSideEffect { + data class MoveToSetId(val authCode: String) : EnterEmailVerificationCodeSideEffect +} From 7c67b037481c6dcd1b1f946785146570125ce8c7 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:25:42 +0900 Subject: [PATCH 20/61] =?UTF-8?q?feat=20::=20DmsTimer=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kmp/core/designsystem/timer/DmsTimer.kt | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/timer/DmsTimer.kt diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/timer/DmsTimer.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/timer/DmsTimer.kt new file mode 100644 index 00000000..b9b3f520 --- /dev/null +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/timer/DmsTimer.kt @@ -0,0 +1,72 @@ +package team.aliens.dms.kmp.core.designsystem.timer + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.material.Icon +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 +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.jetbrains.compose.resources.painterResource +import team.aliens.dms.kmp.core.common.timer.CountDownTimer +import team.aliens.dms.kmp.core.common.timer.CountDownTimerListener +import team.aliens.dms.kmp.core.designsystem.foundation.DmsIcon +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography +import team.aliens.dms.kmp.core.designsystem.text.DmsText + +@Composable +fun DmsTimer( + modifier: Modifier = Modifier, + timerTotalSeconds: Long = 180000L, + timerInterval: Long = 1000L, +) { + var time by remember { mutableStateOf(timerTotalSeconds) } + var timerFinished by remember { mutableStateOf(false) } + + val countdownTimer = CountDownTimer() + + LaunchedEffect(Unit) { + countdownTimer.start( + durationMillis = timerTotalSeconds, + intervalMillis = timerInterval, + listener = object : CountDownTimerListener { + override fun onTick(timeLeft: Long) { + time = timeLeft + } + + override fun onFinish() { + timerFinished = true + } + }, + ) + } + + Row( + modifier = modifier, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + Icon( + painter = painterResource(DmsIcon.Alarm), + contentDescription = "alarm", + tint = DmsTheme.colors.onSurface, + ) + DmsText( + text = formatTime(time / 1000), + style = DmsTypography.Body1Medium, + color = DmsTheme.colors.onSurface, + ) + } +} + +fun formatTime(seconds: Long): String { + val minutes = seconds / 60 + val secs = seconds % 60 + return "$minutes:$secs" +} From b1a648ca85ab73c0b1eeee03b6bccf42145847c0 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:28:00 +0900 Subject: [PATCH 21/61] =?UTF-8?q?refactor=20::=20data=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt index af80387e..11286337 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailScreen.kt @@ -27,7 +27,7 @@ import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailViewModel @Composable internal fun EnterEmail( onBackPressed: () -> Unit, - navigateEnterEmailVerificationCode: (SignUpData) -> Unit, + navigateToEnterEmailVerificationCode: (SignUpData) -> Unit, signUpData: SignUpData, ) { val viewModel: EnterEmailViewModel = koinInject() @@ -37,7 +37,7 @@ internal fun EnterEmail( viewModel.sideEffect.collect { when (it) { is EnterEmailSideEffect.MoveToEnterEmailVerificationCode -> { - navigateEnterEmailVerificationCode(signUpData.copy(email = it.email)) + navigateToEnterEmailVerificationCode(signUpData.copy(email = it.email)) } } } @@ -71,7 +71,7 @@ private fun EnterEmailScreen( DmsTextField( modifier = Modifier .fillMaxWidth() - .topPadding(PaddingDefaults.Large) + .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding(), value = state.email, onValueChange = onEmailChange, From 9f2542ada80f11daa91568c2fb3eb4d7ee98bae3 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 19:28:49 +0900 Subject: [PATCH 22/61] =?UTF-8?q?refactor=20::=20padding=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt index 7c7525f8..96ebb33c 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt @@ -76,7 +76,7 @@ fun DmsButton( .fillMaxWidth() .padding( horizontal = 24.dp, - vertical = 14.dp, + vertical = 16.dp, ), horizontalArrangement = Arrangement.Center, ) { From a45b0f69f41fcd2128a539a03c1b9cef9bb3144c Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 20:04:53 +0900 Subject: [PATCH 23/61] =?UTF-8?q?refactor=20::=20=EC=B5=9C=EB=8C=80?= =?UTF-8?q?=EA=B0=92=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/kmp/core/designsystem/numberfield/DmsNumberField.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/numberfield/DmsNumberField.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/numberfield/DmsNumberField.kt index b152a0ee..6cdd1054 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/numberfield/DmsNumberField.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/numberfield/DmsNumberField.kt @@ -34,7 +34,11 @@ fun DmsNumberField( modifier = modifier, value = value.take(totalLength), enabled = enabled, - onValueChange = onValueChange, + onValueChange = { newValue -> + if (newValue.length <= totalLength) { + onValueChange(newValue) + } + }, singleLine = true, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Number, From b9efbf7bb7ea7ad76c5d084b87e00e2f0903dac2 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 20:05:18 +0900 Subject: [PATCH 24/61] =?UTF-8?q?feat=20::=20EnterEmailVerificationCode=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterEmailVerificationCodeNavigation.kt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailVerificationCodeNavigation.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailVerificationCodeNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailVerificationCodeNavigation.kt new file mode 100644 index 00000000..831bbf6a --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailVerificationCodeNavigation.kt @@ -0,0 +1,33 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.EnterEmailVerificationCode + +const val NAVIGATION_ENTER_EMAIL_VERIFICATION_CODE = "enterEmailVerificationCode" + +fun NavGraphBuilder.enterEmailVerificationCode( + onBackPressed: () -> Unit, + navigateToSetId: (SignUpData) -> Unit, +) { + composable( + route = "$NAVIGATION_ENTER_EMAIL_VERIFICATION_CODE/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + EnterEmailVerificationCode( + onBackPressed = onBackPressed, + navigateToSetId = navigateToSetId, + signUpData = it.getSignUpData(), + ) + } +} + +fun NavController.navigateToEnterEmailVerificationCode(signUpData: SignUpData) { + navigate("$NAVIGATION_ENTER_EMAIL_VERIFICATION_CODE/${signUpData.toJsonString()}") +} From b81774baf1c55dbe76ca9fd6ac3928357ac19171 Mon Sep 17 00:00:00 2001 From: uiel Date: Fri, 18 Oct 2024 23:05:24 +0900 Subject: [PATCH 25/61] =?UTF-8?q?feat=20::=20SetId=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/navigation/SetIdNavigation.kt | 35 +++++++++ .../dms/kmp/feature/signup/ui/SetIdScreen.kt | 78 +++++++++++++++++++ .../signup/viewmodel/SetIdViewModel.kt | 43 ++++++++++ 3 files changed, 156 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt new file mode 100644 index 00000000..60bbe847 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt @@ -0,0 +1,35 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.SetId + +const val NAVIGATION_SET_ID = "setId" + +fun NavGraphBuilder.setId( + onBackPressed: () -> Unit, + navigateToSetPassword: (SignUpData) -> Unit, +) { + composable( + route = "$NAVIGATION_SET_ID/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + SetId( + onBackPressed = onBackPressed, + navigateToSetPassword = navigateToSetPassword, + signUpData = it.getSignUpData(), + ) + } +} + +fun NavController.navigateToSetId(signUpData: SignUpData) { + navigate("$NAVIGATION_SET_ID/${signUpData.toJsonString()}") +} + + diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt new file mode 100644 index 00000000..47d6806c --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt @@ -0,0 +1,78 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdViewModel + +@Composable +internal fun SetId( + onBackPressed: () -> Unit, + navigateToSetPassword: (SignUpData) -> Unit, + signUpData: SignUpData, +) { + val viewModel: SetIdViewModel = koinInject() + val state by viewModel.state.collectAsState() + + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when (it) { + is SetIdSideEffect.MoveToSetPassword -> { + navigateToSetPassword( + signUpData.copy( + accountId = it.id, + grade = it.grade.toInt(), + classRoom = it.classroom.toInt(), + number = it.number.toInt(), + ), + ) + } + } + } + } + + SetIdScreen( + onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, + ) +} + +@Composable +private fun SetIdScreen( + onBackPressed: () -> Unit, + onNextClick: () -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "아이디 입력", + description = "아이디를 입력해주세요.", + ) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = onNextClick, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt new file mode 100644 index 00000000..060c347e --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt @@ -0,0 +1,43 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class SetIdViewModel : + BaseViewModel(SetIdState.getDefaultState()) { + + internal fun onNextClick() { + postSideEffect( + SetIdSideEffect.MoveToSetPassword( + id = "", + grade = "", + classroom = "", + number = "", + ), + ) + } +} + +data class SetIdState( + val id: String, + val grade: String, + val classroom: String, + val number: String, +) { + companion object { + fun getDefaultState() = SetIdState( + id = "", + grade = "", + classroom = "", + number = "", + ) + } +} + +sealed interface SetIdSideEffect { + data class MoveToSetPassword( + val id: String, + val grade: String, + val classroom: String, + val number: String, + ) : SetIdSideEffect +} From 0700655550cabd92da4e7d56cf9261d199bf6bdb Mon Sep 17 00:00:00 2001 From: uiel Date: Sat, 19 Oct 2024 08:35:09 +0900 Subject: [PATCH 26/61] =?UTF-8?q?feat=20::=20SetPassword=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../navigation/SetPasswordNavigation.kt | 34 +++++++++ .../feature/signup/ui/SetPasswordScreen.kt | 73 +++++++++++++++++++ .../signup/viewmodel/SetPasswordViewModel.kt | 32 ++++++++ 3 files changed, 139 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt new file mode 100644 index 00000000..f0310ac0 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt @@ -0,0 +1,34 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.SetPassword + +const val NAVIGATION_SET_PASSWORD = "setPassword" + +fun NavGraphBuilder.setPassword( + onBackPressed: () -> Unit, + navigateToTerms: (SignUpData) -> Unit, +) { + composable( + route = "$NAVIGATION_SET_PASSWORD/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + SetPassword( + onBackPressed = onBackPressed, + navigateToTerms = navigateToTerms, + signUpData = it.getSignUpData(), + ) + } +} + +fun NavController.navigateToSetPassword(signUpData: SignUpData) { + navigate("$NAVIGATION_SET_PASSWORD/${signUpData.toJsonString()}") +} + diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt new file mode 100644 index 00000000..65112f49 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt @@ -0,0 +1,73 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordViewModel + +@Composable +internal fun SetPassword( + onBackPressed: () -> Unit, + navigateToTerms: (SignUpData) -> Unit, + signUpData: SignUpData, +) { + val viewModel: SetPasswordViewModel = koinInject() + val state by viewModel.state.collectAsState() + + LaunchedEffect(Unit) { + viewModel.sideEffect.collect { + when (it) { + is SetPasswordSideEffect.MoveToTerms -> { + navigateToTerms( + signUpData.copy(password = it.password), + ) + } + } + } + } + + SetPasswordScreen( + onBackPressed = onBackPressed, + onNextClick = viewModel::onNextClick, + ) +} + +@Composable +private fun SetPasswordScreen( + onBackPressed: () -> Unit, + onNextClick: () -> Unit, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "비밀번호 입력", + description = "비밀번호를 입력해주세요.", + ) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = onNextClick, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt new file mode 100644 index 00000000..56a41b3c --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt @@ -0,0 +1,32 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + + +internal class SetPasswordViewModel : + BaseViewModel(SetPasswordState.getDefaultState()) { + + internal fun onNextClick() { + postSideEffect( + SetPasswordSideEffect.MoveToTerms( + password = "" + ), + ) + } +} + +data class SetPasswordState( + val password: String, +) { + companion object { + fun getDefaultState() = SetPasswordState( + password = "" + ) + } +} + +sealed interface SetPasswordSideEffect { + data class MoveToTerms( + val password: String, + ) : SetPasswordSideEffect +} From 7be2a18c3248358b82589507e7991e923f3029e5 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:11:44 +0900 Subject: [PATCH 27/61] =?UTF-8?q?refactor=20::=20terms=20url=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/core/network/PlatformConfig.android.kt | 1 + .../kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.kt | 1 + .../team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt | 4 ++++ .../team/aliens/dms/kmp/core/network/PlatformConfig.jvm.kt | 2 ++ 4 files changed, 8 insertions(+) diff --git a/core/network/src/androidMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.android.kt b/core/network/src/androidMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.android.kt index b2bca89e..a2c4b5c0 100644 --- a/core/network/src/androidMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.android.kt +++ b/core/network/src/androidMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.android.kt @@ -3,4 +3,5 @@ package team.aliens.dms.kmp.core.network @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual val baseUrl: String = BuildConfig.BASE_URL + actual val termsUrl: String = BuildConfig.TERMS_URL } diff --git a/core/network/src/commonMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.kt b/core/network/src/commonMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.kt index f6dece82..dd8fe648 100644 --- a/core/network/src/commonMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.kt +++ b/core/network/src/commonMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.kt @@ -3,4 +3,5 @@ package team.aliens.dms.kmp.core.network @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") expect object PlatformConfig { val baseUrl: String + val termsUrl: String } diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt index 1f9cd668..e098d635 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt @@ -2,10 +2,14 @@ package team.aliens.dms.kmp.core.network import platform.Foundation.NSBundle import team.aliens.dms.kmp.core.network.exception.CannotFindIosBaseurlException +import team.aliens.dms.kmp.core.network.exception.CannotFindIosTermsUrlException @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual val baseUrl: String = (NSBundle.mainBundle.objectForInfoDictionaryKey("BaseURL") as? String) ?: throw CannotFindIosBaseurlException() + actual val termsUrl: String = + (NSBundle.mainBundle.objectForInfoDictionaryKey("TermsUrl") as? String) + ?: throw CannotFindIosTermsUrlException() } diff --git a/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.jvm.kt b/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.jvm.kt index 8a81cde0..b09f6055 100644 --- a/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.jvm.kt +++ b/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.jvm.kt @@ -1,8 +1,10 @@ package team.aliens.dms.kmp.core.network import team.aliens.dms.kmp.core.network.exception.CannotFindJvmBaseurlException +import team.aliens.dms.kmp.core.network.exception.CannotFindJvmTermsUrlException @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual val baseUrl: String = System.getenv("") ?: throw CannotFindJvmBaseurlException() + actual val termsUrl: String = System.getenv("") ?: throw CannotFindJvmTermsUrlException() } From 480a1a43a490dbb091ab18752c657bb048a08de6 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:12:04 +0900 Subject: [PATCH 28/61] =?UTF-8?q?design=20::=20=EC=B2=B4=ED=81=AC=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../composeResources/drawable/ic_check.xml | 13 +++++++++++++ .../dms/kmp/core/designsystem/foundation/DmsIcon.kt | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 core/design-system/src/commonMain/composeResources/drawable/ic_check.xml diff --git a/core/design-system/src/commonMain/composeResources/drawable/ic_check.xml b/core/design-system/src/commonMain/composeResources/drawable/ic_check.xml new file mode 100644 index 00000000..204382c0 --- /dev/null +++ b/core/design-system/src/commonMain/composeResources/drawable/ic_check.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt index 2fb0e0c9..d3f17280 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/foundation/DmsIcon.kt @@ -6,6 +6,7 @@ import dmskmp.core.design_system.generated.resources.ic_alarm import dmskmp.core.design_system.generated.resources.ic_arrow_back import dmskmp.core.design_system.generated.resources.ic_breaking_news import dmskmp.core.design_system.generated.resources.ic_cancel +import dmskmp.core.design_system.generated.resources.ic_check import dmskmp.core.design_system.generated.resources.ic_delete import dmskmp.core.design_system.generated.resources.ic_edit import dmskmp.core.design_system.generated.resources.ic_home @@ -31,4 +32,5 @@ object DmsIcon { val SymbolDark = Res.drawable.ic_symbol_dark val Alarm = Res.drawable.ic_alarm val Refresh = Res.drawable.ic_refresh + val Check = Res.drawable.ic_check } From fdefca1e231c817e45ea545686b6b1df35117dd4 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:13:33 +0900 Subject: [PATCH 29/61] =?UTF-8?q?feat=20::=20DmsWebView=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webview/DmsWebView.android.kt | 27 +++++++++++++++++ .../core/designsystem/webview/DmsWebView.kt | 10 +++++++ .../designsystem/webview/DmsWebView.ios.kt | 29 +++++++++++++++++++ .../designsystem/webview/DmsWebView.jvm.kt | 8 +++++ 4 files changed, 74 insertions(+) create mode 100644 core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt create mode 100644 core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.kt create mode 100644 core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt create mode 100644 core/design-system/src/jvmMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.jvm.kt diff --git a/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt new file mode 100644 index 00000000..13ce8127 --- /dev/null +++ b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt @@ -0,0 +1,27 @@ +package team.aliens.dms.kmp.core.designsystem.webview + +import android.webkit.WebView +import android.webkit.WebViewClient +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.viewinterop.AndroidView + +@Composable +actual fun DmsWebView( + modifier: Modifier, + url: String, +) { + val context = LocalContext.current + + AndroidView( + factory = { + WebView(context).apply { + webViewClient = WebViewClient() + settings.javaScriptEnabled = true + } + }, + modifier = Modifier.then(modifier), + update = { it.loadUrl(url) }, + ) +} diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.kt new file mode 100644 index 00000000..9e7225f3 --- /dev/null +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.kt @@ -0,0 +1,10 @@ +package team.aliens.dms.kmp.core.designsystem.webview + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +expect fun DmsWebView( + modifier: Modifier = Modifier, + url: String, +) diff --git a/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt new file mode 100644 index 00000000..9e79cdad --- /dev/null +++ b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt @@ -0,0 +1,29 @@ +package team.aliens.dms.kmp.core.designsystem.webview + +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.viewinterop.UIKitView +import platform.Foundation.NSMutableURLRequest +import platform.Foundation.NSURL +import platform.WebKit.WKWebView + +@Composable +actual fun DmsWebView( + modifier: Modifier, + url: String, +) { + val webView = remember { WKWebView() } + val request = NSMutableURLRequest.requestWithURL(URL = NSURL(string = url)) + + webView.apply { + loadRequest(request) + allowsBackForwardNavigationGestures = true + } + + UIKitView( + factory = { webView }, + modifier = Modifier.fillMaxSize() + ) +} diff --git a/core/design-system/src/jvmMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.jvm.kt b/core/design-system/src/jvmMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.jvm.kt new file mode 100644 index 00000000..685dffe4 --- /dev/null +++ b/core/design-system/src/jvmMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.jvm.kt @@ -0,0 +1,8 @@ +package team.aliens.dms.kmp.core.designsystem.webview + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +actual fun DmsWebView(modifier: Modifier, url: String) { +} From dd2250506f5b43ecc7e64fd3e583d0c25e688b95 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:14:08 +0900 Subject: [PATCH 30/61] =?UTF-8?q?feat=20::=20platform=20config=20exception?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/network/exception/CannotFindIosTermsUrlException.kt | 3 +++ .../core/network/exception/CannotFindJvmTermsUrlException.kt | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt create mode 100644 core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindJvmTermsUrlException.kt diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt new file mode 100644 index 00000000..3fc2319e --- /dev/null +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt @@ -0,0 +1,3 @@ +package team.aliens.dms.kmp.core.network.exception + +class CannotFindIosTermsUrlException : IllegalStateException("Cannot find ios termsUrl") diff --git a/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindJvmTermsUrlException.kt b/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindJvmTermsUrlException.kt new file mode 100644 index 00000000..2dcba36a --- /dev/null +++ b/core/network/src/jvmMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindJvmTermsUrlException.kt @@ -0,0 +1,3 @@ +package team.aliens.dms.kmp.core.network.exception + +class CannotFindJvmTermsUrlException : IllegalStateException("Cannot find jvm termsUrl") From 63d3d393cda65bafbe02be973e455cf800d0054a Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:14:47 +0900 Subject: [PATCH 31/61] =?UTF-8?q?feat=20::=20Terms=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/navigation/TermsNavigation.kt | 34 ++++ .../dms/kmp/feature/signup/ui/TermsScreen.kt | 154 ++++++++++++++++++ .../signup/viewmodel/TermsViewModel.kt | 25 +++ 3 files changed, 213 insertions(+) create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/TermsNavigation.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt create mode 100644 feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/TermsViewModel.kt diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/TermsNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/TermsNavigation.kt new file mode 100644 index 00000000..e67da693 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/TermsNavigation.kt @@ -0,0 +1,34 @@ +package team.aliens.dms.kmp.feature.signup.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType +import androidx.navigation.compose.composable +import androidx.navigation.navArgument +import team.aliens.dms.kmp.core.common.utils.ResourceKeys +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.model.toJsonString +import team.aliens.dms.kmp.feature.signup.ui.Terms + +const val NAVIGATION_TERMS = "terms" + +fun NavGraphBuilder.terms( + onBackPressed: () -> Unit, + navigateToSignIn: () -> Unit, + termsUrl: String, +) { + composable( + route = "$NAVIGATION_TERMS/{${ResourceKeys.SIGN_UP}}", + arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), + ) { + Terms( + onBackPressed = onBackPressed, + navigateToSignIn = navigateToSignIn, + termsUrl = termsUrl, + ) + } +} + +fun NavController.navigateToTerms(signUpData: SignUpData) { + navigate("$NAVIGATION_TERMS/${signUpData.toJsonString()}") +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt new file mode 100644 index 00000000..288a7d97 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt @@ -0,0 +1,154 @@ +package team.aliens.dms.kmp.feature.signup.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Icon +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +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.draw.clip +import androidx.compose.ui.unit.dp +import org.jetbrains.compose.resources.painterResource +import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults +import team.aliens.dms.kmp.core.common.ui.bottomPadding +import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding +import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar +import team.aliens.dms.kmp.core.designsystem.button.DmsButton +import team.aliens.dms.kmp.core.designsystem.foundation.DmsIcon +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography +import team.aliens.dms.kmp.core.designsystem.text.DmsText +import team.aliens.dms.kmp.core.designsystem.webview.DmsWebView +import team.aliens.dms.kmp.feature.signup.viewmodel.TermsState +import team.aliens.dms.kmp.feature.signup.viewmodel.TermsViewModel + +@Composable +internal fun Terms( + onBackPressed: () -> Unit, + navigateToSignIn: () -> Unit, + termsUrl: String, +) { + val viewModel: TermsViewModel = koinInject() + val state by viewModel.state.collectAsState() + val theme = if (isSystemInDarkTheme()) { + "dark" + } else { + "light" + } + + TermsScreen( + onBackPressed = onBackPressed, + navigateToSignIn = navigateToSignIn, + termsUrl = termsUrl, + state = state, + onAllAgreeButtonClick = viewModel::setButtonEnabled, + theme = theme, + ) +} + +@Composable +private fun TermsScreen( + onBackPressed: () -> Unit, + navigateToSignIn: () -> Unit, + termsUrl: String, + state: TermsState, + onAllAgreeButtonClick: (Boolean) -> Unit, + theme: String, +) { + Column( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.background), + ) { + DmsLargeTopAppBar( + onBackPressed = onBackPressed, + title = "개인정보처리방침 안내", + description = "개인정보처리방침을 확인해주세요.", + ) + AllAgreeButton( + buttonEnabled = state.buttonEnabled, + onAllAgreeButtonClick = onAllAgreeButtonClick, + ) + DmsWebView( + modifier = Modifier + .weight(1f) + .topPadding(PaddingDefaults.Medium) + .horizontalPadding() + .clip(RoundedCornerShape(8.dp)), + url = "$termsUrl/policy/privacy?theme=$theme", + ) + DmsButton( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.ExtraLarge) + .horizontalPadding() + .bottomPadding(), + text = "다음", + onClick = navigateToSignIn, + enabled = state.buttonEnabled, + ) + } +} + +@Composable +private fun AllAgreeButton( + buttonEnabled: Boolean, + onAllAgreeButtonClick: (Boolean) -> Unit, +) { + var isCheck by remember { mutableStateOf(buttonEnabled) } + val backGround = if (isCheck) { + DmsTheme.colors.onSecondary + } else { + DmsTheme.colors.onBackground + } + val contentColor = if (isCheck) { + DmsTheme.colors.surfaceContainerHighest + } else { + DmsTheme.colors.onSurface + } + Row( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.ExtraLarge) + .horizontalPadding() + .clickable( + onClick = { + isCheck = !isCheck + onAllAgreeButtonClick(isCheck) + }, + ) + .background( + color = backGround, + shape = RoundedCornerShape(8.dp), + ) + .padding(PaddingDefaults.Large), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + Icon( + painter = painterResource(DmsIcon.Check), + contentDescription = "check", + tint = contentColor, + ) + DmsText( + text = "전체 동의", + style = DmsTypography.SubtitleSemiBold, + color = contentColor, + ) + } +} diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/TermsViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/TermsViewModel.kt new file mode 100644 index 00000000..211b3b61 --- /dev/null +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/TermsViewModel.kt @@ -0,0 +1,25 @@ +package team.aliens.dms.kmp.feature.signup.viewmodel + +import team.aliens.dms.kmp.core.common.base.BaseViewModel + +internal class TermsViewModel : + BaseViewModel(TermsState.getDefaultState()) { + + internal fun setButtonEnabled(buttonEnabled: Boolean) { + setState { state.value.copy(buttonEnabled = buttonEnabled) } + } +} + +data class TermsState( + val buttonEnabled: Boolean, +) { + companion object { + fun getDefaultState() = TermsState( + buttonEnabled = false, + ) + } +} + +sealed interface TermsSideEffect { + data object Success : TermsSideEffect +} From 1f39ca7a777f082d41287e1bfc4b16ec3f6cba41 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:19:22 +0900 Subject: [PATCH 32/61] feat :: signup navigation --- .../team/aliens/dms/kmp/DmsNavigator.kt | 59 ++++++++++++++++++- .../navigation/authorized/AuthNavigation.kt | 17 +++++- 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt index f39fec57..421e393c 100644 --- a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt +++ b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt @@ -4,15 +4,72 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController +import team.aliens.dms.kmp.core.network.PlatformConfig import team.aliens.dms.kmp.feature.signin.navigation.navigateToSignIn +import team.aliens.dms.kmp.feature.signup.model.SignUpData +import team.aliens.dms.kmp.feature.signup.navigation.navigateToEnterEmail +import team.aliens.dms.kmp.feature.signup.navigation.navigateToEnterEmailVerificationCode +import team.aliens.dms.kmp.feature.signup.navigation.navigateToEnterSchoolVerificationCode +import team.aliens.dms.kmp.feature.signup.navigation.navigateToEnterSchoolVerificationQuestion +import team.aliens.dms.kmp.feature.signup.navigation.navigateToSetId +import team.aliens.dms.kmp.feature.signup.navigation.navigateToSetPassword +import team.aliens.dms.kmp.feature.signup.navigation.navigateToSignUp +import team.aliens.dms.kmp.feature.signup.navigation.navigateToTerms internal class DmsNavigator( val navController: NavHostController, ) { - fun navigateToLogin() { + fun navigateToSignIn() { navController.navigateToSignIn() } + + fun navigateToSignUp() { + navController.navigateToSignUp() + } + + fun navigateToEnterSchoolVerificationCode() { + navController.navigateToEnterSchoolVerificationCode() + } + + fun navigateToEnterSchoolVerificationQuestion(signUpData: SignUpData) { + navController.navigateToEnterSchoolVerificationQuestion(signUpData = signUpData) + } + + fun navigateToEnterEmail(signUpData: SignUpData) { + navController.navigateToEnterEmail(signUpData = signUpData) + } + + fun navigateToEnterEmailVerificationCode(signUpData: SignUpData) { + navController.navigateToEnterEmailVerificationCode(signUpData = signUpData) + } + + fun navigateToSetId(signUpData: SignUpData) { + navController.navigateToSetId(signUpData = signUpData) + } + + fun navigateToSetPassword(signUpData: SignUpData) { + navController.navigateToSetPassword(signUpData = signUpData) + } + + fun navigateToTerms(signUpData: SignUpData) { + navController.navigateToTerms(signUpData = signUpData) + } + + fun popBackStackIfNotHome() { + if (!isSameCurrentDestination()) { + popBackStack() + } + } + + // TODO: private로 변경 + fun popBackStack() { + navController.popBackStack() + } + + private fun isSameCurrentDestination(): Boolean { + return navController.currentDestination?.route == "" + } } @Composable diff --git a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/navigation/authorized/AuthNavigation.kt b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/navigation/authorized/AuthNavigation.kt index ef55b496..43f6f578 100644 --- a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/navigation/authorized/AuthNavigation.kt +++ b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/navigation/authorized/AuthNavigation.kt @@ -3,7 +3,9 @@ package team.aliens.dms.kmp.navigation.authorized import androidx.navigation.NavGraphBuilder import androidx.navigation.navigation import team.aliens.dms.kmp.DmsNavigator +import team.aliens.dms.kmp.core.network.PlatformConfig import team.aliens.dms.kmp.feature.signin.navigation.signIn +import team.aliens.dms.kmp.feature.signup.navigation.signUp import team.aliens.dms.kmp.feature.splash.navigation.NAVIGATION_SPLASH import team.aliens.dms.kmp.feature.splash.navigation.splash @@ -17,13 +19,24 @@ internal fun NavGraphBuilder.authNavigation( startDestination = NAVIGATION_SPLASH, ) { splash( - navigateToLogin = navigator::navigateToLogin, + navigateToLogin = navigator::navigateToSignIn, ) signIn( navigateToMain = { }, - navigateToSignUp = { }, + navigateToSignUp = navigator::navigateToSignUp, navigateToFindId = { }, navigateToFindPassword = { }, ) + signUp( + onBackPressed = navigator::popBackStack, + navigateToEnterSchoolVerificationQuestion = navigator::navigateToEnterSchoolVerificationQuestion, + navigateToEnterEmail = navigator::navigateToEnterEmail, + navigateToEnterEmailVerificationCode = navigator::navigateToEnterEmailVerificationCode, + navigateToSetId = navigator::navigateToSetId, + navigateToSetPassword = navigator::navigateToSetPassword, + navigateToTerms = navigator::navigateToTerms, + navigateToSignIn = navigator::navigateToSignIn, + termsUrl = PlatformConfig.termsUrl, + ) } } From 78470c4ab35a4711b9285b0ad5894ab1e861815e Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:19:42 +0900 Subject: [PATCH 33/61] =?UTF-8?q?chore=20::=20=EC=9D=98=EC=A1=B4=EC=84=B1?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/design-system/build.gradle.kts | 2 ++ feature/signup/build.gradle.kts | 1 + 2 files changed, 3 insertions(+) diff --git a/core/design-system/build.gradle.kts b/core/design-system/build.gradle.kts index 9df3b648..d49a03c6 100644 --- a/core/design-system/build.gradle.kts +++ b/core/design-system/build.gradle.kts @@ -48,6 +48,8 @@ kotlin { implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) implementation(libs.kottie) + + implementation(projects.core.common) } commonTest.dependencies { implementation(libs.kotlin.test) diff --git a/feature/signup/build.gradle.kts b/feature/signup/build.gradle.kts index 5249c4e4..1746d24a 100644 --- a/feature/signup/build.gradle.kts +++ b/feature/signup/build.gradle.kts @@ -42,6 +42,7 @@ kotlin { implementation(compose.material) implementation(compose.material3) implementation(compose.ui) + implementation(compose.components.resources) implementation(libs.navigation.compose) implementation(libs.kotlinx.serialization.json) From 74501458eeca34ebddfb8a5166707ee757dbaa23 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 19:20:09 +0900 Subject: [PATCH 34/61] =?UTF-8?q?feat=20::=20signupModule=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/di/SignIUpModel.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt index 164f0723..93d077e7 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/di/SignIUpModel.kt @@ -2,10 +2,20 @@ package team.aliens.dms.kmp.feature.signup.di import org.koin.core.module.dsl.viewModelOf import org.koin.dsl.module +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailVerificationCodeViewModel +import team.aliens.dms.kmp.feature.signup.viewmodel.EnterEmailViewModel import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationCodeViewModel import team.aliens.dms.kmp.feature.signup.viewmodel.EnterSchoolVerificationQuestionViewModel +import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdViewModel +import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordViewModel +import team.aliens.dms.kmp.feature.signup.viewmodel.TermsViewModel val signUpModule = module { viewModelOf(::EnterSchoolVerificationCodeViewModel) viewModelOf(::EnterSchoolVerificationQuestionViewModel) + viewModelOf(::EnterEmailViewModel) + viewModelOf(::EnterEmailVerificationCodeViewModel) + viewModelOf(::SetIdViewModel) + viewModelOf(::SetPasswordViewModel) + viewModelOf(::TermsViewModel) } From ab5505857f0def08ad69fd416b9104b301e1f4a5 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:19:56 +0900 Subject: [PATCH 35/61] =?UTF-8?q?feat=20::=20Regex=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/team/aliens/dms/kmp/core/common/utils/Regex.kt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/Regex.kt diff --git a/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/Regex.kt b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/Regex.kt new file mode 100644 index 00000000..ced1d0ae --- /dev/null +++ b/core/common/src/commonMain/kotlin/team/aliens/dms/kmp/core/common/utils/Regex.kt @@ -0,0 +1,5 @@ +package team.aliens.dms.kmp.core.common.utils + +object Regex { + const val PASSWORD = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@\$!%*#?&])[A-Za-z\\d@\$!%*#?&]{8,20}\$" +} From cd963b6cd69cfa5d22c0c50afd854e468b66891f Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:20:09 +0900 Subject: [PATCH 36/61] =?UTF-8?q?refactor=20::=20modifier=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt index 59037c16..bf8e541e 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/textfield/DmsTextField.kt @@ -57,6 +57,7 @@ fun DmsTextField( showClearIcon: Boolean = false, ) { Column( + modifier = modifier, verticalArrangement = Arrangement.spacedBy(8.dp), ) { label?.let { label -> @@ -66,7 +67,6 @@ fun DmsTextField( ) } TextField( - modifier = modifier, value = value, hint = hint, onValueChange = onValueChange, From 7a092159c90df06a8ff2eaa420425f71a9533770 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:21:06 +0900 Subject: [PATCH 37/61] =?UTF-8?q?refactor=20::=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt index 18f80375..f74d1afd 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterEmailNavigation.kt @@ -14,7 +14,7 @@ const val NAVIGATION_ENTER_EMAIL = "enterEmail" fun NavGraphBuilder.enterEmail( onBackPressed: () -> Unit, - navigateEnterEmailVerificationCode: (SignUpData) -> Unit, + navigateToEnterEmailVerificationCode: (SignUpData) -> Unit, ) { composable( route = "$NAVIGATION_ENTER_EMAIL/{${ResourceKeys.SIGN_UP}}", @@ -22,7 +22,7 @@ fun NavGraphBuilder.enterEmail( ) { EnterEmail( onBackPressed = onBackPressed, - navigateEnterEmailVerificationCode = navigateEnterEmailVerificationCode, + navigateToEnterEmailVerificationCode = navigateToEnterEmailVerificationCode, signUpData = it.getSignUpData(), ) } From 6aea7b501fef317efe9ef3ab5d4761cc92510150 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:21:42 +0900 Subject: [PATCH 38/61] =?UTF-8?q?feat=20::=20SignUpNavigation=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/navigation/SignUpNavigation.kt | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt index 2af48f5e..159047f7 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -14,7 +14,12 @@ fun NavGraphBuilder.signUp( onBackPressed: () -> Unit, navigateToEnterSchoolVerificationQuestion: (SignUpData) -> Unit, navigateToEnterEmail: (SignUpData) -> Unit, - navigateEnterEmailVerificationCode: (SignUpData) -> Unit + navigateToEnterEmailVerificationCode: (SignUpData) -> Unit, + navigateToSetId: (SignUpData) -> Unit, + navigateToSetPassword: (SignUpData) -> Unit, + navigateToTerms: (SignUpData) -> Unit, + navigateToSignIn: () -> Unit, + termsUrl: String, ) { navigation( route = NAVIGATION_SIGN_UP, @@ -30,7 +35,24 @@ fun NavGraphBuilder.signUp( ) enterEmail( onBackPressed = onBackPressed, - navigateEnterEmailVerificationCode = navigateEnterEmailVerificationCode, + navigateToEnterEmailVerificationCode = navigateToEnterEmailVerificationCode, + ) + enterEmailVerificationCode( + onBackPressed = onBackPressed, + navigateToSetId = navigateToSetId, + ) + setId( + onBackPressed = onBackPressed, + navigateToSetPassword = navigateToSetPassword, + ) + setPassword( + onBackPressed = onBackPressed, + navigateToTerms = navigateToTerms, + ) + terms( + onBackPressed = onBackPressed, + navigateToSignIn = navigateToSignIn, + termsUrl = termsUrl, ) } } From fe31b9e4016c4cdc2a85c87e1d16add75dda0066 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:22:26 +0900 Subject: [PATCH 39/61] =?UTF-8?q?refactor=20::=20padding=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/signup/ui/EnterSchoolVerificationCodeScreen.kt | 2 +- .../signup/ui/EnterSchoolVerificationQuestionScreen.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt index 17ea9e18..1898b249 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationCodeScreen.kt @@ -72,7 +72,7 @@ private fun EnterSchoolVerificationCodeScreen( DmsNumberField( modifier = Modifier .fillMaxWidth() - .topPadding(PaddingDefaults.Large) + .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding(), value = state.verificationCode, onValueChange = onVerificationCodeChange, diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt index 56d5c456..816dcf95 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt @@ -36,12 +36,13 @@ internal fun EnterSchoolVerificationQuestion( LaunchedEffect(Unit) { viewModel.sideEffect.collect { when(it) { - is EnterSchoolVerificationQuestionSideEffect.MoveToSetId -> { + is EnterSchoolVerificationQuestionSideEffect.MoveToEnterEmail -> { navigateToEnterEmail(signUpData.copy(schoolAnswer = it.schoolAnswer)) } } } } + EnterSchoolVerificationQuestionScreen( onBackPressed = onBackPressed, onNextClick = viewModel::onNextClick, @@ -70,7 +71,7 @@ private fun EnterSchoolVerificationQuestionScreen( DmsTextField( modifier = Modifier .fillMaxWidth() - .topPadding(PaddingDefaults.Large) + .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding(), value = state.schoolVerificationAnswer, onValueChange = onVerificationAnswerChange, From 56088906bfab3b271f1a52c717a1791e5e5b72a2 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:22:48 +0900 Subject: [PATCH 40/61] =?UTF-8?q?feat=20::=20SetPassword=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/signup/ui/SetPasswordScreen.kt | 44 ++++++++++++++++++- .../signup/viewmodel/SetPasswordViewModel.kt | 44 ++++++++++++++++++- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt index 65112f49..584ea612 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt @@ -2,6 +2,7 @@ package team.aliens.dms.kmp.feature.signup.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.runtime.Composable @@ -9,14 +10,19 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults import team.aliens.dms.kmp.core.common.ui.bottomPadding import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar import team.aliens.dms.kmp.core.designsystem.button.DmsButton import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.textfield.DmsTextField import team.aliens.dms.kmp.feature.signup.model.SignUpData import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordState import team.aliens.dms.kmp.feature.signup.viewmodel.SetPasswordViewModel @Composable @@ -43,6 +49,9 @@ internal fun SetPassword( SetPasswordScreen( onBackPressed = onBackPressed, onNextClick = viewModel::onNextClick, + state = state, + onPasswordChange = viewModel::setPassword, + onCheckPasswordChange = viewModel::setPasswordCheck, ) } @@ -50,6 +59,9 @@ internal fun SetPassword( private fun SetPasswordScreen( onBackPressed: () -> Unit, onNextClick: () -> Unit, + state: SetPasswordState, + onPasswordChange: (String) -> Unit, + onCheckPasswordChange: (String) -> Unit, ) { Column( modifier = Modifier @@ -58,9 +70,36 @@ private fun SetPasswordScreen( ) { DmsLargeTopAppBar( onBackPressed = onBackPressed, - title = "비밀번호 입력", - description = "비밀번호를 입력해주세요.", + title = "비밀번호를 입력해주세요", + description = "비밀번호 영문, 숫자, 기호 포함해서 8~20자가\n원칙입니다.", ) + DmsTextField( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.ExtraLarge) + .horizontalPadding(), + value = state.password, + onValueChange = onPasswordChange, + hint = "비밀번호를 입력해주세요", + label = "비밀번호 입력", + showVisibleIcon = true, + isError = state.showPasswordDescription, + errorDescription = "형식에 맞게 설정해주세요." + ) + DmsTextField( + modifier = Modifier + .fillMaxWidth() + .topPadding(36.dp) + .horizontalPadding(), + value = state.passwordCheck, + onValueChange = onCheckPasswordChange, + hint = "비밀번호를 다시 입력해주세요", + label = "비밀번호 확인", + showVisibleIcon = true, + isError = state.showCheckPasswordDescription, + errorDescription = "비밀번호를 확인해주세요" + ) + Spacer(modifier = Modifier.weight(1f)) DmsButton( modifier = Modifier .fillMaxWidth() @@ -68,6 +107,7 @@ private fun SetPasswordScreen( .bottomPadding(), text = "다음", onClick = onNextClick, + enabled = state.buttonEnabled, ) } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt index 56a41b3c..dbede5ee 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt @@ -1,15 +1,47 @@ package team.aliens.dms.kmp.feature.signup.viewmodel import team.aliens.dms.kmp.core.common.base.BaseViewModel +import team.aliens.dms.kmp.core.common.utils.Regex internal class SetPasswordViewModel : BaseViewModel(SetPasswordState.getDefaultState()) { + internal fun setPassword(password: String) { + setState { + state.value.copy( + password = password, + showPasswordDescription = !Regex(Regex.PASSWORD) + .matches(password), + ) + } + setButtonEnabled() + } + + internal fun setPasswordCheck(passwordCheck: String) { + setState { + with(state.value) { + copy( + passwordCheck = passwordCheck, + showCheckPasswordDescription = password != passwordCheck, + ) + } + } + setButtonEnabled() + } + + private fun setButtonEnabled() = setState { + with(state.value) { + val hasBlank = password.isBlank() || passwordCheck.isBlank() + val hasInvalidation = showPasswordDescription || showCheckPasswordDescription + copy(buttonEnabled = !hasBlank && !hasInvalidation) + } + } + internal fun onNextClick() { postSideEffect( SetPasswordSideEffect.MoveToTerms( - password = "" + password = "", ), ) } @@ -17,10 +49,18 @@ internal class SetPasswordViewModel : data class SetPasswordState( val password: String, + val passwordCheck: String, + val showPasswordDescription: Boolean, + val showCheckPasswordDescription: Boolean, + val buttonEnabled: Boolean, ) { companion object { fun getDefaultState() = SetPasswordState( - password = "" + password = "", + passwordCheck = "", + showPasswordDescription = false, + showCheckPasswordDescription = false, + buttonEnabled = false, ) } } From e119e1579e74d719dee52a1d40550c145a319194 Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:23:25 +0900 Subject: [PATCH 41/61] =?UTF-8?q?refactor=20::=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=99=9C=EC=84=B1=ED=99=94=20=EC=A1=B0=EA=B1=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt index 2ed65bc3..e9792b19 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterSchoolVerificationCodeViewModel.kt @@ -18,7 +18,7 @@ internal class EnterSchoolVerificationCodeViewModel : private fun setButtonEnabled() = setState { val verificationCode = state.value.verificationCode - state.value.copy(buttonEnabled = verificationCode.isNotEmpty()) + state.value.copy(buttonEnabled = verificationCode.length == 6) } internal fun onNextClick() { From b36f06e42232b969b2f34dbd54c22e88d91d2cbf Mon Sep 17 00:00:00 2001 From: uiel Date: Sun, 20 Oct 2024 22:23:43 +0900 Subject: [PATCH 42/61] =?UTF-8?q?refactor=20::=20=EB=8D=94=EB=AF=B8?= =?UTF-8?q?=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt index 47d6806c..afd698b4 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt @@ -35,9 +35,9 @@ internal fun SetId( navigateToSetPassword( signUpData.copy( accountId = it.id, - grade = it.grade.toInt(), - classRoom = it.classroom.toInt(), - number = it.number.toInt(), + grade = 1, + classRoom = 1, + number = 1, ), ) } From 71dc5e77a207aaf417e0fc102449c9ad2e1740b8 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 07:45:09 +0900 Subject: [PATCH 43/61] =?UTF-8?q?refactor=20::=20keyboard=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt index 584ea612..7eb9ab42 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt @@ -10,6 +10,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import org.koin.compose.koinInject import team.aliens.dms.kmp.core.common.ui.PaddingDefaults @@ -84,7 +85,8 @@ private fun SetPasswordScreen( label = "비밀번호 입력", showVisibleIcon = true, isError = state.showPasswordDescription, - errorDescription = "형식에 맞게 설정해주세요." + errorDescription = "형식에 맞게 설정해주세요.", + keyboardType = KeyboardType.Password, ) DmsTextField( modifier = Modifier @@ -97,7 +99,8 @@ private fun SetPasswordScreen( label = "비밀번호 확인", showVisibleIcon = true, isError = state.showCheckPasswordDescription, - errorDescription = "비밀번호를 확인해주세요" + errorDescription = "비밀번호를 확인해주세요", + keyboardType = KeyboardType.Password, ) Spacer(modifier = Modifier.weight(1f)) DmsButton( From f7f7be81c6feb2d126022d5dbfa3a5c8daa099d2 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 07:45:32 +0900 Subject: [PATCH 44/61] =?UTF-8?q?feat=20::=20=EC=9E=85=EB=A0=A5=EC=B0=BD?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/kmp/feature/signup/ui/SetIdScreen.kt | 51 ++++++++++++++++++- .../signup/viewmodel/SetIdViewModel.kt | 12 +++++ 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt index afd698b4..df7b782a 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetIdScreen.kt @@ -1,7 +1,10 @@ package team.aliens.dms.kmp.feature.signup.ui import androidx.compose.foundation.background +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.runtime.Composable @@ -9,14 +12,20 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.unit.dp import org.koin.compose.koinInject +import team.aliens.dms.kmp.core.common.ui.PaddingDefaults import team.aliens.dms.kmp.core.common.ui.bottomPadding import team.aliens.dms.kmp.core.common.ui.horizontalPadding +import team.aliens.dms.kmp.core.common.ui.topPadding import team.aliens.dms.kmp.core.designsystem.appbar.DmsLargeTopAppBar import team.aliens.dms.kmp.core.designsystem.button.DmsButton import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.textfield.DmsTextField import team.aliens.dms.kmp.feature.signup.model.SignUpData import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdSideEffect +import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdState import team.aliens.dms.kmp.feature.signup.viewmodel.SetIdViewModel @Composable @@ -48,6 +57,10 @@ internal fun SetId( SetIdScreen( onBackPressed = onBackPressed, onNextClick = viewModel::onNextClick, + state = state, + onGradeChange = viewModel::setGrade, + onClassRoomChange = viewModel::setClassRoom, + onNumberChange = viewModel::setNumber, ) } @@ -55,6 +68,10 @@ internal fun SetId( private fun SetIdScreen( onBackPressed: () -> Unit, onNextClick: () -> Unit, + state: SetIdState, + onGradeChange: (String) -> Unit, + onClassRoomChange: (String) -> Unit, + onNumberChange: (String) -> Unit, ) { Column( modifier = Modifier @@ -63,9 +80,39 @@ private fun SetIdScreen( ) { DmsLargeTopAppBar( onBackPressed = onBackPressed, - title = "아이디 입력", - description = "아이디를 입력해주세요.", + title = "아이디를 입력해주세요", + description = "DMS에서 사용 할 아이디를 입력해주세요.", ) + Row( + modifier = Modifier + .fillMaxWidth() + .topPadding(PaddingDefaults.ExtraLarge) + .horizontalPadding(), + horizontalArrangement = Arrangement.spacedBy(12.dp), + ) { + DmsTextField( + modifier = Modifier.weight(1f), + value = state.grade, + onValueChange = onGradeChange, + label = "학년", + keyboardType = KeyboardType.Number, + ) + DmsTextField( + modifier = Modifier.weight(1f), + value = state.classroom, + onValueChange = onClassRoomChange, + label = "반", + keyboardType = KeyboardType.Number, + ) + DmsTextField( + modifier = Modifier.weight(1f), + value = state.number, + onValueChange = onNumberChange, + label = "번호", + keyboardType = KeyboardType.Number, + ) + } + Spacer(modifier = Modifier.weight(1f)) DmsButton( modifier = Modifier .fillMaxWidth() diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt index 060c347e..847e6c47 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetIdViewModel.kt @@ -5,6 +5,18 @@ import team.aliens.dms.kmp.core.common.base.BaseViewModel internal class SetIdViewModel : BaseViewModel(SetIdState.getDefaultState()) { + internal fun setGrade(grade: String) { + setState { state.value.copy(grade = grade) } + } + + internal fun setClassRoom(classroom: String) { + setState { state.value.copy(classroom = classroom) } + } + + internal fun setNumber(number: String) { + setState { state.value.copy(number = number) } + } + internal fun onNextClick() { postSideEffect( SetIdSideEffect.MoveToSetPassword( From c1f6fdf9d62d9e64ecc935b5864f791a87a3a71a Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 08:16:23 +0900 Subject: [PATCH 45/61] refactor :: ktlnt --- .../src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt | 1 - .../dms/kmp/core/common/timer/CountDownTimer.android.kt | 2 +- .../aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt | 2 +- .../dms/kmp/core/designsystem/webview/DmsWebView.ios.kt | 2 +- .../core/network/exception/CannotFindIosTermsUrlException.kt | 2 +- .../navigation/EnterSchoolVerificationCodeNavigation.kt | 2 +- .../dms/kmp/feature/signup/navigation/SetIdNavigation.kt | 2 -- .../kmp/feature/signup/navigation/SetPasswordNavigation.kt | 1 - .../dms/kmp/feature/signup/navigation/SignUpNavigation.kt | 1 - .../kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt | 2 +- .../signup/ui/EnterSchoolVerificationQuestionScreen.kt | 4 ++-- .../signup/viewmodel/EnterEmailVerificationCodeViewModel.kt | 2 +- .../dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt | 1 - 13 files changed, 9 insertions(+), 15 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt index 421e393c..bb9c7654 100644 --- a/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt +++ b/composeApp/src/commonMain/kotlin/team/aliens/dms/kmp/DmsNavigator.kt @@ -4,7 +4,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController -import team.aliens.dms.kmp.core.network.PlatformConfig import team.aliens.dms.kmp.feature.signin.navigation.navigateToSignIn import team.aliens.dms.kmp.feature.signup.model.SignUpData import team.aliens.dms.kmp.feature.signup.navigation.navigateToEnterEmail diff --git a/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt b/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt index 715e8cf7..024ad9a0 100644 --- a/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt +++ b/core/common/src/androidMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.android.kt @@ -11,7 +11,7 @@ actual class CountDownTimer { intervalMillis: Long, listener: CountDownTimerListener, ) { - timer = object : CountDownTimer(durationMillis,intervalMillis) { + timer = object : CountDownTimer(durationMillis, intervalMillis) { override fun onTick(millisUntilFinished: Long) { listener.onTick(millisUntilFinished) } diff --git a/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt b/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt index fe784658..eb7bf735 100644 --- a/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt +++ b/core/common/src/iosMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.ios.kt @@ -19,7 +19,7 @@ actual class CountDownTimer { timer = NSTimer.scheduledTimerWithTimeInterval(intervalSeconds, true) { timeLeft -= intervalMillis - if(timeLeft > 0) { + if (timeLeft > 0) { listener.onTick(timeLeft) } else { listener.onFinish() diff --git a/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt index 9e79cdad..7bac32d0 100644 --- a/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt +++ b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt @@ -24,6 +24,6 @@ actual fun DmsWebView( UIKitView( factory = { webView }, - modifier = Modifier.fillMaxSize() + modifier = Modifier.fillMaxSize(), ) } diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt index 3fc2319e..30a07bd9 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt @@ -1,3 +1,3 @@ package team.aliens.dms.kmp.core.network.exception -class CannotFindIosTermsUrlException : IllegalStateException("Cannot find ios termsUrl") +class CannotFindIosTermsUrlException : IllegalStateException("Cannot find ios termsUrl") diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt index a5f6cd5f..2dadc7cc 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterSchoolVerificationCodeNavigation.kt @@ -15,7 +15,7 @@ internal fun NavGraphBuilder.enterSchoolVerificationCode( composable(NAVIGATION_ENTER_SCHOOL_VERIFICATION_CODE) { EnterSchoolVerificationCode( onBackPressed = onBackPressed, - navigateToEnterSchoolVerificationQuestion = navigateToEnterSchoolVerificationQuestion + navigateToEnterSchoolVerificationQuestion = navigateToEnterSchoolVerificationQuestion, ) } } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt index 60bbe847..312bb93e 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetIdNavigation.kt @@ -31,5 +31,3 @@ fun NavGraphBuilder.setId( fun NavController.navigateToSetId(signUpData: SignUpData) { navigate("$NAVIGATION_SET_ID/${signUpData.toJsonString()}") } - - diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt index f0310ac0..67833233 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SetPasswordNavigation.kt @@ -31,4 +31,3 @@ fun NavGraphBuilder.setPassword( fun NavController.navigateToSetPassword(signUpData: SignUpData) { navigate("$NAVIGATION_SET_PASSWORD/${signUpData.toJsonString()}") } - diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt index 159047f7..8be4bce2 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/navigation/SignUpNavigation.kt @@ -65,4 +65,3 @@ internal fun NavBackStackEntry.getSignUpData(): SignUpData { val signUpData = arguments?.getString(ResourceKeys.SIGN_UP) ?: throw NullPointerException() return signUpData.toSignUpData() } - diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt index 50a8a625..132f1dc0 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt @@ -119,7 +119,7 @@ fun VerificationCode( Spacer(modifier = Modifier.height(PaddingDefaults.ExtraLarge)) Row( modifier = Modifier.clickable( - onClick = { } + onClick = { }, ), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp), diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt index 816dcf95..f5f32314 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterSchoolVerificationQuestionScreen.kt @@ -35,7 +35,7 @@ internal fun EnterSchoolVerificationQuestion( LaunchedEffect(Unit) { viewModel.sideEffect.collect { - when(it) { + when (it) { is EnterSchoolVerificationQuestionSideEffect.MoveToEnterEmail -> { navigateToEnterEmail(signUpData.copy(schoolAnswer = it.schoolAnswer)) } @@ -47,7 +47,7 @@ internal fun EnterSchoolVerificationQuestion( onBackPressed = onBackPressed, onNextClick = viewModel::onNextClick, state = state, - onVerificationAnswerChange = viewModel::setSchoolVerificationAnswer + onVerificationAnswerChange = viewModel::setSchoolVerificationAnswer, ) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt index 5c8c8a16..bee3faa3 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/EnterEmailVerificationCodeViewModel.kt @@ -16,7 +16,7 @@ internal class EnterEmailVerificationCodeViewModel : setButtonEnabled() } - private fun setButtonEnabled() = setState{ + private fun setButtonEnabled() = setState { val emailVerificationCode = state.value.emailVerificationCode state.value.copy(buttonEnabled = emailVerificationCode.length == 6) } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt index dbede5ee..9309d068 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/viewmodel/SetPasswordViewModel.kt @@ -3,7 +3,6 @@ package team.aliens.dms.kmp.feature.signup.viewmodel import team.aliens.dms.kmp.core.common.base.BaseViewModel import team.aliens.dms.kmp.core.common.utils.Regex - internal class SetPasswordViewModel : BaseViewModel(SetPasswordState.getDefaultState()) { From 659b22668f9fa7961c7ffe414278e9685a2df630 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 08:17:49 +0900 Subject: [PATCH 46/61] refactor :: ktlint --- .../aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt | 1 - .../kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt b/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt index 0adf6ff6..608830a9 100644 --- a/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt +++ b/core/common/src/jvmMain/kotlin/team/aliens/dms/kmp/core/common/timer/CountDownTimer.jvm.kt @@ -11,5 +11,4 @@ actual class CountDownTimer { actual fun stop() { } - } diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt index 132f1dc0..ed1d1972 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/EnterEmailVerificationCodeScreen.kt @@ -54,6 +54,7 @@ internal fun EnterEmailVerificationCode( } } } + EnterEmailVerificationCodeScreen( onBackPressed = onBackPressed, onNextClick = viewModel::onNextClick, @@ -137,5 +138,3 @@ fun VerificationCode( } } } - - From 76cefd294a74cf2cd06a1cb2667be506342d4d8e Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:40:05 +0900 Subject: [PATCH 47/61] =?UTF-8?q?refactor=20::=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dIosBaseurlException.kt => CannotFindIOSBaseurlException.kt} | 2 +- ...osTermsUrlException.kt => CannotFindIOSTermsUrlException.kt} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/{CannotFindIosBaseurlException.kt => CannotFindIOSBaseurlException.kt} (56%) rename core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/{CannotFindIosTermsUrlException.kt => CannotFindIOSTermsUrlException.kt} (54%) diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosBaseurlException.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSBaseurlException.kt similarity index 56% rename from core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosBaseurlException.kt rename to core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSBaseurlException.kt index 23478918..5cc0997a 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosBaseurlException.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSBaseurlException.kt @@ -1,3 +1,3 @@ package team.aliens.dms.kmp.core.network.exception -internal class CannotFindIosBaseurlException : IllegalStateException("Cannot find ios baseurl") +internal class CannotFindIOSBaseurlException : IllegalStateException("Cannot find ios baseurl") diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSTermsUrlException.kt similarity index 54% rename from core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt rename to core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSTermsUrlException.kt index 30a07bd9..4ddca3f0 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIosTermsUrlException.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/exception/CannotFindIOSTermsUrlException.kt @@ -1,3 +1,3 @@ package team.aliens.dms.kmp.core.network.exception -class CannotFindIosTermsUrlException : IllegalStateException("Cannot find ios termsUrl") +class CannotFindIOSTermsUrlException : IllegalStateException("Cannot find ios termsUrl") From 3706c6916db33190738650256fd8308d079dd83c Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:40:51 +0900 Subject: [PATCH 48/61] =?UTF-8?q?design=20::=20=EC=83=89=EC=83=81=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/commonMain/composeResources/files/error_status.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/design-system/src/commonMain/composeResources/files/error_status.json b/core/design-system/src/commonMain/composeResources/files/error_status.json index e50b2d8c..e3cfa3e9 100644 --- a/core/design-system/src/commonMain/composeResources/files/error_status.json +++ b/core/design-system/src/commonMain/composeResources/files/error_status.json @@ -1 +1 @@ -{"nm":"error","ddd":0,"h":180,"w":180,"meta":{"g":"@lottiefiles/toolkit-js 0.33.2"},"layers":[{"ty":4,"nm":"Shape","sr":1,"st":0,"op":180,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,37,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":10},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[105,105,100],"t":30},{"s":[100,100,100],"t":60}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89.661,126.788,0],"t":10,"ti":[0.11,0,0],"to":[-0.277,0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[88,126.788,0],"t":20,"ti":[0,0,0],"to":[-0.11,0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89,126.788,0],"t":30,"ti":[0,0,0],"to":[0,0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[88,126.788,0],"t":40,"ti":[-0.277,0,0],"to":[0,0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89,126.788,0],"t":50,"ti":[-0.11,0,0],"to":[0.277,0,0]},{"s":[89.661,126.788,0],"t":60}],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":10},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-16],"t":20},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[16],"t":30},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-8],"t":40},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[4],"t":50},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-2],"t":60},{"s":[0],"t":66}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"패스 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0.11],[0,0],[1.88,0],[0,-2.36],[0,0],[-0.11,0],[0,0]],"o":[[0,0],[0,-2.33],[-1.93,0],[0,0],[0.01,0.11],[0,0],[0.11,0]],"v":[[3.205,5.691],[3.705,-12.329],[0.005,-15.929],[-3.705,-12.329],[-3.215,5.691],[-3.015,5.881],[3.005,5.881]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"패스 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,2.25],[-2.44,0],[0,-2.22],[2.43,0]],"o":[[0,-2.25],[2.43,0],[0,2.21],[-2.44,0]],"v":[[-3.887,12.261],[0.003,8.591],[3.883,12.261],[0.003,15.931]]},"ix":2}},{"ty":"mm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Merge","nm":"패스 병합 1","mm":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"ì¹  1","c":{"a":0,"k":[0,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Oval","sr":1,"st":0,"op":180,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[90,90,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Oval","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"타원 패스 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[52,52],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"ì¹  1","c":{"a":0,"k":[1,0.2745,0.2745],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2}],"v":"5.5.1","fr":60,"op":90,"ip":0,"assets":[]} \ No newline at end of file +{"nm":"Main Scene","ddd":0,"h":180,"w":180,"meta":{"g":"@lottiefiles/creator 1.30.0"},"layers":[{"ty":4,"nm":"Shape","sr":1,"st":0,"op":180,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,37,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":10},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[105,105,100],"t":30},{"s":[100,100,100],"t":60}]},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89.661,126.788,0],"t":10},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[88,126.788,0],"t":20},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89,126.788,0],"t":30},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[88,126.788,0],"t":40},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[89,126.788,0],"t":50},{"s":[89.661,126.788,0],"t":60}]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":10},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-16],"t":20},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[16],"t":30},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-8],"t":40},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[4],"t":50},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[-2],"t":60},{"s":[0],"t":66}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"패스 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0.11],[0,0],[1.88,0],[0,-2.36],[0,0],[-0.11,0],[0,0]],"o":[[0,0],[0,-2.33],[-1.93,0],[0,0],[0.01,0.11],[0,0],[0.11,0]],"v":[[3.205,5.691],[3.705,-12.329],[0.005,-15.929],[-3.705,-12.329],[-3.215,5.691],[-3.015,5.881],[3.005,5.881]]}}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"패스 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,2.25],[-2.44,0],[0,-2.22],[2.43,0]],"o":[[0,-2.25],[2.43,0],[0,2.21],[-2.44,0]],"v":[[-3.887,12.261],[0.003,8.591],[3.883,12.261],[0.003,15.931]]}}},{"ty":"mm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Merge","nm":"패스 병합 1","mm":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"ì¹  1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[300,300]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1},{"ty":4,"nm":"Oval","sr":1,"st":0,"op":180,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[90,90]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Oval","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"타원 패스 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[52,52]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"ì¹  1","c":{"a":0,"k":[1,0.2745,0.2745]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[300,300]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":2}],"v":"5.7.0","fr":60,"op":90,"ip":0,"assets":[]} From f79aa35ab7fd034207a41366cce777cc3f677373 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:42:20 +0900 Subject: [PATCH 49/61] =?UTF-8?q?refactor=20::=20description=20optional=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kmp/core/designsystem/status/ErrorStatus.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/status/ErrorStatus.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/status/ErrorStatus.kt index a05a1c4e..3221e593 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/status/ErrorStatus.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/status/ErrorStatus.kt @@ -28,7 +28,7 @@ import team.aliens.dms.kmp.core.designsystem.text.DmsText fun ErrorStatus( modifier: Modifier = Modifier, title: String, - description: String, + description: String? = null, ) { var animation by remember { mutableStateOf("") } @@ -58,10 +58,12 @@ fun ErrorStatus( style = DmsTypography.HeadlineSemiBold, ) Spacer(modifier = Modifier.height(2.dp)) - DmsText( - text = description, - style = DmsTypography.Body2Medium, - color = DmsTheme.colors.onSurface, - ) + description?.let { + DmsText( + text = it, + style = DmsTypography.Body2Medium, + color = DmsTheme.colors.onSurface, + ) + } } } From ddda9d216a04350157b9ee5b7e665c8d17292842 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:42:56 +0900 Subject: [PATCH 50/61] =?UTF-8?q?refactor=20::=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/core/network/PlatformConfig.ios.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt index e098d635..f0ef92bd 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt @@ -1,15 +1,16 @@ package team.aliens.dms.kmp.core.network import platform.Foundation.NSBundle -import team.aliens.dms.kmp.core.network.exception.CannotFindIosBaseurlException -import team.aliens.dms.kmp.core.network.exception.CannotFindIosTermsUrlException +import team.aliens.dms.kmp.core.network.exception.CannotFindIOSBaseurlException +import team.aliens.dms.kmp.core.network.exception.CannotFindIOSTermsUrlException @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual val baseUrl: String = (NSBundle.mainBundle.objectForInfoDictionaryKey("BaseURL") as? String) - ?: throw CannotFindIosBaseurlException() + ?: throw CannotFindIOSBaseurlException() + actual val termsUrl: String = (NSBundle.mainBundle.objectForInfoDictionaryKey("TermsUrl") as? String) - ?: throw CannotFindIosTermsUrlException() + ?: throw CannotFindIOSTermsUrlException() } From 33b93533cf4f0f1b227a2f4ae1428490715aba3f Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:43:21 +0900 Subject: [PATCH 51/61] =?UTF-8?q?feat=20::=20WebViewErrorException=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/webview/exception/WebViewErrorException.kt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/exception/WebViewErrorException.kt diff --git a/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/exception/WebViewErrorException.kt b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/exception/WebViewErrorException.kt new file mode 100644 index 00000000..556c008b --- /dev/null +++ b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/exception/WebViewErrorException.kt @@ -0,0 +1,3 @@ +package team.aliens.dms.kmp.core.designsystem.webview.exception + +class WebViewErrorException(message: String) : Exception(message) From 4996e50a9f870bdeace8d61bb35bc5a73cc79592 Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 16:43:52 +0900 Subject: [PATCH 52/61] =?UTF-8?q?refactor=20::=20webView=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webview/DmsWebView.android.kt | 86 +++++++++++++++++-- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt index 13ce8127..32d8ac48 100644 --- a/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt +++ b/core/design-system/src/androidMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.android.kt @@ -1,11 +1,26 @@ package team.aliens.dms.kmp.core.designsystem.webview +import android.graphics.Bitmap +import android.webkit.WebResourceError +import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.CircularProgressIndicator 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.LocalContext import androidx.compose.ui.viewinterop.AndroidView +import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme +import team.aliens.dms.kmp.core.designsystem.status.ErrorStatus +import team.aliens.dms.kmp.core.designsystem.webview.exception.WebViewErrorException @Composable actual fun DmsWebView( @@ -13,15 +28,68 @@ actual fun DmsWebView( url: String, ) { val context = LocalContext.current + var isLoading by remember { mutableStateOf(true) } + var isError by remember { mutableStateOf(false) } - AndroidView( - factory = { - WebView(context).apply { - webViewClient = WebViewClient() - settings.javaScriptEnabled = true + Box( + modifier = modifier, + contentAlignment = Alignment.Center, + ) { + AndroidView( + factory = { + WebView(context).apply { + webViewClient = object : WebViewClient() { + override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { + super.onPageStarted(view, url, favicon) + isLoading = true + } + + override fun onPageFinished(view: WebView?, url: String?) { + super.onPageFinished(view, url) + isLoading = false + } + + override fun onReceivedError( + view: WebView?, + request: WebResourceRequest?, + error: WebResourceError?, + ) { + super.onReceivedError(view, request, error) + isLoading = false + try { + throw WebViewErrorException("WebView error: ${error?.description}") + } catch (e: Exception) { + e.printStackTrace() + isError = true + } + } + + override fun shouldOverrideUrlLoading( + view: WebView?, + request: WebResourceRequest?, + ): Boolean { + return false + } + } + settings.javaScriptEnabled = true + } + }, + update = { it.loadUrl(url) }, + ) + + if (isLoading) { + CircularProgressIndicator() + } + + if (isError) { + Box( + modifier = Modifier + .fillMaxSize() + .background(DmsTheme.colors.onBackground), + contentAlignment = Alignment.Center, + ) { + ErrorStatus(title = "화면을 불러오지 못했어요.") } - }, - modifier = Modifier.then(modifier), - update = { it.loadUrl(url) }, - ) + } + } } From a96f2f82abea7b03d7939f60c0a15bec9107908a Mon Sep 17 00:00:00 2001 From: uiel Date: Mon, 21 Oct 2024 21:28:44 +0900 Subject: [PATCH 53/61] =?UTF-8?q?refactor=20::=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt index 7eb9ab42..35307c8e 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt @@ -72,7 +72,7 @@ private fun SetPasswordScreen( DmsLargeTopAppBar( onBackPressed = onBackPressed, title = "비밀번호를 입력해주세요", - description = "비밀번호 영문, 숫자, 기호 포함해서 8~20자가\n원칙입니다.", + description = "비밀번호는 영문, 숫자, 기호를 포함한 8~20자로 입력해주세요.", ) DmsTextField( modifier = Modifier @@ -85,7 +85,7 @@ private fun SetPasswordScreen( label = "비밀번호 입력", showVisibleIcon = true, isError = state.showPasswordDescription, - errorDescription = "형식에 맞게 설정해주세요.", + errorDescription = "비밀번호는 영문, 숫자, 기호를 포함한 8~20자로 설정해주세요.", keyboardType = KeyboardType.Password, ) DmsTextField( @@ -99,7 +99,7 @@ private fun SetPasswordScreen( label = "비밀번호 확인", showVisibleIcon = true, isError = state.showCheckPasswordDescription, - errorDescription = "비밀번호를 확인해주세요", + errorDescription = "비밀번호가 일치하지 않습니다. 다시 입력해주세요.", keyboardType = KeyboardType.Password, ) Spacer(modifier = Modifier.weight(1f)) From f62d6b069801ec70ad76b071d5cee4394e9b71d4 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:05:31 +0900 Subject: [PATCH 54/61] =?UTF-8?q?refactor=20::=20iOS=20webView=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/webview/DmsWebView.ios.kt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt index 7bac32d0..a5b34131 100644 --- a/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt +++ b/core/design-system/src/iosMain/kotlin/team/aliens/dms/kmp/core/designsystem/webview/DmsWebView.ios.kt @@ -1,8 +1,10 @@ package team.aliens.dms.kmp.core.designsystem.webview +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.viewinterop.UIKitView import platform.Foundation.NSMutableURLRequest @@ -17,13 +19,18 @@ actual fun DmsWebView( val webView = remember { WKWebView() } val request = NSMutableURLRequest.requestWithURL(URL = NSURL(string = url)) - webView.apply { - loadRequest(request) - allowsBackForwardNavigationGestures = true + Box( + modifier = modifier, + contentAlignment = Alignment.Center, + ) { + UIKitView( + factory = { + webView.apply { + allowsBackForwardNavigationGestures = true + } + }, + modifier = Modifier.fillMaxSize(), + ) + webView.loadRequest(request) } - - UIKitView( - factory = { webView }, - modifier = Modifier.fillMaxSize(), - ) } From 23be63209999eb687210514083ff66a17d9237e2 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:05:45 +0900 Subject: [PATCH 55/61] =?UTF-8?q?refactor=20::=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aliens/dms/kmp/feature/signup/ui/TermsScreen.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt index 288a7d97..1e2bf121 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt @@ -126,16 +126,18 @@ private fun AllAgreeButton( .fillMaxWidth() .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding() + .background( + color = backGround, + shape = RoundedCornerShape(8.dp), + ) .clickable( + interactionSource = null, + indication = null, onClick = { isCheck = !isCheck onAllAgreeButtonClick(isCheck) }, ) - .background( - color = backGround, - shape = RoundedCornerShape(8.dp), - ) .padding(PaddingDefaults.Large), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp), From 67566eca1584bd0c2d988d0e4625aff7fd4cadca Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:07:48 +0900 Subject: [PATCH 56/61] =?UTF-8?q?refactor=20::=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt index 35307c8e..b1bafd84 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/SetPasswordScreen.kt @@ -85,7 +85,7 @@ private fun SetPasswordScreen( label = "비밀번호 입력", showVisibleIcon = true, isError = state.showPasswordDescription, - errorDescription = "비밀번호는 영문, 숫자, 기호를 포함한 8~20자로 설정해주세요.", + errorDescription = "영문, 숫자, 기호를 포함한 8~20자로 설정해주세요.", keyboardType = KeyboardType.Password, ) DmsTextField( From 9e17145b2212cbe48247654b97d66ca018f94cb7 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:08:13 +0900 Subject: [PATCH 57/61] =?UTF-8?q?refactor=20::=20=ED=82=A4=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt index f0ef92bd..7ce73f67 100644 --- a/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt +++ b/core/network/src/iosMain/kotlin/team/aliens/dms/kmp/core/network/PlatformConfig.ios.kt @@ -7,10 +7,10 @@ import team.aliens.dms.kmp.core.network.exception.CannotFindIOSTermsUrlException @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual val baseUrl: String = - (NSBundle.mainBundle.objectForInfoDictionaryKey("BaseURL") as? String) + (NSBundle.mainBundle.objectForInfoDictionaryKey("DEV_BASE_URL") as? String) ?: throw CannotFindIOSBaseurlException() actual val termsUrl: String = - (NSBundle.mainBundle.objectForInfoDictionaryKey("TermsUrl") as? String) + (NSBundle.mainBundle.objectForInfoDictionaryKey("TERMS_URL") as? String) ?: throw CannotFindIOSTermsUrlException() } From f55c0269a2989fbda4fd38b7b240597ab6da3218 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:21:09 +0900 Subject: [PATCH 58/61] =?UTF-8?q?refactor=20::=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EB=AA=A8=EC=96=91=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dms/kmp/core/designsystem/button/DmsButton.kt | 7 +++---- .../kmp/core/designsystem/button/DmsOutlineButton.kt | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt index 96ebb33c..fe1dc3bc 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsButton.kt @@ -12,6 +12,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme @@ -38,10 +39,8 @@ private fun BasicButton( Box( modifier = modifier - .background( - shape = RoundedCornerShape(8.dp), - color = backgroundColor, - ) + .clip(shape = RoundedCornerShape(8.dp)) + .background(color = backgroundColor) .clickable( onClick = onClick, enabled = enabled, diff --git a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsOutlineButton.kt b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsOutlineButton.kt index f338252a..7e22b4f1 100644 --- a/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsOutlineButton.kt +++ b/core/design-system/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/button/DmsOutlineButton.kt @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.unit.dp @@ -42,12 +43,13 @@ private fun BasicOutlineButton( Box( modifier = modifier - .background( - color = backgroundColor, - ) .border( - border = border, shape = shape, + border = border, + ) + .clip(shape) + .background( + color = backgroundColor, ) .clickable( onClick = onClick, From acafcca2d30096e6439316390aa46e0a9aa58533 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 17:23:28 +0900 Subject: [PATCH 59/61] chore :: gradle setting --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 93239c3a..e3ad6415 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ kotlin.code.style=official #Gradle -org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2g" #Android android.nonTransitiveRClass=true From 54996a50353c3e554fa295a178b90f5b24bec8bf Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 18:01:48 +0900 Subject: [PATCH 60/61] chore :: gradle setting --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e3ad6415..93239c3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ kotlin.code.style=official #Gradle -org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2g" +org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" #Android android.nonTransitiveRClass=true From 1fab90d3c3abbcddace6c85613a30290b609db33 Mon Sep 17 00:00:00 2001 From: uiel Date: Tue, 22 Oct 2024 18:15:27 +0900 Subject: [PATCH 61/61] =?UTF-8?q?refactor=20::=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt index 1e2bf121..e7754aa2 100644 --- a/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt +++ b/feature/signup/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/ui/TermsScreen.kt @@ -111,7 +111,7 @@ private fun AllAgreeButton( onAllAgreeButtonClick: (Boolean) -> Unit, ) { var isCheck by remember { mutableStateOf(buttonEnabled) } - val backGround = if (isCheck) { + val background = if (isCheck) { DmsTheme.colors.onSecondary } else { DmsTheme.colors.onBackground @@ -127,7 +127,7 @@ private fun AllAgreeButton( .topPadding(PaddingDefaults.ExtraLarge) .horizontalPadding() .background( - color = backGround, + color = background, shape = RoundedCornerShape(8.dp), ) .clickable(