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베타 QA 반영 #168

Merged
merged 14 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
20 changes: 14 additions & 6 deletions Projects/App/Sources/MainTab/MainTabFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +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?
var categoryOfSavedContent: BaseCategoryItem?

public init() {
self.pokit = .init()
Expand Down Expand Up @@ -78,6 +78,7 @@ public struct MainTabFeature {
case 경고_띄움(BaseError)
case errorSheetPresented(Bool)
case 링크팝업_활성화(PokitLinkPopup.PopupType)
case 카테고리상세_이동(category: BaseCategoryItem)
}
public enum AsyncAction: Equatable {
case 공유받은_카테고리_조회(categoryId: Int)
Expand All @@ -98,7 +99,7 @@ public struct MainTabFeature {
switch action {
case .binding(\.linkPopup):
guard state.linkPopup == nil else { return .none }
state.savedContentId = nil
state.categoryOfSavedContent = nil
return .none
case .binding:
return .none
Expand Down Expand Up @@ -222,7 +223,14 @@ private extension MainTabFeature {
case let .링크팝업_활성화(type):
state.linkPopup = type
return .none

case let .카테고리상세_이동(category):
if category.categoryName == "미분류" {
state.selectedTab = .pokit
state.path.removeAll()
return .send(.pokit(.delegate(.미분류_카테고리_활성화)))
}
state.path.append(.카테고리상세(.init(category: category)))
return .none
Comment on lines +226 to +233
Copy link
Member

@stealmh stealmh Dec 10, 2024

Choose a reason for hiding this comment

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

유저마다 미분류 id값이 다르다면 저희가 할 수 있는 최선은 Constants로 빼내는것이긴 한데 ...
단순 문자열로 비교는 좀 별로긴하네요 서버쪽에서 해결해줘야 할 것 같아요..😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

일단 어떻게 하면 좋을까여

Copy link
Member

Choose a reason for hiding this comment

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

일단 스테이..

default: return .none
}
}
Expand Down Expand Up @@ -259,9 +267,9 @@ private extension MainTabFeature {
return .send(.delegate(.링크추가하기))
case .success:
state.linkPopup = nil
state.contentDetail = .init(contentId: state.savedContentId)
state.savedContentId = nil
return .none
guard let category = state.categoryOfSavedContent else { return .none }
state.categoryOfSavedContent = nil
return .send(.inner(.카테고리상세_이동(category: category)))
case .error, .text, .warning, .none:
return .none
}
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public extension MainTabFeature {

/// - 링크추가 및 수정에서 저장하기 눌렀을 때
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료(contentId))))):
state.savedContentId = contentId
state.categoryOfSavedContent = contentId
state.path.removeLast()
switch state.path.last {
case .검색:
Expand Down
8 changes: 1 addition & 7 deletions Projects/DSKit/Sources/Components/PokitBadge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@ public struct PokitBadge: View {
.background {
RoundedRectangle(cornerRadius: 4, style: .continuous)
.fill(backgroundColor)
.overlay {
if state == .unRead {
RoundedRectangle(cornerRadius: 4, style: .continuous)
.stroke(.pokit(.border(.brand)), lineWidth: 1)
}
}
}
}

private var backgroundColor: Color {
switch self.state {
case .default, .small, .memo, .member: return .pokit(.bg(.primary))
case .unCategorized: return .pokit(.color(.grayScale(._50)))
case .unRead: return .pokit(.bg(.base))
case .unRead: return Color(red: 1, green: 0.95, blue: 0.92)
}
}

Expand Down
8 changes: 4 additions & 4 deletions Projects/DSKit/Sources/Components/PokitLinkCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
let isUnCategorized = link.categoryName == "미분류"

HStack(spacing: 6) {
if let isRead = link.isRead, !isRead {
PokitBadge(state: .unRead)
}

PokitBadge(
state: isUnCategorized
? .unCategorized
: .default(link.categoryName)
)

if let isRead = link.isRead, !isRead {
PokitBadge(state: .unRead)
}

if let memo = link.memo, !memo.isEmpty {
PokitBadge(state: .memo)
}
Expand Down
18 changes: 10 additions & 8 deletions Projects/DSKit/Sources/Components/PokitLinkPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import SwiftUI

import Util
import NukeUI

public struct PokitLinkPreview: View {
Expand All @@ -33,7 +34,6 @@ public struct PokitLinkPreview: View {
}
}


private var buttonLabel: some View {
HStack(spacing: 16) {
Group {
Expand All @@ -54,18 +54,13 @@ public struct PokitLinkPreview: View {
.background {
RoundedRectangle(cornerRadius: 12, style: .continuous)
.fill(.pokit(.bg(.base)))
.shadow(color: .black.opacity(0.06), radius: 3, x: 2, y: 2)
}
.overlay {
RoundedRectangle(cornerRadius: 12, style: .continuous)
.stroke(.pokit(.border(.tertiary)), lineWidth: 1)
}
.shadow(color: .black.opacity(0.06), radius: 3, x: 2, y: 2)
.onAppear {
withAnimation {
UINotificationFeedbackGenerator()
.notificationOccurred(.success)
}
}
.onChange(of: imageURL, perform: onChangeImageURL)
}

@MainActor
Expand Down Expand Up @@ -134,6 +129,13 @@ public struct PokitLinkPreview: View {
else { return }
openURL(url)
}

private func onChangeImageURL(_ imageURL: String?) {
guard imageURL != nil else { return }
let isError = title == Constants.제목을_입력해주세요_문구
UINotificationFeedbackGenerator()
.notificationOccurred(isError ? .error : .success)
}
}

#Preview {
Expand Down
2 changes: 1 addition & 1 deletion Projects/DSKit/Sources/Components/PokitList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public struct PokitList<Item: PokitSelectItem>: View {

Spacer()
}
.padding(.vertical, 18)
.padding(.vertical, 12)
.padding(.horizontal, 20)
.background {
if isSelected {
Expand Down
9 changes: 4 additions & 5 deletions Projects/DSKit/Sources/Components/PokitListButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct PokitListButton: View {
HStack {
switch type {
case let .default(icon, iconColor),
let .bottomSheet(icon, iconColor),
let .bottomSheet(icon, iconColor, _),
let .subText(icon, iconColor, _):
Text(title)
.pokitFont(.b1(.m))
Expand Down Expand Up @@ -76,9 +76,9 @@ public struct PokitListButton: View {
}
}
.padding(.horizontal, 24)
.padding(.vertical, 16)
.padding(.vertical, 20)
.background(alignment: .bottom) {
if case .bottomSheet = type {
if case let .bottomSheet(_, _, isLast) = type, !isLast {
Rectangle()
.fill(.pokit(.border(.tertiary)))
.frame(height: 1)
Expand All @@ -90,10 +90,9 @@ public struct PokitListButton: View {
extension PokitListButton {
public enum ListButtonType {
case `default`(icon: PokitImage, iconColor: Color)
case bottomSheet(icon: PokitImage, iconColor: Color)
case bottomSheet(icon: PokitImage, iconColor: Color, isLast: Bool = false)
case subText(icon: PokitImage, iconColor: Color, subeText: String)
case toggle(subeText: String)

}
}

Expand Down
12 changes: 6 additions & 6 deletions Projects/DSKit/Sources/Components/PokitSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
}
.onChange(of: selectedItem) { onChangedSeletedItem($0) }
.sheet(isPresented: $showSheet) {
listSheet
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.medium])
.pokitPresentationBackground()
listSheet
.presentationDragIndicator(.visible)
.pokitPresentationCornerRadius()
.presentationDetents([.height(564)])
Copy link
Member

Choose a reason for hiding this comment

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

요거 se는 사이즈 괜찮았나요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

엇.. 확인 해보겠습니다.. 확인한다 해놓고 까먹고 있었,,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-12 at 15 53 14

괜찮은 것 같습니다!

.pokitPresentationBackground()
}
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
listCellTapped(item)
}
}
.padding(.top, 24)
.padding(.top, 12)
.padding(.bottom, 20)
} else {
PokitLoading()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ public struct ContentDetailFeature {
case 삭제_버튼_눌렀을때
case 삭제확인_버튼_눌렀을때
case 즐겨찾기_버튼_눌렀을때
case 키보드_취소_버튼_눌렀을때
case 키보드_완료_버튼_눌렀울때

case 경고시트_해제

case 링크_공유_완료되었을때
case 메모포커스_변경되었을때(Bool)
}

public enum InnerAction: Equatable {
Expand Down Expand Up @@ -179,12 +181,12 @@ private extension ContentDetailFeature {
case .경고시트_해제:
state.showAlert = false
return .none
case let .메모포커스_변경되었을때(isFocused):
guard
!isFocused,
state.memo != state.domain.content?.memo
else { return .none }
case .키보드_취소_버튼_눌렀을때:
state.memo = state.domain.content?.memo ?? ""
return .none
case .키보드_완료_버튼_눌렀울때:
let memo = state.memo
guard memo != state.domain.content?.memo else { return .none }
state.domain.content?.memo = memo
return .send(.async(.컨텐츠_수정_API))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public extension ContentDetailView {
VStack(spacing: 0) {
contentMemo

Divider()
Rectangle()
.foregroundStyle(.pokit(.border(.tertiary)))
.frame(height: 1)

bottomList(favorites: favorites)
}
Expand All @@ -56,8 +57,6 @@ public extension ContentDetailView {
PokitLinkPopup(type: $store.linkPopup)
}
}
.dismissKeyboard(focused: $isFocused)
.onChange(of: isFocused) { send(.메모포커스_변경되었을때($0)) }
.sheet(isPresented: $store.showAlert) {
PokitAlert(
"링크를 정말 삭제하시겠습니까?",
Expand Down Expand Up @@ -110,15 +109,15 @@ private extension ContentDetailView {
func title(content: BaseContentDetail) -> some View {
VStack(alignment: .leading, spacing: 8) {
Group {
remindAndBadge(content: content)

Text(content.title)
.pokitFont(.title3)
.foregroundStyle(.pokit(.text(.primary)))
.multilineTextAlignment(.leading)
.lineLimit(2)

HStack {
remindAndBadge(content: content)

Spacer()

Text(content.createdAt)
Expand All @@ -128,8 +127,9 @@ private extension ContentDetailView {
}
.padding(.horizontal, 20)

Divider()
Rectangle()
.foregroundStyle(.pokit(.border(.tertiary)))
.frame(height: 1)
.padding(.top, 4)
}
}
Expand Down Expand Up @@ -159,12 +159,29 @@ private extension ContentDetailView {
focusState: $isFocused,
equals: true
)
.toolbar { keyboardToolBar }
.frame(minHeight: isFocused ? 164 : 132)
.animation(.pokitDissolve, value: isFocused)
}
.padding(.bottom, 24)
.padding(.horizontal, 20)
}

var keyboardToolBar: some ToolbarContent {
ToolbarItemGroup(placement: .keyboard) {
Button("취소") {
isFocused = false
send(.키보드_취소_버튼_눌렀을때)
}

Spacer()

Button("완료") {
isFocused = false
send(.키보드_완료_버튼_눌렀울때)
}
}
}

@ViewBuilder
func bottomList(favorites: Bool) -> some View {
Expand Down Expand Up @@ -204,7 +221,8 @@ private extension ContentDetailView {
title: "삭제하기",
type: .bottomSheet(
icon: .icon(.trash),
iconColor: .pokit(.icon(.primary))
iconColor: .pokit(.icon(.primary)),
isLast: true
),
action: { send(.삭제_버튼_눌렀을때) }
)
Expand Down
Loading
Loading