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: 1.0.6 버전 업데이트에 따른 기능 추가 및 수정 #166

Merged
merged 31 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e1dde9c
[feat] #157 링크 추가에서 링크 미리보기 스켈레톤 ui 적용
ShapeKim98 Nov 29, 2024
719458d
[desing] #157 PokitIconInput 수정
ShapeKim98 Nov 29, 2024
d46d052
[feat] #157 링크추가에 텍스트 지우기 버튼 추가
ShapeKim98 Nov 29, 2024
0b20da1
[design] #157 PokitTextInput으로 통일
ShapeKim98 Nov 29, 2024
b7a7b72
[remove] #157 PokitIconInput 제거
ShapeKim98 Nov 29, 2024
416b2b0
[feat] #157 닉네임 수정에 닉네임 지우기 버튼 추가
ShapeKim98 Nov 29, 2024
1ff6183
[design] #157 링크 추가에서 포킷 추가 버튼 변경사항 반영
ShapeKim98 Nov 29, 2024
c4878b6
[refactor] #157 PokitLinkPopup 리팩토링
ShapeKim98 Nov 30, 2024
9f85b99
[feat] #157 링크팝업 핸들링 변경사항 반영
ShapeKim98 Nov 30, 2024
030a627
[feat] #157 카테고리 상세에서 링크 상세 플로우 변경사항 반영
ShapeKim98 Nov 30, 2024
c7752ca
[feat] #157 컨텐츠목록에서 링크상세 플로우 변경사항 적용
ShapeKim98 Nov 30, 2024
bb8974c
[feat] #157 컨텐츠 검색에서 링크 상세 플로우 변경사항 반영
ShapeKim98 Nov 30, 2024
1cb5ff9
[feat] #157 리마인드에서 링크 상세 플로우 변경사항 반영
ShapeKim98 Nov 30, 2024
9e8b2af
[fix] #157 추천 항목 텍스트 잘리는 문제 수정
ShapeKim98 Nov 30, 2024
47f8bba
[feat] #157 컨텐츠 항목 눌렀을때 플로우 변경사항 반영
ShapeKim98 Nov 30, 2024
4591cad
[chore] #157 코드 정리
ShapeKim98 Nov 30, 2024
72cfdbb
[feat] #157 PokitListButton 추가
ShapeKim98 Dec 1, 2024
4ae7e46
[feat] #157 컨텐츠 상세 변경사항 반영
ShapeKim98 Dec 1, 2024
e88aeaa
[feat] #157 ContentCard에 즐겨찾기 수정 기능 추가
ShapeKim98 Dec 1, 2024
41bccb1
[feat] #157 재파싱한 이미지 수정 API 구현
ShapeKim98 Dec 1, 2024
b761afb
[feat] #157 포킷에 컨텐츠 상세 플로우 변경사항 적용
ShapeKim98 Dec 1, 2024
afd78a5
[fix] #157 ContentCardFeature 스레드 안정성 문제 수정
ShapeKim98 Dec 2, 2024
c5d1a40
[fix] #157 ContentCardView 타입 변경
ShapeKim98 Dec 2, 2024
75f54da
[feat] #157 카테고리 수정/추가에서 포킷명 지우기 추가
ShapeKim98 Dec 2, 2024
e235db4
[fix] #157 빈 문자시 지우기 버튼 비활성화
ShapeKim98 Dec 2, 2024
e47c781
[design] #157 컨텐츠 추가/수정 로딩 전환 애니메이션 추가
ShapeKim98 Dec 2, 2024
3febcd5
[chore] #157 햅틱 피드백 수정 및 추가
ShapeKim98 Dec 2, 2024
87bdb49
[design] #157 컨텐츠 상세 메모 높이 수정
ShapeKim98 Dec 2, 2024
317067b
[fix] #157 상태에 따른 배경, border 색 잘못나오는 문제 수정
ShapeKim98 Dec 2, 2024
a2a407e
[design] #157 컨텐츠 상세 로딩 전환 애니메이션 추가
ShapeKim98 Dec 2, 2024
5f42240
[refactor] #157 피드백 반영
ShapeKim98 Dec 4, 2024
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
40 changes: 34 additions & 6 deletions Projects/App/Sources/MainTab/MainTabFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import FeaturePokit
import FeatureRemind
import FeatureContentDetail
import Domain
import DSKit
import Util
import CoreKit

