Skip to content

Commit

Permalink
✨[feat]: 이미지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy-wonji committed Nov 21, 2023
1 parent bdd6f84 commit 08436d6
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ struct ChangeNickNameView: View {


}
.task {
viewModel.changeNickName = ""
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public struct ProfileView: View {
.task {
authViewModel.searchUserIdRequest(uid: "\(authViewModel.userid)")

profileViewModel.chnageImage()
if profileViewModel.randomNickName == "" {
await profileViewModel.randomNameRequest(commCdTpCd: .userDesc)
}
Expand Down Expand Up @@ -94,7 +95,8 @@ public struct ProfileView: View {
profileViewModel.changeNickNameSuccessPOPUP.toggle()
}
}
.presentationDetents([UIScreen.main.bounds.height.native == 667 ? .height(UIScreen.screenHeight/2 + UIScreen.screenWidth*0.2) : .height(UIScreen.screenHeight/3 + UIScreen.screenWidth*0.2)])
.ignoresSafeArea(.keyboard)
.presentationDetents([UIScreen.main.bounds.height.native == 667 ? .height(UIScreen.screenHeight/2 + UIScreen.screenWidth*0.7) : .height(UIScreen.screenHeight/3 + UIScreen.screenWidth*0.7)])
.presentationCornerRadius(20)
})

Expand Down Expand Up @@ -161,6 +163,12 @@ public struct ProfileView: View {
Circle()
.frame(width: 57, height: 57)
.foregroundColor(.sweetFilter)
.overlay {
Image(assetName: profileViewModel.changeNickImage)
.resizable()
.scaledToFit()
.frame(width: 57, height: 57)
}

Spacer()
.frame(width: 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class ProfileViewViewModel: ObservableObject {
@Published var selectWithDrawPOPUP: Bool = false
@Published var changeNickNameView: Bool = false
@Published var changeNickNameSuccessPOPUP: Bool = false
@Published public var changeNickName: String = " "
@Published public var changeNickName: String = ""
@Published public var changeNickImage: String = ""

@AppStorage("selectedChangeTimeView") public var selectedChangeTimeView: Bool = false
@AppStorage("saveDate") public var saveDate: String = ""
Expand Down Expand Up @@ -149,6 +150,24 @@ public class ProfileViewViewModel: ObservableObject {
})
}

public func chnageImage() {
switch self.randomNickName {
case "바삭바삭 명언제과":
changeNickImage = "crunchyNickname"
case "포근포근 명언베이커리":
changeNickImage = "cozyNickName"
case "퐁실퐁실 명언빵집":
changeNickImage = "pomsilNickname"
case "모락모락 명언빵공장":
changeNickImage = "morakNickname"
case "보들보들 명언제빵소":
changeNickImage = "softNickName"

default:
break
}
}

public func commCodeToViewModel(_ list: CommonCdModel) {
self.commonCodeModel = list
}
Expand Down

0 comments on commit 08436d6

Please sign in to comment.