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.8 #176

Merged
merged 69 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e1971ce
[feat] #170 ์•ฑ ์•„์ด์ฝ˜ ์ˆ˜์ •
stealmh Dec 23, 2024
a15bbe5
[fix] #173 ์นดํ…Œ๊ณ ๋ฆฌ ํƒ€์ž… ๋ณ„ ๋ฒ„ํŠผ ์ˆ˜์ •
stealmh Dec 24, 2024
ff76220
[fix] #173 ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋ฒ„๊ทธ ์ˆ˜์ •
stealmh Dec 24, 2024
7b54e85
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋กœ์ง ์—ฐ๊ฒฐ
stealmh Dec 24, 2024
1507126
[fix] #173 ํŽธ์ง‘ํ•˜๊ธฐ ์กฐ๊ฑด ์ˆ˜์ •
stealmh Dec 24, 2024
63f64da
[feat] navigationBar View Modifier autoclosure ๋ฒ„์ „ ์ถ”๊ฐ€
stealmh Dec 24, 2024
efaa7bd
[fix] ๋ฏธ๋ถ„๋ฅ˜ ์นดํ…Œ๊ณ ๋ฆฌ ํŽธ์ง‘์—์„œ card action ๋ฐ›์ง€ ๋ชปํ•˜๊ฒŒ ์ˆ˜์ •
stealmh Dec 24, 2024
fbde1ca
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋ฒ„ํŠผ ์•ก์…˜ ์ถ”๊ฐ€
stealmh Dec 24, 2024
150abb8
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ์ฒดํฌ๊ธฐ๋Šฅ ๋ฐ ํ™”๋ฉด๋ฆฌ์ŠคํŠธ ๊ตฌ์„ฑ
stealmh Dec 24, 2024
9f03692
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋ทฐ ๊ตฌ์„ฑ
stealmh Dec 24, 2024
12c881a
[feat] ๋ฒ„์ „์—…
stealmh Dec 24, 2024
6c58108
[feat] #173 ๋’ค๋กœ๊ฐ€๊ธฐ ์•ก์…˜ ์ถ”๊ฐ€
stealmh Dec 27, 2024
b29db98
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ float button ๊ตฌ์„ฑ
stealmh Dec 27, 2024
bc02bdc
[fix] print ์ œ๊ฑฐ
stealmh Dec 27, 2024
b97a2cc
[fix] ๋ ˆ์ด์•„์›ƒ ์ˆ˜์ •
stealmh Dec 27, 2024
30a5ebe
[feat] #173 Float Button Delegate ์—ฐ๊ฒฐ
stealmh Dec 27, 2024
db7cd34
[feat] #173 ์นดํ…Œ๊ณ ๋ฆฌ ์ถ”๊ฐ€ ์‹œํŠธ ๊ตฌ์„ฑ
stealmh Dec 27, 2024
dce66c9
[feat] #173 ํฌํ‚ท์ด๋™์„ ์œ„ํ•œ ์‹œํŠธ ์—ฐ๊ฒฐ
stealmh Dec 27, 2024
01e9ab7
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ ์ด๋™ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 29, 2024
e8c1b86
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ ์‚ญ์ œ API ์ถ”๊ฐ€
stealmh Dec 30, 2024
afa8175
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋กœ์ง ์ˆ˜์ •
stealmh Dec 30, 2024
38543a0
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋กœ์ง ๊ตฌ์„ฑ
stealmh Dec 30, 2024
85ccf27
[refactor] #173 PokitSelect์— PokitSelectSheet ์ ์šฉ
ShapeKim98 Dec 30, 2024
89a15d8
[fix] Perception Error ์ˆ˜์ •
stealmh Dec 30, 2024
5e7ba2a
[fix] #173 Perception Error ์ˆ˜์ • @ShapeKim98
stealmh Dec 30, 2024
3c2eaf1
[feat] #173 ๋ฒ„์ „ ์ฒดํฌ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 30, 2024
0e1f322
[style] ์ปจ๋ฒค์…˜ ์ˆ˜์ •
stealmh Dec 30, 2024
e2043d1
[feat] ์•ฑ ์•„์ด์ฝ˜ ์ˆ˜์ •
stealmh Dec 30, 2024
9dc3ce4
[feat] #173 ํŽธ์ง‘ํ•  ๋งํฌ๊ฐ€ ์—†์„ ์‹œ ์ข…๋ฃŒ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 30, 2024
8e98617
[fix] ๋งํฌ ๋น„์–ด์žˆ์„ ๋•Œ ๋กœ์ง ์ข…๋ฃŒ ์ˆ˜์ •
stealmh Dec 30, 2024
2cbc352
[refactor] #173 ๋งํฌ ํŽธ์ง‘ ๊ฐœ์„ 
stealmh Dec 30, 2024
0e70873
[feat] #173 ๋ฒ„์ „ ์ฒดํฌ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ์ถ”๊ฐ€
stealmh Dec 31, 2024
92457c1
[fix] ๋ถˆํ•„์š” ์ฝ”๋“œ ์‚ญ์ œ
stealmh Jan 1, 2025
6dc892d
[feat] Dependency openURL ๋ฆฌํŒฉํ† ๋ง
stealmh Jan 1, 2025
df599a0
Merge branch 'main' into develop
stealmh Jan 2, 2025
143d68c
[fix] #173 ์นดํ…Œ๊ณ ๋ฆฌ ํƒ€์ž… ๋ณ„ ๋ฒ„ํŠผ ์ˆ˜์ •
stealmh Dec 24, 2024
023384b
[fix] #173 ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋ฒ„๊ทธ ์ˆ˜์ •
stealmh Dec 24, 2024
b2e72c3
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋กœ์ง ์—ฐ๊ฒฐ
stealmh Dec 24, 2024
ffa786a
[fix] #173 ํŽธ์ง‘ํ•˜๊ธฐ ์กฐ๊ฑด ์ˆ˜์ •
stealmh Dec 24, 2024
5e828fc
[feat] navigationBar View Modifier autoclosure ๋ฒ„์ „ ์ถ”๊ฐ€
stealmh Dec 24, 2024
0a06b98
[fix] ๋ฏธ๋ถ„๋ฅ˜ ์นดํ…Œ๊ณ ๋ฆฌ ํŽธ์ง‘์—์„œ card action ๋ฐ›์ง€ ๋ชปํ•˜๊ฒŒ ์ˆ˜์ •
stealmh Dec 24, 2024
24f763e
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋ฒ„ํŠผ ์•ก์…˜ ์ถ”๊ฐ€
stealmh Dec 24, 2024
b0de1e1
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ์ฒดํฌ๊ธฐ๋Šฅ ๋ฐ ํ™”๋ฉด๋ฆฌ์ŠคํŠธ ๊ตฌ์„ฑ
stealmh Dec 24, 2024
b22c93e
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋ทฐ ๊ตฌ์„ฑ
stealmh Dec 24, 2024
593560f
[feat] ๋ฒ„์ „์—…
stealmh Dec 24, 2024
28e97cc
[feat] #173 ๋’ค๋กœ๊ฐ€๊ธฐ ์•ก์…˜ ์ถ”๊ฐ€
stealmh Dec 27, 2024
081287e
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ float button ๊ตฌ์„ฑ
stealmh Dec 27, 2024
d7dcb30
[fix] print ์ œ๊ฑฐ
stealmh Dec 27, 2024
b757df5
[fix] ๋ ˆ์ด์•„์›ƒ ์ˆ˜์ •
stealmh Dec 27, 2024
9b02062
[feat] #173 Float Button Delegate ์—ฐ๊ฒฐ
stealmh Dec 27, 2024
758780c
[feat] #173 ์นดํ…Œ๊ณ ๋ฆฌ ์ถ”๊ฐ€ ์‹œํŠธ ๊ตฌ์„ฑ
stealmh Dec 27, 2024
1bf19ef
[feat] #173 ํฌํ‚ท์ด๋™์„ ์œ„ํ•œ ์‹œํŠธ ์—ฐ๊ฒฐ
stealmh Dec 27, 2024
b5922dd
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ ์ด๋™ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 29, 2024
c42ed24
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ ์‚ญ์ œ API ์ถ”๊ฐ€
stealmh Dec 30, 2024
b5ca936
[feat] #173 ๋ฏธ๋ถ„๋ฅ˜ ๋กœ์ง ์ˆ˜์ •
stealmh Dec 30, 2024
be8a56f
[feat] #173 ํŽธ์ง‘ํ•˜๊ธฐ ๋กœ์ง ๊ตฌ์„ฑ
stealmh Dec 30, 2024
a2b56c1
[refactor] #173 PokitSelect์— PokitSelectSheet ์ ์šฉ
ShapeKim98 Dec 30, 2024
d757c24
[fix] Perception Error ์ˆ˜์ •
stealmh Dec 30, 2024
c835703
[fix] #173 Perception Error ์ˆ˜์ • @ShapeKim98
stealmh Dec 30, 2024
0833296
[feat] #173 ๋ฒ„์ „ ์ฒดํฌ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 30, 2024
fd65a21
[style] ์ปจ๋ฒค์…˜ ์ˆ˜์ •
stealmh Dec 30, 2024
4d16cb4
[feat] ์•ฑ ์•„์ด์ฝ˜ ์ˆ˜์ •
stealmh Dec 30, 2024
7208f80
[feat] #173 ํŽธ์ง‘ํ•  ๋งํฌ๊ฐ€ ์—†์„ ์‹œ ์ข…๋ฃŒ ๋กœ์ง ์ถ”๊ฐ€
stealmh Dec 30, 2024
1a47fa7
[fix] ๋งํฌ ๋น„์–ด์žˆ์„ ๋•Œ ๋กœ์ง ์ข…๋ฃŒ ์ˆ˜์ •
stealmh Dec 30, 2024
f5a9630
[refactor] #173 ๋งํฌ ํŽธ์ง‘ ๊ฐœ์„ 
stealmh Dec 30, 2024
3194f4a
[feat] #173 ๋ฒ„์ „ ์ฒดํฌ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ์ถ”๊ฐ€
stealmh Dec 31, 2024
6eb43b5
[fix] ๋ถˆํ•„์š” ์ฝ”๋“œ ์‚ญ์ œ
stealmh Jan 1, 2025
ccedc2d
[feat] Dependency openURL ๋ฆฌํŒฉํ† ๋ง
stealmh Jan 1, 2025
84b1637
Merge branch 'develop' of https://github.com/YAPP-Github/Pokit-iOS inโ€ฆ
stealmh Jan 4, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.7</string>
<string>1.0.8</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ContentDeleteRequest.swift
// CoreKit
//
// Created by asobi on 12/30/24.
//

