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

feat: 포킷 모듈 기능 추가 및 수정 #182

Merged
merged 21 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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 .github/workflows/appstore_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
xcode-version: '16.1'

- uses: shimataro/ssh-key-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
xcode-version: '16.1'

- uses: shimataro/ssh-key-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testflight_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
xcode-version: '16.1'

- uses: shimataro/ssh-key-action@v2
with:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ test:
make clean
make download
tuist install
tuist cache
TUIST_DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) tuist generate App
TUIST_DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) tuist generate App --verbose

clean:
tuist clean
Expand Down
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.8</string>
<string>2.0.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
4 changes: 4 additions & 0 deletions Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ public extension MainTabFeature {
let .path(.element(_, action: .포킷추가및수정(.delegate(.linkCopyDetected(url))))),
let .path(.element(_, action: .링크목록(.delegate(.linkCopyDetected(url))))):
return .run { send in await send(.inner(.linkCopySuccess(url)), animation: .pokitSpring) }
/// 바텀메세지
case let .pokit(.delegate(.linkPopup(text))):
state.linkPopup = .text(title: text)
return .none
/// 링크목록 `안읽음`
case .remind(.delegate(.링크목록_안읽음)):
state.path.append(.링크목록(ContentListFeature.State(contentType: .unread)))
Expand Down
Empty file.
8 changes: 0 additions & 8 deletions Projects/CoreKit/Resources/Resource.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public struct CategoryItemInquiryResponse: Decodable {
public let categoryImage: CategoryImageResponse
public let contentCount: Int
public let createdAt: String
public let openType: String
public let keywordType: String
public let userCount: Int
}
/// Sort
public struct ItemInquirySortResponse: Decodable {
Expand All @@ -45,7 +48,10 @@ public extension CategoryItemInquiryResponse {
imageUrl: Constants.mockImageUrl
),
contentCount: 90,
createdAt: ""
createdAt: "",
openType: "PRIVATE",
keywordType: "스포츠/레저",
userCount: 0
)
}

