Skip to content

Commit 999d506

Browse files
committed
[fix] #156 CautionType ์ ์šฉ
1 parent e08de4b commit 999d506

File tree

8 files changed

+22
-65
lines changed

8 files changed

+22
-65
lines changed

โ€ŽProjects/DSKit/Sources/Components/PokitCaution.swiftโ€Ž

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,14 @@ public enum CautionType {
7272
}
7373

7474
public struct PokitCaution: View {
75-
private let image: PokitImage.Character
76-
private let titleKey: String
77-
private let message: String
75+
private let type: CautionType
7876
private let action: (() -> Void)?
7977

8078
public init(
81-
image: PokitImage.Character,
82-
titleKey: String,
83-
message: String,
79+
type: CautionType,
8480
action: (() -> Void)? = nil
8581
) {
86-
self.image = image
87-
self.titleKey = titleKey
88-
self.message = message
82+
self.type = type
8983
self.action = action
9084
}
9185

@@ -94,27 +88,28 @@ public struct PokitCaution: View {
9488
Spacer()
9589

9690
VStack(spacing: 0) {
97-
Image(.character(image))
91+
Image(.character(type.image))
9892
.resizable()
9993
.aspectRatio(contentMode: .fill)
10094
.frame(width: 180, height: 180)
10195
.padding(.bottom, 16)
10296

103-
Text(titleKey)
97+
Text(type.title)
10498
.pokitFont(.title2)
10599
.foregroundStyle(.pokit(.text(.secondary)))
106100
.padding(.bottom, 8)
107101

108-
Text(message)
102+
Text(type.message)
109103
.pokitFont(.b2(.m))
110104
.foregroundStyle(.pokit(.text(.secondary)))
111105
.padding(.bottom, 16)
112106

113-
if let action {
107+
if let action,
108+
let actionTitle = type.actionTitle {
114109
PokitTextButton(
115-
"๋‹ค์‹œ์‹œ๋„",
116-
state: .default(.secondary),
117-
size: .small,
110+
actionTitle,
111+
state: .stroke(.secondary),
112+
size: .medium,
118113
shape: .rectangle,
119114
action: action
120115
)
@@ -128,9 +123,7 @@ public struct PokitCaution: View {
128123

129124
#Preview {
130125
PokitCaution(
131-
image: .empty,
132-
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
133-
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”",
126+
type: .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ,
134127
action: {}
135128
)
136129
}

โ€ŽProjects/DSKit/Sources/Components/PokitList.swiftโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ public struct PokitList<Item: PokitSelectItem>: View {
3030
public var body: some View {
3131
if list.isEmpty {
3232
VStack {
33-
PokitCaution(
34-
image: .empty,
35-
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
36-
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
37-
)
33+
PokitCaution(type: .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ)
3834

3935
Spacer()
4036
}

โ€ŽProjects/Feature/FeatureCategoryDetail/Sources/CategoryDetailView.swiftโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ private extension CategoryDetailView {
140140
if !store.isLoading {
141141
if store.contents.isEmpty {
142142
VStack {
143-
PokitCaution(
144-
image: .empty,
145-
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
146-
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
147-
)
143+
PokitCaution(type: .๋งํฌ์—†์Œ)
148144
.padding(.top, 20)
149145

150146
Spacer()

โ€ŽProjects/Feature/FeatureCategorySharing/Sources/CategorySharing/CategorySharingView.swiftโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ private extension CategorySharingView {
9191
if !store.isLoading {
9292
if store.contents.isEmpty {
9393
VStack {
94-
PokitCaution(
95-
image: .empty,
96-
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
97-
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
98-
)
94+
PokitCaution(type: .๋งํฌ์—†์Œ)
9995
.padding(.top, 20)
10096

10197
Spacer()

โ€ŽProjects/Feature/FeatureContentList/Sources/ContentList/ContentListView.swiftโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ private extension ContentListView {
8989
Group {
9090
if !store.isLoading {
9191
if store.contents.isEmpty {
92-
PokitCaution(
93-
image: .empty,
94-
titleKey: "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
95-
message: "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
96-
)
92+
PokitCaution(type: .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ)
9793
.padding(.top, 100)
9894

9995
Spacer()

โ€ŽProjects/Feature/FeaturePokit/Sources/PokitRootView.swiftโ€Ž

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ private extension PokitRootView {
125125
if categories.isEmpty {
126126
VStack {
127127
PokitCaution(
128-
image: .empty,
129-
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
130-
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
128+
type: .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ,
131129
)
132130
.padding(.top, 36)
133131

@@ -171,9 +169,7 @@ private extension PokitRootView {
171169
if store.contents.isEmpty {
172170
VStack {
173171
PokitCaution(
174-
image: .empty,
175-
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
176-
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
172+
type: .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ,
177173
)
178174
.padding(.top, 36)
179175

โ€ŽProjects/Feature/FeatureRemind/Sources/Remind/RemindView.swiftโ€Ž

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ extension RemindView {
6868
unreadContents.isEmpty &&
6969
favoriteContents.isEmpty {
7070
VStack {
71-
PokitCaution(
72-
image: .sad,
73-
titleKey: "๋งํฌ๊ฐ€ ๋ถ€์กฑํ•ด์š”!",
74-
message: "๋งํฌ๋ฅผ 5๊ฐœ ์ด์ƒ ์ €์žฅํ•˜๊ณ  ์ถ”์ฒœ์„ ๋ฐ›์•„๋ณด์„ธ์š”"
75-
)
71+
PokitCaution(type: .๋งํฌ๋ถ€์กฑ)
7672
.padding(.top, 100)
7773

7874
Spacer()
@@ -111,11 +107,7 @@ extension RemindView {
111107
.padding(.horizontal, 20)
112108

113109
if recommendedContents.isEmpty {
114-
PokitCaution(
115-
image: .sad,
116-
titleKey: "๋งํฌ๊ฐ€ ๋ถ€์กฑํ•ด์š”!",
117-
message: "๋งํฌ๋ฅผ 5๊ฐœ ์ด์ƒ ์ €์žฅํ•˜๊ณ  ์ถ”์ฒœ์„ ๋ฐ›์•„๋ณด์„ธ์š”"
118-
)
110+
PokitCaution(type: .๋งํฌ๋ถ€์กฑ)
119111
.padding(.top, 24)
120112
.padding(.bottom, 32)
121113
} else {
@@ -293,11 +285,7 @@ extension RemindView {
293285
.padding(.bottom, 16)
294286

295287
if favoriteContents.isEmpty {
296-
PokitCaution(
297-
image: .empty,
298-
titleKey: "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
299-
message: "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
300-
)
288+
PokitCaution(type: .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ)
301289
.padding(.top, 16)
302290
} else {
303291
ForEach(favoriteContents, id: \.id) { content in

โ€ŽProjects/Feature/FeatureSetting/Sources/Alert/PokitAlertBoxView.swiftโ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ public extension PokitAlertBoxView {
2929
if let alertContents = store.alertContents {
3030
if alertContents.isEmpty {
3131
VStack {
32-
PokitCaution(
33-
image: .pooki,
34-
titleKey: "์•Œ๋ฆผ์ด ์—†์–ด์š”",
35-
message: "๋ฆฌ๋งˆ์ธ๋“œ ์•Œ๋ฆผ์„ ์„ค์ •ํ•˜์„ธ์š”"
36-
)
32+
PokitCaution(type: .์•Œ๋ฆผ์—†์Œ)
3733
.padding(.top, 84)
3834
Spacer()
3935
}

0 commit comments

Comments
ย (0)