Skip to content

Commit

Permalink
πŸ’„ :: [#76] Profile λ‘œκ·Έμ•„μ›ƒ νŒμ—… μΆ”κ°€
Browse files Browse the repository at this point in the history
  • Loading branch information
Xixn2 committed Jan 20, 2025
1 parent e34eef1 commit f38c25b
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 44 deletions.
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

let packageSetting = PackageSettings(
productTypes: [
"KakaoMapsSDK-SPM": .staticLibrary
"KakaoMapsSDK-SPM": .staticLibrary,
"PopupView": .staticLibrary
],
baseSettings: .settings(
configurations: [
Expand All @@ -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")
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
62 changes: 36 additions & 26 deletions Projects/App/Sources/DesignSystem/Button/ExpoOutLineButton.swift
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
//
// ExpoOutLineButton.swift
// Expo-iOS
//
// Created by μ„œμ§€μ™„ on 11/11/24.
// Copyright Β© 2024 SchoolofCompany. All rights reserved.
//


import SwiftUI

public struct ExpoOutLineButton: View {
var text: String
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(
Expand All @@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -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()
}
)
}
}
155 changes: 143 additions & 12 deletions Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift
Original file line number Diff line number Diff line change
@@ -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: "[email protected]")
}

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: "[email protected]",
phoneNumber: "010123456789"
)

SignInRequestDetail(
programNum: 2,
userName: "김진원",
id: "jin1234",
email: "[email protected]",
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
Expand Down
Loading

0 comments on commit f38c25b

Please sign in to comment.