Skip to content

Commit 576f531

Browse files
committed
Merge branch 'develop' into refactor/#160
2 parents b06e047 + 106d542 commit 576f531

42 files changed

Lines changed: 2030 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CERTI-iOS/Application/DIContainer/AppDIContainer.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,8 @@ extension AppDIContainer {
223223
fetchActivityListUseCase: makeFetchActivityListUseCase()
224224
)
225225
}
226+
227+
func makeMyPageFactory() -> MyPageFactory {
228+
return DefaultMyPageFactory()
229+
}
226230
}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
//
2+
// CertiAlertView.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 11/2/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct CertiAlertView: View {
11+
12+
enum AlertStyle {
13+
case plain
14+
case withdraw
15+
case onlyTitle
16+
}
17+
18+
//MARK: - Property Wrappers
19+
20+
@State private var isProcessing: Bool = false
21+
@State private var hasConfirmed: Bool = false
22+
23+
//MARK: - Properties
24+
25+
let style: AlertStyle
26+
let onConfirm: () async -> Void
27+
let onCancel: () -> Void
28+
let titleMessage: String
29+
var subTitleMessage: String? = nil
30+
let confirmText: String
31+
let cancelText: String
32+
33+
var confirmColor: Color {
34+
switch style {
35+
case .plain, .onlyTitle:
36+
return .mainblue
37+
case .withdraw:
38+
return .error
39+
}
40+
}
41+
42+
var titleFont: CertiFont {
43+
switch style {
44+
case .plain, .withdraw:
45+
return .body_semibold_18
46+
case .onlyTitle:
47+
return .body_semibold_16
48+
}
49+
}
50+
51+
//MARK: - Main Body
52+
53+
var body: some View {
54+
ZStack {
55+
Color.blackOpacity40
56+
57+
VStack(alignment: .center, spacing: 0) {
58+
59+
Text(titleMessage)
60+
.applyCertiFont(titleFont)
61+
.foregroundStyle(.grayscale600)
62+
.multilineTextAlignment(.center)
63+
.padding(.bottom, 16)
64+
.padding(.top, 25)
65+
.padding(.horizontal, 40)
66+
67+
if subTitleMessage != nil {
68+
Text(subTitleMessage!)
69+
.applyCertiFont(.caption_regular_14)
70+
.foregroundStyle(.grayscale600)
71+
.padding(.horizontal, 35)
72+
.padding(.bottom, 25)
73+
}
74+
75+
Color.grayscale100
76+
.frame(height: 1)
77+
78+
HStack(alignment: .center, spacing: 0) {
79+
Button {
80+
if !isProcessing {
81+
onCancel()
82+
}
83+
} label: {
84+
Text(cancelText)
85+
.applyCertiFont(.body_semibold_18)
86+
.frame(maxWidth: .infinity, maxHeight: .infinity)
87+
.foregroundStyle(.black)
88+
}
89+
.disabled(isProcessing)
90+
91+
Color.grayscale100
92+
.frame(width: 1)
93+
94+
Button{
95+
confirmOnce()
96+
} label: {
97+
Text(confirmText)
98+
.applyCertiFont(.body_semibold_18)
99+
.frame(maxWidth: .infinity, maxHeight: .infinity)
100+
.foregroundStyle(confirmColor)
101+
}
102+
.disabled(isProcessing)
103+
104+
}
105+
.frame(height: 58)
106+
107+
}
108+
.frame(maxWidth: .infinity)
109+
.background(.white)
110+
.clipShape(RoundedRectangle(cornerRadius: 12))
111+
.padding(.horizontal, 20)
112+
113+
}
114+
.ignoresSafeArea()
115+
}
116+
}
117+
118+
//MARK: - Private Func
119+
120+
extension CertiAlertView {
121+
private func confirmOnce() {
122+
guard !isProcessing && !hasConfirmed else { return }
123+
isProcessing = true
124+
hasConfirmed = true
125+
126+
Task {
127+
await onConfirm()
128+
isProcessing = false
129+
}
130+
}
131+
}
132+
133+
#Preview {
134+
ZStack {
135+
Color.gray
136+
.zIndex(1)
137+
138+
CertiAlertView(
139+
style: .plain,
140+
onConfirm: { },
141+
onCancel: { },
142+
titleMessage: "로그아웃하시겠습니까?",
143+
subTitleMessage: "로그아웃 시 재로그인이 필요합니다.",
144+
confirmText: "",
145+
cancelText: "아니요"
146+
)
147+
.zIndex(2)
148+
}
149+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//
2+
// ToastMessageView.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 11/2/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ToastMessageView: View {
11+
enum Style {
12+
case agreeMarketing
13+
14+
var textColor: Color {
15+
switch self {
16+
case .agreeMarketing: return .white
17+
}
18+
}
19+
20+
var backgroundColor: Color {
21+
switch self {
22+
case .agreeMarketing: return Color.mainblue
23+
}
24+
}
25+
26+
var borderColor: Color? {
27+
switch self {
28+
case .agreeMarketing: return nil
29+
}
30+
}
31+
}
32+
33+
let message: String
34+
let style: Style
35+
36+
var body: some View {
37+
switch style {
38+
case .agreeMarketing:
39+
Text(message)
40+
.applyCertiFont(.caption_semibold_14)
41+
.foregroundStyle(style.textColor)
42+
.padding(.horizontal, 16)
43+
.padding(.vertical, 6)
44+
.background(style.backgroundColor)
45+
.clipShape(RoundedRectangle(cornerRadius: 4))
46+
}
47+
48+
}
49+
}
50+
51+
#Preview("marketing") {
52+
ToastMessageView(message: "광고성 정보를 받는 것에 동의했어요. 2025. 10. 8", style: .agreeMarketing)
53+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "btn_profile_edit.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "icon_close_20.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "icon_file_24.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)