diff --git a/Honzapda.xcodeproj/project.pbxproj b/Honzapda.xcodeproj/project.pbxproj index f7816c9..9dee69d 100644 --- a/Honzapda.xcodeproj/project.pbxproj +++ b/Honzapda.xcodeproj/project.pbxproj @@ -10,6 +10,10 @@ 05154A332BF1E82200482832 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 05154A322BF1E82200482832 /* Alamofire */; }; 05154A362BF1E84500482832 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 05154A352BF1E84500482832 /* Kingfisher */; }; 052A3B932C038979008EBE2A /* AddUserInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 052A3B922C038979008EBE2A /* AddUserInfoView.swift */; }; + 05372C432C0CA9CF0031B536 /* UserViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05372C3E2C0CA9CF0031B536 /* UserViewModel.swift */; }; + 05372C442C0CA9CF0031B536 /* UserCafeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05372C402C0CA9CF0031B536 /* UserCafeView.swift */; }; + 05372C452C0CA9CF0031B536 /* HelpMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05372C412C0CA9CF0031B536 /* HelpMessageView.swift */; }; + 05372C462C0CA9CF0031B536 /* LogoutAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05372C422C0CA9CF0031B536 /* LogoutAlertView.swift */; }; 056A23A12BEA028D00971D34 /* DetailPageMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 056A23932BEA028D00971D34 /* DetailPageMainView.swift */; }; 056A23A22BEA028D00971D34 /* MoreHelpfulInformationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 056A23942BEA028D00971D34 /* MoreHelpfulInformationView.swift */; }; 056A23A32BEA028D00971D34 /* MoreReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 056A23952BEA028D00971D34 /* MoreReviewView.swift */; }; @@ -87,6 +91,10 @@ /* Begin PBXFileReference section */ 052A3B922C038979008EBE2A /* AddUserInfoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddUserInfoView.swift; sourceTree = ""; }; + 05372C3E2C0CA9CF0031B536 /* UserViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserViewModel.swift; sourceTree = ""; }; + 05372C402C0CA9CF0031B536 /* UserCafeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserCafeView.swift; sourceTree = ""; }; + 05372C412C0CA9CF0031B536 /* HelpMessageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HelpMessageView.swift; sourceTree = ""; }; + 05372C422C0CA9CF0031B536 /* LogoutAlertView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogoutAlertView.swift; sourceTree = ""; }; 056A23932BEA028D00971D34 /* DetailPageMainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailPageMainView.swift; sourceTree = ""; }; 056A23942BEA028D00971D34 /* MoreHelpfulInformationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreHelpfulInformationView.swift; sourceTree = ""; }; 056A23952BEA028D00971D34 /* MoreReviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreReviewView.swift; sourceTree = ""; }; @@ -178,6 +186,24 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 05372C3D2C0CA9CF0031B536 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 05372C3E2C0CA9CF0031B536 /* UserViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + 05372C3F2C0CA9CF0031B536 /* View */ = { + isa = PBXGroup; + children = ( + 05372C402C0CA9CF0031B536 /* UserCafeView.swift */, + 05372C412C0CA9CF0031B536 /* HelpMessageView.swift */, + 05372C422C0CA9CF0031B536 /* LogoutAlertView.swift */, + ); + path = View; + sourceTree = ""; + }; 056A23922BEA028D00971D34 /* Model */ = { isa = PBXGroup; children = ( @@ -455,6 +481,8 @@ DD0FF2312B8ED8A60061F9DB /* User */ = { isa = PBXGroup; children = ( + 05372C3F2C0CA9CF0031B536 /* View */, + 05372C3D2C0CA9CF0031B536 /* ViewModel */, DD0FF2322B8ED8A60061F9DB /* User.swift */, ); path = User; @@ -723,6 +751,7 @@ files = ( 056A23A72BEA028D00971D34 /* UsersHelpfulInformationBoxView.swift in Sources */, 05C548232BEB4A9B00893ADC /* Gray02Box.swift in Sources */, + 05372C442C0CA9CF0031B536 /* UserCafeView.swift in Sources */, DD0045282BA07EA1008C66C9 /* Font+.swift in Sources */, BBEBECA02BC29E28003F9BF8 /* CurationViewModel.swift in Sources */, 05C548272BEB735D00893ADC /* CustomTextEdiotor.swift in Sources */, @@ -740,6 +769,7 @@ BBEBECFC2BE9FF21003F9BF8 /* SearchMainView.swift in Sources */, 056A23A82BEA028D00971D34 /* UsersHelpfulInformationUnderbarView.swift in Sources */, DD4BD92E2BA0123700D94748 /* View+.swift in Sources */, + 05372C432C0CA9CF0031B536 /* UserViewModel.swift in Sources */, 056A23A12BEA028D00971D34 /* DetailPageMainView.swift in Sources */, DD0FF2202B8ED7F80061F9DB /* HomeEntity.swift in Sources */, DDBBD8F82B9068DD00FC2973 /* OnboardingView.swift in Sources */, @@ -756,8 +786,10 @@ BBEBEC9E2BC29E28003F9BF8 /* CurationTestView.swift in Sources */, 05C548252BEB63BE00893ADC /* AddReviewView.swift in Sources */, DD0FF2392B8ED8A60061F9DB /* User.swift in Sources */, + 05372C462C0CA9CF0031B536 /* LogoutAlertView.swift in Sources */, DD652CFF2B8A2FBE00542337 /* ContentView.swift in Sources */, 056A23A52BEA028D00971D34 /* InfoBoxView.swift in Sources */, + 05372C452C0CA9CF0031B536 /* HelpMessageView.swift in Sources */, 056A23A42BEA028D00971D34 /* DividerBoxView.swift in Sources */, DDFA80612B9863CF00FF32C6 /* AppleLoginButtonView.swift in Sources */, DD00452A2BA0867B008C66C9 /* OnboardingCardModel.swift in Sources */, diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/Contents.json new file mode 100644 index 0000000..3f25b34 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "cafe1.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/cafe1.png b/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/cafe1.png new file mode 100644 index 0000000..2c4193f Binary files /dev/null and b/Honzapda/Global/Resources/Assets.xcassets/User/cafe1.imageset/cafe1.png differ diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/Contents.json new file mode 100644 index 0000000..42095e0 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "icon_my_heart_fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/icon_my_heart_fill.svg b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/icon_my_heart_fill.svg new file mode 100644 index 0000000..753a7bf --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_fill.imageset/icon_my_heart_fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/Contents.json new file mode 100644 index 0000000..f171cc4 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "icon_my_heart_none.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/icon_my_heart_none.svg b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/icon_my_heart_none.svg new file mode 100644 index 0000000..4fdabde --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_heart_none.imageset/icon_my_heart_none.svg @@ -0,0 +1,3 @@ + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/Contents.json new file mode 100644 index 0000000..bc4a42b --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "icon_my_plus_fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/icon_my_plus_fill.svg b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/icon_my_plus_fill.svg new file mode 100644 index 0000000..08e3c8e --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/icon_my_plus_fill.imageset/icon_my_plus_fill.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/Contents.json new file mode 100644 index 0000000..6896a76 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_cafetaste_toastmessage.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/image_cafetaste_toastmessage.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/image_cafetaste_toastmessage.svg new file mode 100644 index 0000000..effcc2f --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_cafetaste_toastmessage.imageset/image_cafetaste_toastmessage.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/Contents.json new file mode 100644 index 0000000..afa2673 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_my_bored.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/image_my_bored.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/image_my_bored.svg new file mode 100644 index 0000000..b683ce4 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_bored.imageset/image_my_bored.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/Contents.json new file mode 100644 index 0000000..497eddd --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_my_logout_toastmessage.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/image_my_logout_toastmessage.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/image_my_logout_toastmessage.svg new file mode 100644 index 0000000..7731fc4 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_logout_toastmessage.imageset/image_my_logout_toastmessage.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/Contents.json new file mode 100644 index 0000000..63e4b36 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_my_profile_none.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/image_my_profile_none.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/image_my_profile_none.svg new file mode 100644 index 0000000..7a36147 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_none.imageset/image_my_profile_none.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/Contents.json new file mode 100644 index 0000000..805a7e1 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_my_profile_toastmessage.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/image_my_profile_toastmessage.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/image_my_profile_toastmessage.svg new file mode 100644 index 0000000..a4e5437 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_profile_toastmessage.imageset/image_my_profile_toastmessage.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/Contents.json new file mode 100644 index 0000000..2a6cba6 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_my_toastmessage_error.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/image_my_toastmessage_error.svg b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/image_my_toastmessage_error.svg new file mode 100644 index 0000000..65ddcf6 --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/image_my_toastmessage_error.imageset/image_my_toastmessage_error.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/Contents.json b/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/Contents.json new file mode 100644 index 0000000..270ec1b --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "logo_navigationbar.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/logo_navigationbar.svg b/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/logo_navigationbar.svg new file mode 100644 index 0000000..a253a4a --- /dev/null +++ b/Honzapda/Global/Resources/Assets.xcassets/User/logo_navigationbar.imageset/logo_navigationbar.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Honzapda/Presentation/User/View/HelpMessageView.swift b/Honzapda/Presentation/User/View/HelpMessageView.swift new file mode 100644 index 0000000..ffdf059 --- /dev/null +++ b/Honzapda/Presentation/User/View/HelpMessageView.swift @@ -0,0 +1,90 @@ +// +// HelpMessageView.swift +// Honzapda +// +// Created by 황주연 on 3/9/24. +// + +import SwiftUI + +// MARK: - 도움말 뷰 +struct HelpMessageView: View { + @Environment(\.dismiss) var dismiss + + var backButton: some View { // 뒤로가기 버튼 + Button { + dismiss() + } label: { + HStack { + Image(systemName: "chevron.left") + .aspectRatio(contentMode: .fit) + .foregroundColor(.black) + } + } + } //: 뒤로가기 버튼 + + // MARK: BODY + var body: some View { + VStack { // 뒤로가기 버튼 + Spacer() + HStack { + backButton.padding(EdgeInsets(top: 0, + leading: 16, + bottom: 5, + trailing: 0) + ) + Spacer() + } + } //: 뒤로가기 버튼 + .frame(height: 35) + + VStack { + HelpMessageCardView() // 도움말 카드 뷰 + .padding(.top, 24) + Spacer() + } + .frame(maxHeight: .infinity) + .background(.gray01) + .navigationBarBackButtonHidden(true) + } //: BODY +} + +// MARK: - 도움말 카드 뷰 +struct HelpMessageCardView: View { + // MARK: BODY + var body: some View { + VStack { + VStack(alignment: .leading, spacing: 18) { + VStack(alignment: .leading) { // 도움말 내용 + Text("Q. 혼잡도를 어떻게 보나요?") + .foregroundColor(.primary06) + .font(.sCoreDream(.extrabold, size: 16)) + .padding(.bottom, 10) + + Text("리뷰 창, 정보 제공 창, 그리고 홈에서 위치마커를 눌렀을 시 나오는 가게 창과 검색 기능의 일반 가게 창에서도 확인 가능합니다.") + .font(.sCoreDream(.medium, size: 12)) + .foregroundColor(.gray08) + .lineSpacing(10) + .lineLimit(nil) + } //: 도움말 내용 + .padding(24) + } + .background(.white) + .cornerRadius(16) + .shadow(radius: 1) + } + .padding(EdgeInsets(top: 0, + leading: 16, + bottom: 24, + trailing: 16) + ) + } +} + +#Preview { + HelpMessageView() +} + +#Preview { + HelpMessageCardView() +} diff --git a/Honzapda/Presentation/User/View/LogoutAlertView.swift b/Honzapda/Presentation/User/View/LogoutAlertView.swift new file mode 100644 index 0000000..fd48a61 --- /dev/null +++ b/Honzapda/Presentation/User/View/LogoutAlertView.swift @@ -0,0 +1,83 @@ +// +// LogoutAlertView.swift +// Honzapda +// +// Created by 황주연 on 3/12/24. +// + +import SwiftUI + +// MARK: - 로그아웃 팝업 뷰 +struct LogoutAlertView: View { + @Environment(\.dismiss) var dismiss + // MARK: BODY + var body: some View { + NavigationView { + ZStack { + Color.clear + VStack { + Image(.imageMyBored) + .frame(width: 112, height: 112) + .padding(.bottom, 25) + .padding(.top, 40) + + Text("현재 계정에서\n로그아웃하시겠어요?") + .multilineTextAlignment(.center) + .font(.sCoreDream(.bold, size: 20)) + .foregroundStyle(.primary06) + .padding(.bottom, 18) + + HStack(spacing: 12) { // 버튼 + NavigationLink( // 로그아웃 + destination: OnboardingView().navigationBarBackButtonHidden() + // TODO: 로그아웃 로직 구현 + ) { + Text("로그아웃") + .font(.sCoreDream(.medium, size: 14)) + .foregroundColor(.gray07) + .padding(EdgeInsets(top: 13, + leading: 34, + bottom: 13, + trailing: 34) + ) + .background(RoundedRectangle(cornerRadius: 12) + .fill(.gray03) + .frame(width: 130, height: 44) + ) + } //: 로그아웃 + + Button { // 로그인 유지 + print("로그인 유지") + dismiss() + } label: { + // TODO: 로그인 유지 로직 구현 + Text("로그인 유지") + .font(.sCoreDream(.medium, size: 14)) + .foregroundColor(.white) + .padding(EdgeInsets(top: 13, + leading: 34, + bottom: 13, + trailing: 34) + ) + .background(RoundedRectangle(cornerRadius: 12) + .fill(.primary05) + .frame(width: 130, height: 44) + ) + } //: 로그인 유지 + } //: 버튼 + .padding(.bottom, 16) + } + .background(RoundedRectangle(cornerRadius: 16) + .fill(.white) + .frame(width: 320, height: 320) + .shadow(radius: 1) + ) + } + } + } +} + +#Preview { + LogoutAlertView() +} + diff --git a/Honzapda/Presentation/User/View/UserCafeView.swift b/Honzapda/Presentation/User/View/UserCafeView.swift new file mode 100644 index 0000000..38421d3 --- /dev/null +++ b/Honzapda/Presentation/User/View/UserCafeView.swift @@ -0,0 +1,199 @@ +// +// UserCafeView.swift +// Honzapda +// +// Created by 황주연 on 3/3/24. +// + +import SwiftUI + +// MARK: - 내가 찜한 카페 뷰 +struct UserCafeView: View { + @Environment(\.dismiss) var dismiss + @ObservedObject var userViewModel = UserViewModel() + + var backButton: some View { // 뒤로가기 버튼 + Button { + dismiss() + } label: { + HStack { + Image(systemName: "chevron.left") + .aspectRatio(contentMode: .fit) + .foregroundColor(.black) + } + } + } //: 뒤로가기 버튼 + + // MARK: BODY + var body: some View { + NavigationView { + VStack { + VStack(alignment: .leading) { + backButton.padding(EdgeInsets(top: 0, + leading: 16, + bottom: 5, + trailing: 0) + ) + + Divider() + + Text("3개의 찜한 카페") + .foregroundColor(.primary06) + .font(.sCoreDream(.bold, size: 14)) + .padding(EdgeInsets(top: 16, + leading: 24, + bottom: 0, + trailing: 0) + ) + + HStack { // 정렬 버튼 + Button { + userViewModel.sortColumn = "distance" + print(userViewModel.sortColumn) + } label: { + Text("거리순") + } + .modifier(SortButtonModifier(isSelected: userViewModel.sortColumn == "distance")) + + Button { + userViewModel.sortColumn = "review" + print(userViewModel.sortColumn) + } label: { + Text("리뷰순") + } + .modifier(SortButtonModifier(isSelected: userViewModel.sortColumn == "review")) + + Button { + userViewModel.sortColumn = "bookmark" + print(userViewModel.sortColumn) + } label: { + Text("저장순") + } + .modifier(SortButtonModifier(isSelected: userViewModel.sortColumn == "bookmark")) + + Button { + userViewModel.sortColumn = "recommend" + print(userViewModel.sortColumn) + } label: { + Text("추천순") + } + .modifier(SortButtonModifier(isSelected: userViewModel.sortColumn == "recommend")) + + Spacer() + } //: 정렬 버튼 + .background(.white) + .padding(EdgeInsets(top: 6, + leading: 24, + bottom: 16, + trailing: 0) + ) + } + .background(.white) + + ScrollView { + LazyVStack(spacing: 8) { + MyCafeListCardView() // 가게 상세 정보 카드 뷰 + .buttonStyle(PlainButtonStyle()) + .padding(8) + } + } //: ScrollView + } + .background(.gray01) + } + .navigationBarBackButtonHidden(true) + } +} + +// MARK: - 가게 상세 정보 카드 뷰 +struct MyCafeListCardView: View { + @ObservedObject var userViewModel = UserViewModel() + + // MARK: BODY + var body: some View { + VStack { + VStack(alignment: .leading, spacing: 16) { + // TODO: api 결과 값에 따라 보여줄 ViewModel 적용 + ZStack { + Image(.cafe1) // 가게 이미지 + .resizable() + .frame(width: 345, height: 160) + .clipped() + + VStack { // 찜 아이콘, 글 + Spacer() + HStack { + Spacer() + VStack { + Image(.iconMyHeartFill) + .padding(4) + + Text("가게 찜") + .foregroundColor(.white) + .font(.sCoreDream(.medium, size: 6)) + } + .padding(10) + } + } //: 찜 아이콘, 글 + } + + VStack(alignment: .leading, spacing: 8) { // 가게 정보 텍스트 + HStack { + Text("필아웃커피 보정점") + .foregroundColor(.gray10) + .font(.sCoreDream(.bold, size: 16)) + + Text(userViewModel.openNow ? "영업 중" : "휴무") + .font(.sCoreDream(.light, size: 8)) + .padding(4) + .background(RoundedRectangle(cornerRadius: 8) + .stroke(lineWidth: 0.5) + ) + .foregroundColor(.gray08) + } + + Text("경기 용인시 기흥구 죽전로 15번길 7-5 상가 1층") + .font(.sCoreDream(.medium, size: 10)) + .foregroundColor(.gray07) + .padding(.bottom, 24) + } //: 가게 정보 텍스트 + .padding(.leading, 24) + } + .background(.white) + .cornerRadius(12) + .shadow(radius: 3) + } + .padding(EdgeInsets(top: 24, + leading: 20, + bottom: 4, + trailing: 20) + ) + .frame(width: 345, height: 240) + } +} + +struct SortButtonModifier: ViewModifier { + var isSelected: Bool + func body(content: Content) -> some View { + content + .lineLimit(1) + .padding(EdgeInsets(top: 8, + leading: 12, + bottom: 8, + trailing: 12) + ) + .foregroundColor(isSelected ? .white : .primary05) + .font(.sCoreDream(.medium, size: 12)) + .background(RoundedRectangle(cornerRadius: 20) + .foregroundColor(isSelected ? .primary05 : .white) + .overlay(RoundedRectangle(cornerRadius: 20) + .stroke(.primary05, lineWidth: 1.3) + ) + ) + .padding(3) + } +} + + +#Preview { + UserCafeView() +} diff --git a/Honzapda/Presentation/User/ViewModel/UserViewModel.swift b/Honzapda/Presentation/User/ViewModel/UserViewModel.swift new file mode 100644 index 0000000..e38ab36 --- /dev/null +++ b/Honzapda/Presentation/User/ViewModel/UserViewModel.swift @@ -0,0 +1,29 @@ +// +// UserViewModel.swift +// Honzapda +// +// Created by 황주연 on 3/14/24. +// + +import SwiftUI + +class UserViewModel: ObservableObject { + // MARK: Properties + + // TODO: 프로필 사진 서버에서 불러오는 api 구현 + @Published public var profileImage: UIImage? = UIImage(named: "image_my_profile_none") // 프로필 이미지 + + @Published public var showActionSheet: Bool = false // 카메라, 앨범 선택 actionsheet + @Published public var showImagePicker: Bool = false // ImagePicker + @Published public var showCamera: Bool = false // true : 카메라 실행 / false : 앨범 실행 + + @Published public var isToggle: Bool = true // UserMainView 푸시알림설정 토글 + + @Published public var isCafeTasteUpdate: Bool = false // 카페 취향 ToastMessage + @Published public var isLogoutUpdate: Bool = false // 로그아웃 ToastMessage + @Published public var isProfileUpdate: Bool = false // 프로필 사진 ToastMessage + @Published public var isErrorUpdate: Bool = false // Error ToastMessage + + @Published public var sortColumn: String = "" // UserCafeView 선택된 정렬 조건 + @Published public var openNow: Bool = true // MyCafeListCardView 가게 영업 유무 +}