Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 1.0.5 #164

Merged
merged 5 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Projects/App/Resources/Pokit-info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
6 changes: 4 additions & 2 deletions Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public extension MainTabFeature {

/// - ํฌํ‚ท `์ถ”๊ฐ€` ๋ฒ„ํŠผ ๋ˆŒ๋ €์„ ๋•Œ
case .delegate(.ํฌํ‚ท์ถ”๊ฐ€ํ•˜๊ธฐ),
.path(.element(_, action: .๋งํฌ์ถ”๊ฐ€๋ฐ์ˆ˜์ •(.delegate(.ํฌํ‚ท์ถ”๊ฐ€ํ•˜๊ธฐ)))):
.path(.element(_, action: .๋งํฌ์ถ”๊ฐ€๋ฐ์ˆ˜์ •(.delegate(.ํฌํ‚ท์ถ”๊ฐ€ํ•˜๊ธฐ)))),
.pokit(.delegate(.ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ)):
state.path.append(.ํฌํ‚ท์ถ”๊ฐ€๋ฐ์ˆ˜์ •(PokitCategorySettingFeature.State(type: .์ถ”๊ฐ€)))
return .none

Expand Down Expand Up @@ -164,7 +165,8 @@ public extension MainTabFeature {
state.path.append(.๋งํฌ์ถ”๊ฐ€๋ฐ์ˆ˜์ •(ContentSettingFeature.State(contentId: id)))
return .none
/// - ๋งํฌ ์ถ”๊ฐ€ํ•˜๊ธฐ
case .delegate(.๋งํฌ์ถ”๊ฐ€ํ•˜๊ธฐ):
case .delegate(.๋งํฌ์ถ”๊ฐ€ํ•˜๊ธฐ),
.pokit(.delegate(.๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ)):
state.categoryId = nil
state.path.append(.๋งํฌ์ถ”๊ฐ€๋ฐ์ˆ˜์ •(ContentSettingFeature.State(urlText: state.link)))
state.link = nil
Expand Down
95 changes: 76 additions & 19 deletions Projects/DSKit/Sources/Components/PokitCaution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,79 @@

import SwiftUI

public enum CautionType {
case ์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ
case ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ
case ๋งํฌ์—†์Œ
case ์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ
case ๋งํฌ๋ถ€์กฑ
case ์•Œ๋ฆผ์—†์Œ

var image: PokitImage.Character {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ, .๋งํฌ์—†์Œ, .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ, .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return .empty
case .๋งํฌ๋ถ€์กฑ:
return .sad
case .์•Œ๋ฆผ์—†์Œ:
return .pooki
}
}

var title: String {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .๋งํฌ์—†์Œ:
return "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ:
return "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .๋งํฌ๋ถ€์กฑ:
return "๋งํฌ๊ฐ€ ๋ถ€์กฑํ•ด์š”!"
case .์•Œ๋ฆผ์—†์Œ:
return "์•Œ๋ฆผ์ด ์—†์–ด์š”"
}
}

var message: String {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋งํฌ๋ฅผ ํฌํ‚ท์— ๊น”๋”ํ•˜๊ฒŒ ๋ถ„๋ฅ˜ํ•˜์…จ์–ด์š”"
case .๋งํฌ์—†์Œ:
return "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
case .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ:
return "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
case .๋งํฌ๋ถ€์กฑ:
return "๋งํฌ๋ฅผ 5๊ฐœ ์ด์ƒ ์ €์žฅํ•˜๊ณ  ์ถ”์ฒœ์„ ๋ฐ›์•„๋ณด์„ธ์š”"
case .์•Œ๋ฆผ์—†์Œ:
return "๋ฆฌ๋งˆ์ธ๋“œ ์•Œ๋ฆผ์„ ์„ค์ •ํ•˜์„ธ์š”"
}
}

var actionTitle: String? {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "ํฌํ‚ท ์ถ”๊ฐ€ํ•˜๊ธฐ"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋งํฌ ์ถ”๊ฐ€ํ•˜๊ธฐ"
default: return nil
}
}
}