import Foundation
/// ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ ์‚ญ์ œ
public struct ContentDeleteRequest: Encodable {
let contentId: [Int]

public init(contentId: [Int]) {
self.contentId = contentId
}
}

extension ContentDeleteRequest {
public static let mock: Self = Self(contentId: [551321312,4333333])
}
21 changes: 21 additions & 0 deletions Projects/CoreKit/Sources/Data/DTO/Content/ContentMoveRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// ContentMoveRequest.swift
// CoreKit
//
// Created by ๊น€๋ฏผํ˜ธ on 12/29/24.
//
import Foundation
/// ๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ๋ฅผ ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ์ด๋™
public struct ContentMoveRequest: Encodable {
let contentIds: [Int]
let categoryId: Int

public init(contentIds: [Int], categoryId: Int) {
self.contentIds = contentIds
self.categoryId = categoryId
}
}

extension ContentMoveRequest {
public static let mock: Self = Self(contentIds: [123,456], categoryId: 444)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import Foundation

public struct VersionResponse: Decodable {
public let recentVersion: String
public let results: [VersionDTO]
}

public struct VersionDTO: Decodable {
public let version: String
public let trackId: Int
}

extension VersionResponse {
static let mock: Self = Self(recentVersion: "1.0.0")
static let mock: Self = Self(results: [VersionDTO(version: "1.0.0", trackId: 2415354644)])
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ extension ContentClient: DependencyKey {
try await provider.requestNoBody(
.์ธ๋„ค์ผ_์ˆ˜์ •(contentId: id, model: model)
)
},
๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™: { model in
try await provider.requestNoBody(.๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™(model: model))
},
๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ: { model in
try await provider.requestNoBody(.๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ(model: model))
}
)
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ extension ContentClient: TestDependencyKey {
์นดํ…Œ๊ณ ๋ฆฌ_๋‚ด_์ปจํ…์ธ _๋ชฉ๋ก_์กฐํšŒ: { _, _, _ in .mock },
๋ฏธ๋ถ„๋ฅ˜_์นดํ…Œ๊ณ ๋ฆฌ_์ปจํ…์ธ _์กฐํšŒ: { _ in .mock },
์ปจํ…์ธ _๊ฒ€์ƒ‰: { _, _ in .mock },
์ธ๋„ค์ผ_์ˆ˜์ •: { _, _ in }
์ธ๋„ค์ผ_์ˆ˜์ •: { _, _ in },
๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™: { _ in },
๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ: { _ in }
)
}()
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ public struct ContentClient {
_ contentId: String,
_ model: ThumbnailRequest
) async throws -> Void
public var ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™: @Sendable (
_ model: ContentMoveRequest
) async throws -> Void
public var ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ: @Sendable (
_ model: ContentDeleteRequest
) async throws -> Void
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public enum ContentEndpoint {
condition: BaseConditionRequest
)
case ์ธ๋„ค์ผ_์ˆ˜์ •(contentId: String, model: ThumbnailRequest)
case ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™(model: ContentMoveRequest)
case ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ(model: ContentDeleteRequest)
}