Expand All @@ -28,7 +29,7 @@ public struct MainTabFeature {
public struct State: Equatable {
var selectedTab: MainTab = .pokit
var isBottomSheetPresented: Bool = false
var isLinkSheetPresented: Bool = false
var linkPopup: PokitLinkPopup.PopupType?
var isErrorSheetPresented: Bool = false
var link: String?

Expand All @@ -40,6 +41,7 @@ public struct MainTabFeature {
@Presents var contentDetail: ContentDetailFeature.State?
@Shared(.inMemory("SelectCategory")) var categoryId: Int?
@Shared(.inMemory("PushTapped")) var isPushTapped: Bool = false
var savedContentId: Int?

public init() {
self.pokit = .init()
Expand All @@ -64,7 +66,7 @@ public struct MainTabFeature {
public enum View: Equatable {
case addButtonTapped
case addSheetTypeSelected(TabAddSheetType)
case linkCopyButtonTapped
case 링크팝업_버튼_눌렀을때
case onAppear
case onOpenURL(url: URL)
case 경고_확인버튼_클릭
Expand All @@ -75,6 +77,7 @@ public struct MainTabFeature {
case 공유포킷_이동(sharedCategory: CategorySharing.SharedCategory)
case 경고_띄움(BaseError)
case errorSheetPresented(Bool)
case 링크팝업_활성화(PokitLinkPopup.PopupType)
}
public enum AsyncAction: Equatable {
case 공유받은_카테고리_조회(categoryId: Int)
Expand All @@ -93,6 +96,10 @@ public struct MainTabFeature {
/// - Reducer Core
private func core(into state: inout State, action: Action) -> Effect<Action> {
switch action {
case .binding(\.linkPopup):
guard state.linkPopup == nil else { return .none }
state.savedContentId = nil
return .none
case .binding:
return .none
case let .pushAlertTapped(isTapped):
Expand Down Expand Up @@ -156,9 +163,8 @@ private extension MainTabFeature {
case .포킷추가: return .send(.delegate(.포킷추가하기))
}

case .linkCopyButtonTapped:
state.isLinkSheetPresented = false
return .run { send in await send(.delegate(.링크추가하기)) }
case .링크팝업_버튼_눌렀을때:
return linkPopupButtonTapped(state: &state)

case .onAppear:
if state.isPushTapped {
Expand Down Expand Up @@ -198,7 +204,10 @@ private extension MainTabFeature {
switch action {
case let .linkCopySuccess(url):
guard let url else { return .none }
state.isLinkSheetPresented = true
state.linkPopup = .link(
title: "복사한 링크 저장하기",
url: url.absoluteString
)
state.link = url.absoluteString
return .none

Expand All @@ -209,6 +218,10 @@ private extension MainTabFeature {
case let .errorSheetPresented(isPresented):
state.isErrorSheetPresented = isPresented
return .none

case let .링크팝업_활성화(type):
state.linkPopup = type
return .none

default: return .none
}
Expand Down Expand Up @@ -238,4 +251,19 @@ private extension MainTabFeature {
func handleDelegateAction(_ action: Action.DelegateAction, state: inout State) -> Effect<Action> {
return .none
}

func linkPopupButtonTapped(state: inout State) -> Effect<Action> {
switch state.linkPopup {
case .link:
state.linkPopup = nil
return .send(.delegate(.링크추가하기))
case .success:
state.linkPopup = nil
state.contentDetail = .init(contentId: state.savedContentId)
state.savedContentId = nil
return .none
case .error, .text, .warning, .none:
return .none
}
}
}
19 changes: 8 additions & 11 deletions Projects/App/Sources/MainTab/MainTabFeatureView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ public extension MainTabView {
}
}

if self.store.isLinkSheetPresented {
if self.store.linkPopup != nil {
PokitLinkPopup(
"복사한 링크 저장하기",
isPresented: $store.isLinkSheetPresented,
type: .link(url: self.store.link ?? ""),
action: { send(.linkCopyButtonTapped) }
type: $store.linkPopup,
action: { send(.링크팝업_버튼_눌렀을때, animation: .pokitSpring) }
)
}
}
Expand All @@ -94,12 +92,10 @@ private extension MainTabView {
tabView
.overlay(alignment: .bottom) {
VStack(spacing: 0) {
if store.isLinkSheetPresented {
if store.linkPopup != nil {
PokitLinkPopup(
"복사한 링크 저장하기",
isPresented: $store.isLinkSheetPresented,
type: .link(url: store.link ?? ""),
action: { send(.linkCopyButtonTapped) }
type: $store.linkPopup,
action: { send(.링크팝업_버튼_눌렀을때, animation: .pokitSpring) }
)
.padding(.bottom, 20)
}
Expand Down Expand Up @@ -265,7 +261,8 @@ private extension MainTabView {
}
.padding(.horizontal, 28)
.onTapGesture {
UIImpactFeedbackGenerator(style: .rigid).impactOccurred()
UIImpactFeedbackGenerator(style: .light)
.impactOccurred()
store.send(.binding(.set(\.selectedTab, tab)))
}
}
Expand Down
10 changes: 7 additions & 3 deletions Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,17 @@ public extension MainTabFeature {
return .none

/// - 링크추가 및 수정에서 저장하기 눌렀을 때
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료)))):
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료(contentId))))):
state.savedContentId = contentId
state.path.removeLast()
switch state.path.last {
case .검색:
return .send(.path(.element(id: stackElementId, action: .검색(.delegate(.컨텐츠_검색)))))
return .merge(
.send(.path(.element(id: stackElementId, action: .검색(.delegate(.컨텐츠_검색))))),
.send(.inner(.링크팝업_활성화(.success(title: "링크 저장 완료"))), animation: .pokitSpring)
)
default:
return .none
return .send(.inner(.링크팝업_활성화(.success(title: "링크 저장 완료"))), animation: .pokitSpring)
}
/// - 각 화면에서 링크 복사 감지했을 때 (링크 추가 및 수정 화면 제외)
case let .path(.element(_, action: .알림함(.delegate(.linkCopyDetected(url))))),
Expand Down
16 changes: 16 additions & 0 deletions Projects/CoreKit/Sources/Data/DTO/Content/ThumbnailRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ThumbnailRequest.swift
// CoreKit
//
// Created by 김도형 on 12/1/24.
//

import Foundation

public struct ThumbnailRequest: Encodable {
private let thumbnail: String

public init(thumbnail: String) {
self.thumbnail = thumbnail
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ extension ContentClient: DependencyKey {
condition: condition
)
)
},
썸네일_수정: { id, model in
try await provider.requestNoBody(
.썸네일_수정(contentId: id, model: model)
)
}
)
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ extension ContentClient: TestDependencyKey {
즐겨찾기_취소: { _ in },
카테고리_내_컨텐츠_목록_조회: { _, _, _ in .mock },
미분류_카테고리_컨텐츠_조회: { _ in .mock },
컨텐츠_검색: { _, _ in .mock }
컨텐츠_검색: { _, _ in .mock },
썸네일_수정: { _, _ in }
)
}()
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ public struct ContentClient {
_ pageable: BasePageableRequest,
_ condition: BaseConditionRequest
) async throws -> ContentListInquiryResponse
public var 썸네일_수정: @Sendable (
_ contentId: String,
_ model: ThumbnailRequest
) async throws -> Void
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public enum ContentEndpoint {
pageable: BasePageableRequest,
condition: BaseConditionRequest
)
case 썸네일_수정(contentId: String, model: ThumbnailRequest)
}

extension ContentEndpoint: TargetType {
Expand Down Expand Up @@ -54,6 +55,8 @@ extension ContentEndpoint: TargetType {
return "/uncategorized"
case .컨텐츠_검색:
return ""
case let .썸네일_수정(contentId, _):
return "/thumbnail/\(contentId)"
}
}

Expand All @@ -68,7 +71,8 @@ extension ContentEndpoint: TargetType {
.컨텐츠_추가:
return .post

case .컨텐츠_수정:
case .컨텐츠_수정,
.썸네일_수정:
return .patch

case .카태고리_내_컨텐츠_목록_조회,
Expand Down Expand Up @@ -129,6 +133,8 @@ extension ContentEndpoint: TargetType {
],
encoding: URLEncoding.default
)
case let .썸네일_수정(_, model):
return .requestJSONEncodable(model)
}
}

Expand Down
108 changes: 0 additions & 108 deletions Projects/DSKit/Sources/Components/PokitIconLInput.swift

This file was deleted.

Loading
Loading