From f38c25b6c730b1824e9a1186c5b6a2a5aae0dcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxixn2=E2=80=9D?= Date: Fri, 17 Jan 2025 16:03:37 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20::=20[#76]=20Profile=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=95=84=EC=9B=83=20=ED=8C=9D=EC=97=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package.swift | 6 +- .../Dependency+SPM.swift | 1 + Projects/App/Project.swift | 3 +- .../Button/ExpoOutLineButton.swift | 62 ++++--- .../Program/SignInRequestDetail.swift | 74 +++++++++ .../MyPageFeature/Sources/MyPageView.swift | 155 ++++++++++++++++-- .../Sources/PostDetailView.swift | 18 +- 7 files changed, 275 insertions(+), 44 deletions(-) create mode 100644 Projects/App/Sources/DesignSystem/Program/SignInRequestDetail.swift diff --git a/Package.swift b/Package.swift index 1455ebf..fb739fd 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,8 @@ let packageSetting = PackageSettings( productTypes: [ - "KakaoMapsSDK-SPM": .staticLibrary + "KakaoMapsSDK-SPM": .staticLibrary, + "PopupView": .staticLibrary ], baseSettings: .settings( configurations: [ @@ -22,6 +23,7 @@ let package = Package( name: "Package", dependencies: [ .package(url: "https://github.com/Moya/Moya.git", from: "15.0.0"), - .package(url: "https://github.com/kakao-mapsSDK/KakaoMapsSDK-SPM.git", .upToNextMajor(from: "2.10.5")) + .package(url: "https://github.com/kakao-mapsSDK/KakaoMapsSDK-SPM.git", .upToNextMajor(from: "2.10.5")), + .package(url: "https://github.com/exyte/PopupView.git", from: "4.0.0") ] ) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index a46170c..7218cc2 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -7,6 +7,7 @@ public extension TargetDependency { public extension TargetDependency.SPM { static let Moya = TargetDependency.external(name: "Moya") static let KakaoMapsSDK = TargetDependency.external(name: "KakaoMapsSDK-SPM") + static let PopupView = TargetDependency.external(name: "PopupView") } public extension Package { diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index c8f2e79..a96b238 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -31,7 +31,8 @@ let targets: [Target] = [ dependencies: [ .SPM.Moya, .SPM.KakaoMapsSDK, - .domain(target:.Domain) + .domain(target:.Domain), + .SPM.PopupView ], settings: .settings(base: env.baseSetting) ) diff --git a/Projects/App/Sources/DesignSystem/Button/ExpoOutLineButton.swift b/Projects/App/Sources/DesignSystem/Button/ExpoOutLineButton.swift index 61bb0dc..3701e49 100644 --- a/Projects/App/Sources/DesignSystem/Button/ExpoOutLineButton.swift +++ b/Projects/App/Sources/DesignSystem/Button/ExpoOutLineButton.swift @@ -1,12 +1,3 @@ -// -// ExpoOutLineButton.swift -// Expo-iOS -// -// Created by 서지완 on 11/11/24. -// Copyright © 2024 SchoolofCompany. All rights reserved. -// - - import SwiftUI public struct ExpoOutLineButton: View { @@ -14,31 +5,38 @@ public struct ExpoOutLineButton: View { var horizontalPadding: CGFloat var verticalPadding: CGFloat var backColor: Color + var outLineColor: Color + var textColor: Color + var actionTextColor: Color + var actionColor: Color var action: () -> Void - @State private var isPressed = false - public init( text: String, horizontalPadding: CGFloat = 16, verticalPadding: CGFloat = 8, backColor: Color, + outLineColor: Color, + textColor: Color, + actionTextColor: Color, + actionColor: Color, action: @escaping () -> Void = {} ) { self.text = text self.horizontalPadding = horizontalPadding self.verticalPadding = verticalPadding self.backColor = backColor + self.outLineColor = outLineColor + self.textColor = textColor + self.actionTextColor = actionTextColor + self.actionColor = actionColor self.action = action } public var body: some View { - Button(action: { - self.action() - }) { + Button(action: action) { Text(text) .expoFont(.body2B) - .expoColor(ExpoColor.main) .padding(.horizontal, horizontalPadding) .padding(.vertical, verticalPadding) .background( @@ -47,18 +45,30 @@ public struct ExpoOutLineButton: View { ) .overlay( RoundedRectangle(cornerRadius: 6) - .stroke(ExpoColor.main.swiftUIColor, lineWidth: 1) + .stroke(outLineColor, lineWidth: 1) ) - .scaleEffect(isPressed ? 0.9 : 1.0) } - .buttonStyle(PlainButtonStyle()) - .gesture( - DragGesture(minimumDistance: 0) - .onChanged { _ in self.isPressed = true } - .onEnded { _ in - self.isPressed = false - self.action() - } - ) + .buttonStyle(ExpoOutLineButtonStyle( + textColor: textColor, + actionTextColor: actionTextColor, + actionColor: actionColor + )) + } +} + +struct ExpoOutLineButtonStyle: ButtonStyle { + var textColor: Color + var actionTextColor: Color + var actionColor: Color + + func makeBody(configuration: Configuration) -> some View { + configuration.label + .foregroundColor(configuration.isPressed ? actionTextColor : textColor) + .background( + RoundedRectangle(cornerRadius: 6) + .fill(configuration.isPressed ? actionColor : Color.clear) + ) + .scaleEffect(configuration.isPressed ? 0.95 : 1.0) + .animation(.easeInOut(duration: 0.2), value: configuration.isPressed) } } diff --git a/Projects/App/Sources/DesignSystem/Program/SignInRequestDetail.swift b/Projects/App/Sources/DesignSystem/Program/SignInRequestDetail.swift new file mode 100644 index 0000000..83a4548 --- /dev/null +++ b/Projects/App/Sources/DesignSystem/Program/SignInRequestDetail.swift @@ -0,0 +1,74 @@ +// +// SignInRequestDetail.swift +// Expo-iOS +// +// Created by 서지완 on 1/15/25. +// Copyright © 2025 SchoolofCompany. All rights reserved. +// + +import SwiftUI + +struct SignInRequestDetail: View { + var programNum: Int + var userName: String + var id: String + var email: String + var phoneNumber: String + var action: () -> Void + + @State private var isPressed = false + + public init( + programNum: Int, + userName: String, + id: String, + email: String, + phoneNumber: String, + action: @escaping () -> Void = {} + ) { + self.programNum = programNum + self.userName = userName + self.id = id + self.email = email + self.phoneNumber = phoneNumber + self.action = action + } + + public var body: some View { + Button(action: { + self.action() + }) { + HStack { + Text("\(programNum)") + .expoFont(.caption1B) + .padding(.leading, 8) + + Text(userName) + .padding(.leading, 25) + .frame(maxWidth: .infinity, alignment: .leading) + + Text(id) + .padding(.leading, 30) + .frame(maxWidth: .infinity, alignment: .leading) + + Text(email) + .frame(maxWidth: .infinity, alignment: .leading) + + Text(phoneNumber) + .padding(.leading, 31) + .frame(maxWidth: .infinity, alignment: .leading) + } + .padding(.bottom, 36) + .expoFont(.caption2R) + } + .buttonStyle(PlainButtonStyle()) + .gesture( + DragGesture(minimumDistance: 0) + .onChanged { _ in self.isPressed = true } + .onEnded { _ in + self.isPressed = false + self.action() + } + ) + } +} diff --git a/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift b/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift index 7f037c7..af55aff 100644 --- a/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift +++ b/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift @@ -1,32 +1,163 @@ -// -// MyPageView.swift -// Expo-iOS -// -// Created by 서지완 on 1/15/25. -// Copyright © 2025 SchoolofCompany. All rights reserved. -// - import SwiftUI +import PopupView struct MyPageView: View { + @State private var showingTopFirst: Bool = false + var body: some View { - VStack { + VStack(alignment: .leading, spacing: 0) { HStack(spacing: 20) { VStack(alignment: .leading, spacing: 8) { - infoBar(title: "이름", info: "김진원") + infoBar(title: "이름", info: "김진원김진원김진원김진원김진원김진원김진원") infoBar(title: "아이디", info: "jin1234") infoBar(title: "이메일", info: "jin12345@gmail.com") } Spacer() - ExpoIOSAsset.Assets.logout.swiftUIImage - .padding(.bottom, 50) + Button { + showingTopFirst.toggle() + } label: { + ExpoIOSAsset.Assets.logout.swiftUIImage + .padding(.bottom, 50) + } } .padding(.horizontal, 16) + + Text("회원가입 요청") + .expoFont(.body2B) + .expoColor(ExpoColor.black) + .padding(.leading, 16) + .padding(.top, 56) + + HStack(spacing: 10) { + ExpoIOSAsset.Assets.warning.swiftUIImage + .padding(.leading, 16) + + Text("옆으로 넘겨서 확인해보세요") + .expoFont(.caption2R) + .expoColor(ExpoColor.gray300) + + Spacer() + + Rectangle() + .frame(width: 1, height: 14) + .expoColor(ExpoColor.gray100) + .padding(.trailing, 14) + + Text("회원가입 요청") + .expoColor(ExpoColor.gray500) + .expoFont(.caption2R) + + Text("100명") + .expoColor(ExpoColor.main) + .expoFont(.caption2R) + .padding(.trailing, 31) + } + + ScrollView(.horizontal) { + Rectangle() + .expoColor(ExpoColor.gray600) + .frame(height: 0.4) + .padding(.top, 20) + + HStack(spacing: 39) { + Text("성명") + .expoColor(ExpoColor.gray600) + .expoFont(.caption1B) + .frame(maxWidth: .infinity, alignment: .leading) + + Text("아이디") + .expoColor(ExpoColor.gray600) + .expoFont(.caption1B) + .frame(maxWidth: .infinity, alignment: .leading) + + Text("이메일") + .expoColor(ExpoColor.gray600) + .expoFont(.caption1B) + .frame(maxWidth: .infinity, alignment: .leading) + + Text("휴대폰 번호") + .expoColor(ExpoColor.gray600) + .expoFont(.caption1B) + .frame(maxWidth: .infinity, alignment: .leading) + } + .padding(.leading, 50) + + Rectangle() + .expoColor(ExpoColor.gray600) + .frame(height: 0.4) + + SignInRequestDetail( + programNum: 1, + userName: "김진원", + id: "jin1234", + email: "jin12345@gmail.com", + phoneNumber: "010123456789" + ) + + SignInRequestDetail( + programNum: 2, + userName: "김진원", + id: "jin1234", + email: "jin12345@gmail.com", + phoneNumber: "010123456789" + ) + } + Spacer() } .padding(.top, 58) + .popup(isPresented: $showingTopFirst) { + VStack(alignment: .leading, spacing: 0) { + Text("정말로 로그아웃 하시겠습니까?") + .expoFont(.title3B) + Text("로그아웃 했을 경우 다시 로그인 해야하는 경우가 발생합니다") + .expoFont(.body2R) + .expoColor(ExpoColor.gray500) + + ExpoOutLineButton( + text: "로그아웃", + horizontalPadding: 117, + verticalPadding: 14, + backColor: .white, + outLineColor: ExpoColor.error.swiftUIColor, + textColor: ExpoColor.error.swiftUIColor, + actionTextColor: .white, + actionColor: ExpoColor.error.swiftUIColor + ) + .padding(.top, 40) + + ExpoOutLineButton( + text: "취소", + horizontalPadding: 130, + verticalPadding: 14, + backColor: .white, + outLineColor: ExpoColor.gray700.swiftUIColor, + textColor: ExpoColor.gray700.swiftUIColor, + actionTextColor: .white, + actionColor: ExpoColor.gray700.swiftUIColor + ) { + showingTopFirst.toggle() + } + .padding(.top, 8) + } + .padding(.horizontal, 26) + .padding(.vertical, 26) + .background(.white) + .cornerRadius(6) + + } customize: { + $0 + .type(.floater()) + .appearFrom(.bottomSlide) + .position(.center) + .animation(.spring()) + .closeOnTapOutside(true) + .closeOnTap(false) + .backgroundColor(.black.opacity(0.4)) + } + } @ViewBuilder diff --git a/Projects/App/Sources/Feature/PostDetailFeature/Sources/PostDetailView.swift b/Projects/App/Sources/Feature/PostDetailFeature/Sources/PostDetailView.swift index 09a693c..d727273 100644 --- a/Projects/App/Sources/Feature/PostDetailFeature/Sources/PostDetailView.swift +++ b/Projects/App/Sources/Feature/PostDetailFeature/Sources/PostDetailView.swift @@ -168,7 +168,11 @@ struct PostDetailView: View { text: "프로그램", horizontalPadding: 157, verticalPadding: 14, - backColor: ExpoColor.main100.swiftUIColor + backColor: ExpoColor.main100.swiftUIColor, + outLineColor: ExpoColor.main.swiftUIColor, + textColor: .white, + actionTextColor: .white, + actionColor: ExpoColor.main200.swiftUIColor ) .padding(.top, 2) @@ -176,7 +180,11 @@ struct PostDetailView: View { text: "조회하기", horizontalPadding: 155, verticalPadding: 14, - backColor: ExpoColor.main100.swiftUIColor + backColor: ExpoColor.main100.swiftUIColor, + outLineColor: ExpoColor.main.swiftUIColor, + textColor: .white, + actionTextColor: .white, + actionColor: ExpoColor.main200.swiftUIColor ) .padding(.top, 2) @@ -184,7 +192,11 @@ struct PostDetailView: View { text: "수정하기", horizontalPadding: 155, verticalPadding: 14, - backColor: .clear + backColor: .clear, + outLineColor: ExpoColor.main.swiftUIColor, + textColor: ExpoColor.main.swiftUIColor, + actionTextColor: ExpoColor.main.swiftUIColor, + actionColor: .clear ) .padding(.top, 2)