public struct PokitCaution: View {
private let image: PokitImage.Character
private let titleKey: String
private let message: String
private let type: CautionType
private let action: (() -> Void)?

public init(
image: PokitImage.Character,
titleKey: String,
message: String,
type: CautionType,
action: (() -> Void)? = nil
) {
self.image = image
self.titleKey = titleKey
self.message = message
self.type = type
self.action = action
}

Expand All @@ -30,27 +88,28 @@ public struct PokitCaution: View {
Spacer()

VStack(spacing: 0) {
Image(.character(image))
Image(.character(type.image))
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 180, height: 180)
.padding(.bottom, 16)

Text(titleKey)
Text(type.title)
.pokitFont(.title2)
.foregroundStyle(.pokit(.text(.secondary)))
.padding(.bottom, 8)

Text(message)
Text(type.message)
.pokitFont(.b2(.m))
.foregroundStyle(.pokit(.text(.secondary)))
.padding(.bottom, 16)

if let action {
if let action,
let actionTitle = type.actionTitle {
PokitTextButton(
"๋‹ค์‹œ์‹œ๋„",
state: .default(.secondary),
size: .small,
actionTitle,
state: .stroke(.secondary),
size: .medium,
shape: .rectangle,
action: action
)
Expand All @@ -64,9 +123,7 @@ public struct PokitCaution: View {

#Preview {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”",
type: .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ,
action: {}
)
}
6 changes: 1 addition & 5 deletions Projects/DSKit/Sources/Components/PokitList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public struct PokitList<Item: PokitSelectItem>: View {
public var body: some View {
if list.isEmpty {
VStack {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
)
PokitCaution(type: .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ)

Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ private extension CategoryDetailView {
if !store.isLoading {
if store.contents.isEmpty {
VStack {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
)
PokitCaution(type: .๋งํฌ์—†์Œ)
.padding(.top, 20)

Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ private extension CategorySharingView {
if !store.isLoading {
if store.contents.isEmpty {
VStack {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
)
PokitCaution(type: .๋งํฌ์—†์Œ)
.padding(.top, 20)

Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ private extension ContentListView {
Group {
if !store.isLoading {
if store.contents.isEmpty {
PokitCaution(
image: .empty,
titleKey: "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
message: "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
)
PokitCaution(type: .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ)
.padding(.top, 100)

Spacer()
Expand Down
11 changes: 11 additions & 0 deletions Projects/Feature/FeaturePokit/Sources/PokitRootFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public struct PokitRootFeature {
case ๋ถ„๋ฅ˜_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
case ์ผ€๋ฐฅ_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ(BaseCategoryItem)
case ๋ฏธ๋ถ„๋ฅ˜_์ผ€๋ฐฅ_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ(BaseContentItem)
case ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
case ๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
case ์นดํ…Œ๊ณ ๋ฆฌ_๋ˆŒ๋ €์„๋•Œ(BaseCategoryItem)
case ์ปจํ…์ธ _ํ•ญ๋ชฉ_๋ˆŒ๋ €์„๋•Œ(BaseContentItem)
case ๋งํฌ_๊ณต์œ _์™„๋ฃŒ๋˜์—ˆ์„๋•Œ
Expand Down Expand Up @@ -123,6 +125,9 @@ public struct PokitRootFeature {
/// ๋งํฌ์ƒ์„ธ๋กœ ์ด๋™
case contentDetailTapped(BaseContentItem)
case ๋ฏธ๋ถ„๋ฅ˜_์นดํ…Œ๊ณ ๋ฆฌ_์ปจํ…์ธ _์กฐํšŒ

case ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
case ๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ
}
}

Expand Down Expand Up @@ -209,6 +214,12 @@ private extension PokitRootFeature {
case .๋ฏธ๋ถ„๋ฅ˜_์ผ€๋ฐฅ_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ(let selectedItem):
state.selectedUnclassifiedItem = selectedItem
return .run { send in await send(.inner(.์นดํ…Œ๊ณ ๋ฆฌ_์‹œํŠธ_ํ™œ์„ฑํ™”(true))) }

case .ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ:
return .run { send in await send(.delegate(.ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ)) }

case .๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ:
return .run { send in await send(.delegate(.๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ)) }

case .์นดํ…Œ๊ณ ๋ฆฌ_๋ˆŒ๋ €์„๋•Œ(let category):
return .run { send in await send(.delegate(.categoryTapped(category))) }
Expand Down
10 changes: 4 additions & 6 deletions Projects/Feature/FeaturePokit/Sources/PokitRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ private extension PokitRootView {
if categories.isEmpty {
VStack {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!",
message: "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
type: .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ,
action: { send(.ํฌํ‚ท์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ) }
)
.padding(.top, 36)

Expand Down Expand Up @@ -171,9 +170,8 @@ private extension PokitRootView {
if store.contents.isEmpty {
VStack {
PokitCaution(
image: .empty,
titleKey: "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
message: "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
type: .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ,
action: { send(.๋งํฌ์ถ”๊ฐ€_๋ฒ„ํŠผ_๋ˆŒ๋ €์„๋•Œ) }
)
.padding(.top, 36)

Expand Down
18 changes: 3 additions & 15 deletions Projects/Feature/FeatureRemind/Sources/Remind/RemindView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ extension RemindView {
unreadContents.isEmpty &&
favoriteContents.isEmpty {
VStack {
PokitCaution(
image: .sad,
titleKey: "๋งํฌ๊ฐ€ ๋ถ€์กฑํ•ด์š”!",
message: "๋งํฌ๋ฅผ 5๊ฐœ ์ด์ƒ ์ €์žฅํ•˜๊ณ  ์ถ”์ฒœ์„ ๋ฐ›์•„๋ณด์„ธ์š”"
)
PokitCaution(type: .๋งํฌ๋ถ€์กฑ)
.padding(.top, 100)

Spacer()
Expand Down Expand Up @@ -111,11 +107,7 @@ extension RemindView {
.padding(.horizontal, 20)

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

if favoriteContents.isEmpty {
PokitCaution(
image: .empty,
titleKey: "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!",
message: "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
)
PokitCaution(type: .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ)
.padding(.top, 16)
} else {
ForEach(favoriteContents, id: \.id) { content in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ public extension PokitAlertBoxView {
if let alertContents = store.alertContents {
if alertContents.isEmpty {
VStack {
PokitCaution(
image: .pooki,
titleKey: "์•Œ๋ฆผ์ด ์—†์–ด์š”",
message: "๋ฆฌ๋งˆ์ธ๋“œ ์•Œ๋ฆผ์„ ์„ค์ •ํ•˜์„ธ์š”"
)
PokitCaution(type: .์•Œ๋ฆผ์—†์Œ)
.padding(.top, 84)
Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ private extension PokitSearchView {
PokitIconRInput(
text: $store.searchText,
icon: store.isSearching ? .icon(.x) : .icon(.search),
placeholder: "์ œ๋ชฉ, ๋ฉ”๋ชจ๋ฅผ ๊ฒ€์ƒ‰ํ•ด๋ณด์„ธ์š”.",
shape: .round,
focusState: $focused,
equals: true,
Expand Down
Loading