-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#299] 영어 버전 기능 분기 처리를 진행합니다. #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d1a17aa
[FEAT/#299] 한국어 typo, 영어 typo를 정의합니다.
SYAAINN dbe356d
[FEAT/#299] LanguageProvider 클래스 구현
SYAAINN b21319f
[FEAT/#299] 영어 버전일 경우, 구글 로그인 버튼을 노출합니다.
SYAAINN bc017da
[FEAT/#299] 웹뷰 링크를 분기처리 합니다.
SYAAINN c65fc30
[FEAT/#299] 닉네임 최대 길이를 영어 버전 15자, 한국어 버전 10자로 설정합니다.
SYAAINN 8fc9d6f
[FEAT/#299] 일기 하나의 최대 길이를 영어 버전 100자, 한국어 버전 50자로 설정합니다.
SYAAINN ac6664c
[CHORE/#299] 코드래빗 리뷰사항을 반영합니다.
SYAAINN c28221c
[CHORE/#299] 코드리뷰 사항을 반영합니다.
SYAAINN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/sopt/clody/presentation/di/LanguageModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.sopt.clody.presentation.di | ||
|
|
||
| import com.sopt.clody.presentation.utils.language.LanguageProvider | ||
| import com.sopt.clody.presentation.utils.language.LanguageProviderImpl | ||
| import dagger.Binds | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| interface LanguageModule { | ||
|
|
||
| @Binds | ||
| fun bindLanguageProvider( | ||
| languageProviderImpl: LanguageProviderImpl, | ||
| ): LanguageProvider | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/sopt/clody/presentation/ui/login/LoginType.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.sopt.clody.presentation.ui.login | ||
|
|
||
| enum class LoginType { | ||
| KAKAO, GOOGLE | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Optimize validation logic to avoid redundant operations.
The current implementation has two issues:
setStatecall on line 177 is redundant sincesetNicknameMaxLength()is already called during initializationApply this diff to improve performance:
private fun validateNickname(nickname: String): Boolean { - val state = withState(this@SignUpViewModel) { it } - setState { copy(nicknameMaxLength = languageProvider.getNicknameMaxLength()) } - val regex = "^[a-zA-Z가-힣0-9ㄱ-ㅎㅏ-ㅣ가-힣]{2,${state.nicknameMaxLength}$".toRegex() + val state = withState(this@SignUpViewModel) { it } + val regex = "^[a-zA-Z가-힣0-9ㄱ-ㅎㅏ-ㅣ가-힣]{2,${state.nicknameMaxLength}}$".toRegex() return nickname.matches(regex) }Consider caching the regex pattern or moving validation logic to a separate class for better performance and testability.
📝 Committable suggestion
🤖 Prompt for AI Agents