Expand All @@ -61,7 +67,10 @@ extension CategoryListInquiryResponse {
imageUrl: Constants.mockImageUrl
),
contentCount: 90,
createdAt: ""
createdAt: "",
openType: "PRIVATE",
keywordType: "스포츠/레저",
userCount: 0
),
CategoryItemInquiryResponse(
categoryId: 2,
Expand All @@ -72,7 +81,10 @@ extension CategoryListInquiryResponse {
imageUrl: Constants.mockImageUrl
),
contentCount: 90,
createdAt: ""
createdAt: "",
openType: "PUBLIC",
keywordType: "스포츠/레저",
userCount: 1
),
CategoryItemInquiryResponse(
categoryId: 3,
Expand All @@ -83,7 +95,10 @@ extension CategoryListInquiryResponse {
imageUrl: Constants.mockImageUrl
),
contentCount: 90,
createdAt: ""
createdAt: "",
openType: "PUBLIC",
keywordType: "스포츠/레저",
userCount: 5
)
],
page: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ public struct CategoryClient {
_ categoryId: Int,
_ model: CategoryEditRequest
) async throws -> CategoryEditResponse
public var 카테고리_목록_조회: @Sendable (_ model: BasePageableRequest, _ filterUncategorized: Bool) async throws -> CategoryListInquiryResponse
public var 카테고리_목록_조회: @Sendable (
_ model: BasePageableRequest,
_ filterUncategorized: Bool
) async throws -> CategoryListInquiryResponse
public var 카테고리_생성: @Sendable (
_ model: CategoryEditRequest
) async throws -> CategoryEditResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ public enum CategoryEndpoint {

extension CategoryEndpoint: TargetType {
public var baseURL: URL {
return Constants.serverURL.appendingPathComponent(Constants.categoryPath, conformingTo: .url)
switch self {
case .카테고리_목록_조회, .카테고리생성, .카테고리_수정:
return Constants.serverURL.appendingPathComponent(Constants.categoryPathV2, conformingTo: .url)

default:
return Constants.serverURL.appendingPathComponent(Constants.categoryPath, conformingTo: .url)
}
}

public var path: String {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "tack.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 34 additions & 8 deletions Projects/DSKit/Sources/Components/PokitCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
import Util
import NukeUI

public struct PokitCard<Item: PokitCardItem>: View {
public struct PokitCard<Item: PokitCardItem & Shareable>: View {
private let category: Item
private let action: () -> Void
private let kebabAction: () -> Void
Expand Down Expand Up @@ -66,10 +66,22 @@ public struct PokitCard<Item: PokitCardItem>: View {
.frame(height: 152)
}

@ViewBuilder
private var title: some View {
Text(category.categoryName)
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))
let isPrivate = category.openType == .비공개

HStack(spacing: isPrivate ? 2 : 0) {
if isPrivate {
Image(.icon(.lock))
.resizable()
.frame(width: 18, height: 18)
.padding(.vertical, 3)
.foregroundStyle(.pokit(.icon(.tertiary)))
}
Text(category.categoryName)
.pokitFont(.b1(.b))
.foregroundStyle(.pokit(.text(.primary)))
}
}

private var kebabButton: some View {
Expand All @@ -81,11 +93,25 @@ public struct PokitCard<Item: PokitCardItem>: View {
}
}

@ViewBuilder
private var subTitle: some View {
Text("링크 \(category.contentCount)개")
.pokitFont(.detail2)
.foregroundStyle(.pokit(.text(.tertiary)))
.contentTransition(.numericText())
let isShared = category.userCount > 1

HStack(spacing: 2) {
Text("링크 \(category.contentCount)개")
.contentTransition(.numericText())

if isShared {
Text("•")
.pokitFont(.detail2)
Image(.iconMember)
.resizable()
.frame(width: 16, height: 16)
Text("\(category.userCount)명")
}
}
.pokitFont(.detail2)
.foregroundStyle(.pokit(.text(.tertiary)))
}

@MainActor
Expand Down
11 changes: 9 additions & 2 deletions Projects/DSKit/Sources/Components/PokitLinkPopup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public struct PokitLinkPopup: View {
VStack(alignment: .leading, spacing: 0) {
Text(title)
.lineLimit(2)
.pokitFont(.b2(.b))
.pokitFont(titleFont)
.multilineTextAlignment(.leading)
.foregroundStyle(textColor)

Expand All @@ -76,7 +76,7 @@ public struct PokitLinkPopup: View {
.foregroundStyle(.pokit(.icon(.inverseWh)))
}

Spacer(minLength: 72)
Spacer()
}

closeButton
Expand Down Expand Up @@ -151,6 +151,13 @@ public struct PokitLinkPopup: View {
}
}

private var titleFont: PokitFont {
switch type {
case .link: return .b2(.b)
default: return .b3(.b)
}
}

private var title: String {
switch type {
case let .link(title, _),
Expand Down
3 changes: 3 additions & 0 deletions Projects/DSKit/Sources/Foundation/PokitImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public enum PokitImage {
return DSKitAsset.iconAlluncheck.swiftUIImage
case .report:
return DSKitAsset.iconReport.swiftUIImage
case .tack:
return DSKitAsset.iconTack.swiftUIImage
}
case .logo(let name):
switch name {
Expand Down Expand Up @@ -174,6 +176,7 @@ public extension PokitImage {
case allCheck
case allUncheck
case report
case tack
}

enum Logo {
Expand Down
Empty file.
8 changes: 0 additions & 8 deletions Projects/Domain/Resources/Resource.swift

This file was deleted.

13 changes: 11 additions & 2 deletions Projects/Domain/Sources/Base/BaseCategoryItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,36 @@ import Foundation

import Util

public struct BaseCategoryItem: Identifiable, Equatable, PokitSelectItem, PokitCardItem, Sortable {
public struct BaseCategoryItem: Identifiable, Equatable, PokitSelectItem, PokitCardItem, Sortable, Shareable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프로토콜이...ㅋㅋ POP 열심히 공부해서 개선해보겠습니다...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인정합니다....
Sortable은 이제 필요가 없어졌고, PokitSelectItem과 PokitCardItem은 이름만 다르고 똑같던데 빨리돌아와주세요

public let id: Int
public let userId: Int
public let categoryName: String
public let categoryImage: BaseCategoryImage
public var contentCount: Int
public let createdAt: String
public let openType: BaseOpenType
public let keywordType: BaseInterestType
public let userCount: Int

public init(
id: Int,
userId: Int,
categoryName: String,
categoryImage: BaseCategoryImage,
contentCount: Int,
createdAt: String
createdAt: String,
openType: BaseOpenType,
keywordType: BaseInterestType,
userCount: Int
) {
self.id = id
self.userId = userId
self.categoryName = categoryName
self.categoryImage = categoryImage
self.contentCount = contentCount
self.createdAt = createdAt
self.openType = openType
self.keywordType = keywordType
self.userCount = userCount
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation

import CoreKit
import Util

public extension CategoryListInquiryResponse {
func toDomain() -> BaseCategoryListInquiry {
Expand All @@ -29,7 +30,10 @@ public extension CategoryItemInquiryResponse {
categoryName: self.categoryName,
categoryImage: self.categoryImage.toDomain(),
contentCount: self.contentCount,
createdAt: self.createdAt
createdAt: self.createdAt,
openType: BaseOpenType(rawValue: self.openType) ?? .비공개,
keywordType: BaseInterestType(rawValue: self.keywordType) ?? .default,
userCount: self.userCount
)
}
}
Expand Down
Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ private extension CategoryDetailView {
categoryName: "포킷",
categoryImage: .init(imageId: 0, imageURL: ""),
contentCount: 16,
createdAt: ""
createdAt: "",
//TODO: v2 property 수정
openType: .비공개,
keywordType: .IT,
userCount: 0
)
),
reducer: { CategoryDetailFeature() }
Expand Down
Empty file.

This file was deleted.

Loading