extension ContentEndpoint: TargetType {
Expand Down Expand Up @@ -57,13 +59,18 @@ extension ContentEndpoint: TargetType {
return ""
case let .์ธ๋„ค์ผ_์ˆ˜์ •(contentId, _):
return "/thumbnail/\(contentId)"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™:
return ""
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ:
return "/uncategorized"
}
}

public var method: Moya.Method {
switch self {
case .์ปจํ…์ธ _์‚ญ์ œ,
.์ฆ๊ฒจ์ฐพ๊ธฐ_์ทจ์†Œ:
.์ฆ๊ฒจ์ฐพ๊ธฐ_์ทจ์†Œ,
.๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ:
return .put

case .์ปจํ…์ธ _์ƒ์„ธ_์กฐํšŒ,
Expand All @@ -72,7 +79,8 @@ extension ContentEndpoint: TargetType {
return .post

case .์ปจํ…์ธ _์ˆ˜์ •,
.์ธ๋„ค์ผ_์ˆ˜์ •:
.์ธ๋„ค์ผ_์ˆ˜์ •,
.๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™:
return .patch

case .์นดํƒœ๊ณ ๋ฆฌ_๋‚ด_์ปจํ…์ธ _๋ชฉ๋ก_์กฐํšŒ,
Expand Down Expand Up @@ -135,6 +143,12 @@ extension ContentEndpoint: TargetType {
)
case let .์ธ๋„ค์ผ_์ˆ˜์ •(_, model):
return .requestJSONEncodable(model)

case let .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_ํฌํ‚ท_์ด๋™(model):
return .requestJSONEncodable(model)

case let .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ_์‚ญ์ œ(model):
return .requestJSONEncodable(model)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public enum VersionEndpoint {

extension VersionEndpoint: TargetType {
public var baseURL: URL {
return Constants.serverURL.appendingPathComponent(Constants.versionPath, conformingTo: .url)
let bundleID = Bundle.main.bundleIdentifier ?? ""
let countryCode = Locale.current.language.region?.identifier ?? ""
return URL(string: "https://itunes.apple.com/lookup?bundleId=\(bundleID)&country=\(countryCode)")!
}

public var path: String {
Expand Down
14 changes: 10 additions & 4 deletions Projects/DSKit/Sources/Components/PokitLinkCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
private let link: Item
private let state: PokitLinkCard.State
private let type: PokitLinkCard.CardType
private let action: () -> Void
private let action: (() -> Void)?
private let kebabAction: (() -> Void)?
private let fetchMetaData: (() -> Void)?
private let favoriteAction: (() -> Void)?
Expand All @@ -24,7 +24,7 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
link: Item,
state: PokitLinkCard.State,
type: PokitLinkCard.CardType = .accept,
action: @escaping () -> Void,
action: (() -> Void)? = nil,
kebabAction: (() -> Void)? = nil,
fetchMetaData: (() -> Void)? = nil,
favoriteAction: (() -> Void)? = nil,
Expand All @@ -42,8 +42,14 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {

public var body: some View {
VStack(spacing: 20) {
Button(action: action) {
buttonLabel
Group {
if let action {
Button(action: { action() }) {
buttonLabel
}
} else {
buttonLabel
}
}
.padding(.top, state == .top ? 0 : 20)

Expand Down
74 changes: 12 additions & 62 deletions Projects/DSKit/Sources/Components/PokitSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
}
.onChange(of: selectedItem) { onChangedSeletedItem($0) }
.sheet(isPresented: $showSheet) {
listSheet
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.height(564)])
.pokitPresentationBackground()
PokitSelectSheet(
list: list,
itemSelected: { item in
listDismiss()
action(item)
},
pokitAddAction: addAction
)
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.height(564)])
.pokitPresentationBackground()
}
}

Expand Down Expand Up @@ -96,63 +103,6 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
.animation(.pokitDissolve, value: self.state)
}

private var listSheet: some View {
Group {
if let list {
VStack(spacing: 0) {
if let addAction {
addButton {
listDismiss()
addAction()
}
}

PokitList(
selectedItem: selectedItem,
list: list
) { item in
action(item)
listCellTapped(item)
}
}
.padding(.top, 12)
.padding(.bottom, 20)
} else {
PokitLoading()
}
}
}

@ViewBuilder
private func addButton(
action: @escaping () -> Void
) -> some View {
Button(action: action) {
HStack(spacing: 20) {
PokitIconButton(
.icon(.plusR),
state: .default(.secondary),
size: .medium,
shape: .round,
action: action
)

Text("ํฌํ‚ท ์ถ”๊ฐ€ํ•˜๊ธฐ")
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))

Spacer()
}
.padding(.vertical, 22)
.padding(.horizontal, 30)
.background(alignment: .bottom) {
Rectangle()
.fill(.pokit(.border(.tertiary)))
.frame(height: 1)
}
}
}

private func partSelectButtonTapped() {
showSheet = true
}
Expand Down
87 changes: 87 additions & 0 deletions Projects/DSKit/Sources/Components/PokitSelectSheet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//
// PokitSelectSheet.swift
// DSKit
//
// Created by ๊น€๋ฏผํ˜ธ on 12/27/24.
//

import SwiftUI
import Util


public struct PokitSelectSheet<Item: PokitSelectItem>: View {
@Binding
private var selectedItem: Item?

private let list: [Item]?
private let itemSelected: (Item) -> Void
private let pokitAddAction: (() -> Void)?

public init(
list: [Item]?,
selectedItem: Binding<Item?> = .constant(nil),
itemSelected: @escaping (Item) -> Void,
pokitAddAction: (() -> Void)?
) {
self.list = list
self._selectedItem = selectedItem
self.itemSelected = itemSelected
self.pokitAddAction = pokitAddAction
}


public var body: some View {
Group {
if let list {
VStack(spacing: 0) {
if let pokitAddAction {
addButton {
pokitAddAction()
}
}
PokitList(
selectedItem: selectedItem,
list: list
) { item in
itemSelected(item)
}
}
.padding(.top, 12)
.padding(.bottom, 20)
} else {
PokitLoading()
}
}
}
}
extension PokitSelectSheet {
@ViewBuilder
private func addButton(
action: @escaping () -> Void
) -> some View {
Button(action: action) {
HStack(spacing: 20) {
PokitIconButton(
.icon(.plusR),
state: .default(.secondary),
size: .medium,
shape: .round,
action: action
)

Text("ํฌํ‚ท ์ถ”๊ฐ€ํ•˜๊ธฐ")
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))

Spacer()
}
.padding(.vertical, 22)
.padding(.horizontal, 30)
.background(alignment: .bottom) {
Rectangle()
.fill(.pokit(.border(.tertiary)))
.frame(height: 1)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ public extension View {
func pokitNavigationBar<Header: View>(@ViewBuilder header: () -> Header) -> some View {
modifier(PokitNavigationBarModifier(header: header))
}

func pokitNavigationBar<Header: View>(_ header: @autoclosure () -> Header) -> some View {
modifier(PokitNavigationBarModifier(header: header))
}
}
Loading
Loading