Skip to content

Commit

Permalink
[WEAV-140] 프로필 탭 뷰 갱신
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim committed Nov 24, 2024
1 parent 597e768 commit 23725f1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Projects/Features/Home/Sources/Profile/ProfileIntent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ extension ProfileIntent: ProfileIntent.Intentable {
}

func onAppear() {
fetchUserInfo(input.userInfo)
Task {
await refreshUserInfo()
}
}

func refreshUserInfo() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ProfilePannelIntent {
extension ProfilePannelIntent {
protocol Intentable {
// content
func onTapEditJobOccupationIcon()
func onTapNextButton()

// default
Expand All @@ -54,5 +55,20 @@ extension ProfilePannelIntent: ProfilePannelIntent.Intentable {
func task() async {}

// content
func onTapEditJobOccupationIcon() {
Task {
await MainActor.run {
if let userInfo = AppCoordinator.shared.userInfo {
AppCoordinator.shared.push(
.editProfile(
.jobOccupation(
userInfo
)
)
)
}
}
}
}
func onTapNextButton() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ public struct ProfilePannelView: View {
icon: DesignCore.Images.businessFill.image,
key: "직군",
value: state.profile?.jobOccupation ?? "-",
textColor: Color(hex: 0x5B6654)
)
textColor: Color(hex: 0x5B6654),
showEditIcon: true
) {
intent.onTapEditJobOccupationIcon()
}
}

innerRoundBoxView(
Expand All @@ -93,7 +96,8 @@ public struct ProfilePannelView: View {
icon: DesignCore.Images.buildingFill.image,
key: "직장",
value: state.profile?.companyName ?? "",
textColor: Color(hex: 0x846470)
textColor: Color(hex: 0x846470),
showEditIcon: true
)
}

Expand All @@ -107,7 +111,8 @@ public struct ProfilePannelView: View {
icon: DesignCore.Images.locationFill.image,
key: "활동 지역",
value: nil,
textColor: Color(hex: 0x606D8F)
textColor: Color(hex: 0x606D8F),
showEditIcon: true
)
let tagModels: [TagModel] = profile.locations
.map {
Expand Down Expand Up @@ -176,7 +181,9 @@ public struct ProfilePannelView: View {
icon: Image,
key: String,
value: String?,
textColor: Color
textColor: Color,
showEditIcon: Bool,
editHandler: (() -> Void)? = nil
) -> some View {
HStack(spacing: 6) {
icon
Expand All @@ -191,6 +198,15 @@ public struct ProfilePannelView: View {
.typography(.medium_16)
.multilineTextAlignment(.trailing)
}
if showEditIcon {
DesignCore.Images.pencil1.image
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 18, height: 18)
.onTapGesture {
editHandler?()
}
}
}
.foregroundStyle(textColor)
}
Expand Down

0 comments on commit 23725f1

Please sign in to comment.