Skip to content
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
16 changes: 8 additions & 8 deletions Qapple/Qapple.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Qapple/QappleBox/Qapple.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2503091219;
CURRENT_PROJECT_VERSION = 2505142036;
DEVELOPMENT_ASSET_PATHS = "\"Qapple/Resource/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G9WTRLK7PY;
Expand All @@ -425,11 +425,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.qapple.Apple-Developer-Academy-POSTECH";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Qapple+Development";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Qapple+Distribution";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand All @@ -449,9 +449,9 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Qapple/QappleBox/Qapple.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2503091219;
CURRENT_PROJECT_VERSION = 2505142036;
DEVELOPMENT_ASSET_PATHS = "\"Qapple/Resource/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G9WTRLK7PY;
Expand All @@ -472,11 +472,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.1.0;
MARKETING_VERSION = 2.1.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.qapple.Apple-Developer-Academy-POSTECH";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Qapple+Development";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Qapple+Distribution";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand Down
2 changes: 1 addition & 1 deletion Qapple/Qapple/SourceCode/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension AppDelegate {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
) -> Bool {
#if DEBUG
RepositoryService.shared.configureServer(to: .test)
RepositoryService.shared.configureServer(to: .production)
#else
RepositoryService.shared.configureServer(to: .production)
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
struct AnswerRepository {
var fetchAnswerListOfProfile: (_ threshold: Int?) async throws -> ([Answer], QappleAPI.PaginationInfo)
var fetchAnswerPreviewList: (_ questionId: Int) async throws -> [Answer]
var fetchAnswerListOfQuestion: (_ questionId: Int, _ threshold: String?) async throws -> (
var fetchAnswerListOfQuestion: (_ questionId: Int, _ threshold: Int?) async throws -> (
[Answer],
QappleAPI.TotalCount,
QappleAPI.PaginationInfo
Expand Down
5 changes: 5 additions & 0 deletions Qapple/Qapple/SourceCode/Entity/AcademyEventFor4th.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ enum AcademyEventFor4th: CaseIterable {
let (startDate, endDate) = period
return daysBetween(startDate, endDate) + 1
}

/// 현재 이벤트의 남은 일수를 반환합니다.
var leftDays: Int {
daysBetween(.now, self.period.1) + 1
}
}

// MARK: - Helper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ extension MainFlowFeature {
case bulletinBoard(BulletinBoardFeature)
case bulletinBoardSearch(BulletinBoardSearchFeature)
case bulletinBoardPost(BulletinBoardPostFeature)
case comment(CommentFeature)
case comment(BoardCommentFeature)
case profileEdit(ProfileEditFeature)
case myAnswerList(MyAnswerListFeature)
case peopleWhoMadeQapple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct MainFlowView: View {
case let .bulletinBoard(store): BulletinBoardView(store: store)
case let .bulletinBoardSearch(store): BulletinBoardSearchView(store: store)
case let .bulletinBoardPost(store): BulletinBoardPostView(store: store)
case let .comment(store): CommentView(store: store)
case let .comment(store): BoardCommentView(store: store)
case let .profileEdit(store): ProfileEditView(store: store)
case let .myAnswerList(store): MyAnswerListView(store: store)
case .peopleWhoMadeQapple: PeopleWhoMadeQappleView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct TodayQuestionFeature {
enum Action {
case onAppear
case onDisappear
case active
case refresh
case mainQuestionResponse(Question)
case answerListResponse([Answer])
Expand Down Expand Up @@ -58,7 +59,7 @@ struct TodayQuestionFeature {
var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case .onAppear, .refresh:
case .onAppear, .active, .refresh:
return .run { [isFirstLaunch = state.isFirstLaunch] send in
if isFirstLaunch { await send(.toggleLoading(true), animation: .bouncy) }
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import SwiftUI

struct TodayQuestionView: View {

@Environment(\.scenePhase) private var scenePhase

@Bindable var store: StoreOf<TodayQuestionFeature>

var body: some View {
Expand All @@ -26,6 +28,11 @@ struct TodayQuestionView: View {
}
.background(.second)
.scrollIndicators(.hidden)
.onChange(of: scenePhase) { _, newPhase in
if newPhase == .active {
store.send(.active)
}
}
.onAppear {
store.send(.onAppear)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct AnswerListFeature {
do {
let response = try await answerRepository.fetchAnswerListOfQuestion(
state.question.id,
state.paginationInfo.threshold
Int(state.paginationInfo.threshold)
)
await send(.paginagionResponse(response.0, response.2))
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,51 +85,63 @@ private struct CommentListView: View {

var body: some View {
ZStack {
ScrollView {
LazyVStack(spacing: 0) {
seperator
// TODO: 4/14 데이터 연결 필요
// ForEach(Array(self.store.commentList.enumerated()), id: \.offset) { index, comment in
// AnswerCommentCell(
// comment: comment,
// like: {
// store.send(.likeCommentButtonTapped(comment))
// },
// delete: {
// store.send(.deleteCommentButtonTapped(comment))
// },
// report: {
// store.send(.reportButtonTapped(comment))
// }
// )
// .configurePagination(
// store.commentList,
// currentIndex: index,
// hasNext: store.paginationInfo.hasNext,
// pagination: {
// store.send(.pagination)
// }
// )
// .disabled(store.isLoading)
//
// seperator
// }

ForEach(AnswerCommentFeature.sampleComment) { comment in
AnswerCommentCell(
comment: comment,
like: {
store.send(.likeCommentButtonTapped(comment))
},
delete: {
store.send(.deleteCommentButtonTapped(comment))
},
report: {
store.send(.reportButtonTapped(comment))
}
)
VStack {
seperator

HStack {
Text("댓글")
.pretendard(.medium, 14)
.foregroundStyle(.sub3)
Spacer()
}
.padding(.top, 12)
.padding(.horizontal, 20)

ScrollView {
LazyVStack(spacing: 0) {
// TODO: 4/14 데이터 연결 필요
// ForEach(Array(self.store.commentList.enumerated()), id: \.offset) { index, comment in
// AnswerCommentCell(
// comment: comment,
// like: {
// store.send(.likeCommentButtonTapped(comment))
// },
// delete: {
// store.send(.deleteCommentButtonTapped(comment))
// },
// report: {
// store.send(.reportButtonTapped(comment))
// }
// )
// .configurePagination(
// store.commentList,
// currentIndex: index,
// hasNext: store.paginationInfo.hasNext,
// pagination: {
// store.send(.pagination)
// }
// )
// .disabled(store.isLoading)
//
// seperator
// }

seperator
ForEach(AnswerCommentFeature.sampleComment) { comment in
AnswerCommentCell(
comment: comment,
like: {
store.send(.likeCommentButtonTapped(comment))
},
delete: {
store.send(.deleteCommentButtonTapped(comment))
},
report: {
store.send(.reportButtonTapped(comment))
}
)

seperator
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ private struct NormalBoardCell: View {
board: board,
like: like
)
.padding(.top, 16)
.padding(.horizontal, 16)

Divider()
.padding(.top, 16)
.padding(.top, 24)
}
.background(Background.first)
}
Expand Down Expand Up @@ -158,7 +159,7 @@ private struct ContentView: View {
board: board,
like: like
)
.padding(.top, 12)
.padding(.top, 16)
.disabled(board.isReported)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ struct BulletinBoardFeature {
@Presents var alert: AlertState<Action.Alert>?
var bulletinBoardList: [BulletinBoard] = []
var todayQuestion: Question = .initialState
var event: AcademyEventFor4th = .fourthStart
var paginationInfo = QappleAPI.PaginationInfo(threshold: "", hasNext: false)
var isLoading: Bool = false
var isFirstLaunch = true
}

enum Action {
case onAppear
case active
case refresh
case pagination
case bulletinBoardListResponse(Question, [BulletinBoard], QappleAPI.PaginationInfo)
Expand Down Expand Up @@ -61,9 +63,12 @@ struct BulletinBoardFeature {
@Dependency(\.bulletinBoardRepository) var bulletinBoardRepository

var body: some ReducerOf<Self> {
Reduce { state,action in
Reduce { state, action in
switch action {
case .onAppear, .refresh:
case .onAppear, .active, .refresh:
if let currentEvent = AcademyEventFor4th.currentEvent {
state.event = currentEvent
}
return .run { [isFirstLaunch = state.isFirstLaunch] send in
if isFirstLaunch { await send(.toggleLoading(true), animation: .bouncy) }
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import ComposableArchitecture

struct BulletinBoardView: View {

@Environment(\.scenePhase) private var scenePhase

@Bindable var store: StoreOf<BulletinBoardFeature>

var body: some View {
Expand All @@ -22,7 +24,11 @@ struct BulletinBoardView: View {
.padding(.bottom, 20)
}
.background(.first)

.onChange(of: scenePhase) { _, newPhase in
if newPhase == .active {
store.send(.active)
}
}
.onAppear{
store.send(.onAppear)
}
Expand Down Expand Up @@ -67,7 +73,7 @@ private struct BulletinBoardContentView: View {
Button {
store.send(.academyDayCounterTapped)
} label: {
QPAcademyDayCounter()
QPAcademyDayCounter(event: store.event)
.padding(.top, 8)
.padding(.horizontal, 16)
}
Expand Down Expand Up @@ -114,7 +120,7 @@ private struct QuestionNotificationView: View {
}
} else {
Button {
store.send(.popularAnswerTapped(store.todayQuestion))
// store.send(.popularAnswerTapped(store.todayQuestion))
} label: {
HStack(spacing: 0) {
VStack(spacing: 0) {
Expand All @@ -130,13 +136,15 @@ private struct QuestionNotificationView: View {


VStack(alignment: .leading, spacing: 0) {
Text("오늘의 인기 답변")
.font(.pretendard(.regular, size: 12))
.foregroundStyle(TextLabel.sub4)

Spacer()
// Text("오늘의 인기 답변")
// .font(.pretendard(.regular, size: 12))
// .foregroundStyle(TextLabel.sub4)
//
// Spacer()

Text("프라이데이는 여자친구가 가지고 싶어요") // TODO: 인기 답변으로
Text("이전에 개발자의 실수로 이상한(?) 정보가 표시됐었답니다.") // TODO: 인기 답변으로
.lineLimit(2)
.multilineTextAlignment(.leading)
.font(.pretendard(.regular, size: 15))
.foregroundStyle(.white)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// CommentCell.swift
// BoardCommentCell.swift
// Qapple
//
// Created by 문인범 on 1/21/25.
//

import SwiftUI

struct CommentCell: View {
struct BoardCommentCell: View {
let comment: BoardComment
let like: () -> Void
let delete: () -> Void
Expand Down Expand Up @@ -272,7 +272,7 @@ private struct CommentReportButton: View {
anonymityId: 2
)

CommentCell(
BoardCommentCell(
comment: comment,
like: {},
delete: {},
Expand Down
Loading