Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/#145] 자기소개 작성 후 마이페이지 유저 데이터 업데이트 구현 #147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension MyPageFeature {
@Dependency(\.profileClient) var profileClient
let reducer = Reduce<State, Action> { state, action in
switch action {
case .onAppear:
case .onLoad:
state.isShowLoadingProgressView = true
return .run { send in
let userProfile = try await profileClient.fetchUserProfile()
Expand Down Expand Up @@ -102,7 +102,13 @@ extension MyPageFeature {
return .none
case let .selectedTabDidChanged(selectedTap):
return .send(.delegate(.selectedTabDidChanged(selectedTap)))
case .binding, .delegate, .destination, .alert:

case .userProfileUpdateDidRequest:
return .run { send in
let userProfile = try await profileClient.fetchUserProfile()
await send(.userProfileDidFetched(userProfile))
}
default:
return .none
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public struct MyPageFeature {

public enum Action: BindableAction {
// View Life Cycle
case onAppear
case onLoad
case userProfileDidFetched(UserProfile)

case userProfileUpdateDidRequest
case logOutButtonDidTapped
case logOutDidCompleted
case withdrawalButtonDidTapped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public struct MyPageView: View {
.setTabBar(selectedTab: .myPage) { selectedTab in
store.send(.selectedTabDidChanged(selectedTab))
}
.onAppear {
store.send(.onAppear)
.onLoad {
store.send(.onLoad)
}
.overlay {
if store.isShowLoadingProgressView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public struct SandBeachRootFeature {
public enum Delegate {
case goToBottleStorageRequest
case selectedTabDidChanged(selectedTab: TabType)
case profileSetUpDidCompleted
}
}

Expand Down Expand Up @@ -142,7 +143,7 @@ extension SandBeachRootFeature {

case .profileSetupDidCompleted:
state.path.removeAll()
return .none
return .send(.delegate(.profileSetUpDidCompleted))

case let .selectedTabDidChanged(selectedTab):
return .send(.delegate(.selectedTabDidChanged(selectedTab: selectedTab)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extension SandBeachFeature {
}

case let .userStateFetchCompleted(userState, isDisableButton):
state.userState = .noIntroduction
state.userState = userState
state.isDisableIslandBottle = isDisableButton
state.isLoading = false
return .none
Expand Down
2 changes: 2 additions & 0 deletions Projects/Feature/Sources/TabView/MainTabViewFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public struct MainTabViewFeature {
state.selectedTab = .bottleStorage
case let .selectedTabDidChanged(selectedTab):
state.selectedTab = selectedTab
case .profileSetUpDidCompleted:
return .send(.myPage(.userProfileUpdateDidRequest))
}
return .none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ private struct TabBarModifier: ViewModifier {
// TODO: - DesignSystem -> 디자인들 Contants 관리
.frame(height: 106)
.background {
RoundedRectangle(cornerRadius: BottleRadiusType.xl.value)
RoundedRectangle(cornerRadius: 0)
.fill(ColorToken.background(.secondary).color)
.cornerRadius(.xl, corenrs: [.topLeft, .topRight])
}
}
}
Expand Down