-
Notifications
You must be signed in to change notification settings - Fork 1
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
[UI/#159][FEAT/#160] mypage / 전체 로직 구현 #188
Changes from 35 commits
f0db544
0ad39a5
e43939e
6f7b50b
7f683a4
7091184
2b33c6d
915f963
58a1956
fd1e327
24b0aca
ecdcd2b
0b8842b
03ce36e
041dd79
6219ded
0e4b5c0
5e57297
9db6086
914f041
ed674c4
24e5703
9435ef6
b0cf29f
bd73f98
d7d51fd
3a0fc7d
79c32aa
e1ba04e
843ca46
1c61c80
261633a
d9b89f6
c26a3a0
0e0af95
5e69823
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="#000000" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
|
||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M7,3H4v3H2V1h5V3zM22,6V1h-5v2h3v3H22zM7,21H4v-3H2v5h5V21zM20,18v3h-3v2h5v-5H20zM17,6H7v12h10V6zM19,18c0,1.1 -0.9,2 -2,2H7c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2h10c1.1,0 2,0.9 2,2V18zM15,8H9v2h6V8zM15,11H9v2h6V11zM15,14H9v2h6V14z" /> | ||
|
||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="#000000" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
|
||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M15.18,10.94c0.2,-0.44 0.32,-0.92 0.32,-1.44C15.5,7.57 13.93,6 12,6c-0.52,0 -1,0.12 -1.44,0.32L15.18,10.94z" /> | ||
|
||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-1.85 0.63,-3.55 1.69,-4.9l2.86,2.86c0.21,1.56 1.43,2.79 2.99,2.99l2.2,2.2C13.17,15.05 12.59,15 12,15c-2.32,0 -4.45,0.8 -6.14,2.12C4.7,15.73 4,13.95 4,12zM12,20c-1.74,0 -3.34,-0.56 -4.65,-1.5C8.66,17.56 10.26,17 12,17s3.34,0.56 4.65,1.5C15.34,19.44 13.74,20 12,20zM18.31,16.9L7.1,5.69C8.45,4.63 10.15,4 12,4c4.42,0 8,3.58 8,8C20,13.85 19.37,15.54 18.31,16.9z" /> | ||
|
||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.boostcamp.mapisode.navigation | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
sealed interface MypageRoute : Route { | ||
@Serializable | ||
data object ProfileEdit : MypageRoute | ||
} | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 별도로 Route 정의한게 이미 있습니다. 왜 만드신거죠? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 프로필을 변경하는 화면으로 가는 route가 필요해서 뚫었습니다. 다른 좋은 방법이 있나요??? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,23 @@ class UserRepositoryImpl @Inject constructor(database: FirebaseFirestore) : User | |
throw Exception("Failed to get user", e) | ||
} | ||
} | ||
|
||
override suspend fun updateUserNameAndProfileUrl( | ||
uid: String, | ||
userName: String, | ||
profileUrl: String, | ||
) { | ||
val userDocument = userCollection.document(uid) | ||
|
||
try { | ||
userDocument.update( | ||
mapOf( | ||
"name" to userName, | ||
"profileUrl" to profileUrl, | ||
), | ||
).await() | ||
} catch (e: Exception) { | ||
throw Exception("Failed to update user", e) | ||
} | ||
} | ||
Comment on lines
+59
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기랑 createUser 함수 다시보니까 firebase storage에 저장/덮어씌우기 하는 코드가 안보이네요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 감사합니다 ㅠㅠ |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,20 @@ class AuthViewModel @Inject constructor( | |
|
||
override fun onIntent(intent: AuthIntent) { | ||
when (intent) { | ||
is AuthIntent.Init -> onInit() | ||
is AuthIntent.OnGoogleSignInClick -> handleGoogleSignIn(intent.googleOauth) | ||
is AuthIntent.OnNicknameChange -> onNicknameChange(intent.nickname) | ||
is AuthIntent.OnProfileUrlchange -> onProfileUrlChange(intent.profileUrl) | ||
is AuthIntent.OnSignUpClick -> handleSignUp() | ||
is AuthIntent.OnAutoLogin -> handleAutoLogin() | ||
is AuthIntent.OnLoginSuccess -> handleLoginSuccess() | ||
is AuthIntent.OnBackClickedInSignUp -> onBackClickedInSignUp() | ||
} | ||
} | ||
|
||
private fun onInit() { | ||
handleAutoLogin() | ||
} | ||
Comment on lines
+37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 함수를 호출하는 함수? 필요없지 않나요..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그러게요 ㅋㅋㅋㅋㅋ |
||
|
||
private fun onBackClickedInSignUp() { | ||
intent { | ||
copy( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties | ||
|
||
plugins { | ||
alias(libs.plugins.mapisode.feature) | ||
} | ||
|
||
android { | ||
namespace = "com.boostcamp.mapisode.mypage" | ||
|
||
defaultConfig { | ||
val privacyPolicy = | ||
gradleLocalProperties(rootDir, providers).getProperty("PRIVACY_POLICY") ?: "" | ||
if (privacyPolicy.isEmpty()) { | ||
throw GradleException("PRIVACY_POLICY is not set.") | ||
} | ||
buildConfigField("String", "PRIVACY_POLICY", "\"$privacyPolicy\"") | ||
} | ||
|
||
buildFeatures { | ||
buildConfig = true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.bundles.coil) | ||
implementation(libs.androidx.browser) | ||
implementation(projects.core.auth) | ||
implementation(projects.domain.user) | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.boostcamp.mapisode.mypage.intent | ||
|
||
import android.content.Context | ||
import com.boostcamp.mapisode.auth.GoogleOauth | ||
import com.boostcamp.mapisode.ui.base.UiIntent | ||
|
||
sealed interface MypageIntent : UiIntent { | ||
data object Init : MypageIntent | ||
data class LogoutClick(val googleOauth: GoogleOauth) : MypageIntent | ||
data object ProfileEditClick : MypageIntent | ||
data class PrivacyPolicyClick(val context: Context, val useCustomTab: Boolean) : MypageIntent | ||
data object WithdrawalClick : MypageIntent | ||
data class ConfirmClick(val googleOauth: GoogleOauth) : MypageIntent | ||
data object TurnOffDialog : MypageIntent | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.boostcamp.mapisode.mypage.intent | ||
|
||
import com.boostcamp.mapisode.ui.base.UiIntent | ||
|
||
sealed interface ProfileEditIntent : UiIntent { | ||
data object Init : ProfileEditIntent | ||
data class NameChanged(val nickname: String) : ProfileEditIntent | ||
data class ProfileChanged(val url: String) : ProfileEditIntent | ||
data object PhotopickerClick : ProfileEditIntent | ||
data object EditClick : ProfileEditIntent | ||
data object BackClick : ProfileEditIntent | ||
} |
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.
local properties 추가 하셨나보네요!!
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.
넵 ㅎㅎ
태희님의 추천으로 local properties에 추가했습니다.