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
14 changes: 10 additions & 4 deletions Qapple/Qapple.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,17 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7YZM4XMXXU;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.thinkyside.QappleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -249,14 +252,17 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7YZM4XMXXU;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.thinkyside.QappleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x25",
"green" : "0x25",
"red" : "0x25"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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: .production)
RepositoryService.shared.configureServer(to: .test)
#else
RepositoryService.shared.configureServer(to: .production)
#endif
Expand Down
11 changes: 11 additions & 0 deletions Qapple/Qapple/SourceCode/Feature/1.MainFlow/MainFlowFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,20 @@ struct MainFlowFeature {
state.path.append(.bulletinBoardPost(.init()))
return .none

case let .bulletinBoardTab(.questionNotiTapped(question)):
state.path.append(.writeAnswer(.init(question: question)))
return .none

case let .bulletinBoardTab(.popularAnswerTapped(question)):
if question.isAnswered {
state.path.append(.answerList(.init(question: question)))
}
return .none

case let .bulletinBoardTab(.sheet(.presented(.seeMore(.reportButtonTapped(dataType))))):
state.path.append(.report(.init(dataType: dataType)))
return .none

case let .profileTab(.editProfileButtonTapped(nickname)):
state.path.append(.profileEdit(.init(nickname: nickname, defaultNickname: nickname)))
return .none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ private struct NormalBoardCell: View {
board: board,
seeMore: seeMore
)
.padding(.horizontal, 16)
.padding(.top)
.padding(.horizontal)

ContentView(
board: board,
like: like
)
.padding(.horizontal, 16)
.padding(.horizontal, 16)

Divider()
.padding(.top, 16)
}
.padding(.top, 16)
.background(Background.first)
}
}
Expand Down Expand Up @@ -115,7 +115,7 @@ private struct HeaderView: View {
.padding(.leading, 8)

Text("\(board.createAt.timeAgo)")
.pretendard(.regular, 14)
.pretendard(.regular, 12)
.foregroundStyle(TextLabel.sub4)
.padding(.leading, 6)

Expand Down Expand Up @@ -158,8 +158,8 @@ private struct ContentView: View {
board: board,
like: like
)
.padding(.top, 12)
.disabled(board.isReported)
.padding(.top, 12)
.disabled(board.isReported)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct BulletinBoardFeature {
@Presents var sheet: Sheet.State?
@Presents var alert: AlertState<Action.Alert>?
var bulletinBoardList: [BulletinBoard] = []
var todayQuestion: Question = .initialState
var paginationInfo = QappleAPI.PaginationInfo(threshold: "", hasNext: false)
var isLoading: Bool = false
var isFirstLaunch = true
Expand All @@ -24,7 +25,7 @@ struct BulletinBoardFeature {
case onAppear
case refresh
case pagination
case bulletinBoardListResponse([BulletinBoard], QappleAPI.PaginationInfo)
case bulletinBoardListResponse(Question, [BulletinBoard], QappleAPI.PaginationInfo)
case paginationResponse([BulletinBoard], QappleAPI.PaginationInfo)

case academyDayCounterTapped
Expand All @@ -40,6 +41,8 @@ struct BulletinBoardFeature {
case networkingFailed(Error)
case toggleLoading(Bool)
case filterBlockedUser
case questionNotiTapped(Question)
case popularAnswerTapped(Question)

case sheet(PresentationAction<Sheet.Action>)
case alert(PresentationAction<Alert>)
Expand All @@ -54,6 +57,7 @@ struct BulletinBoardFeature {
}
}

@Dependency(\.questionRepository.fetchMainQuestion) var fetchMainQuestion
@Dependency(\.bulletinBoardRepository) var bulletinBoardRepository

var body: some ReducerOf<Self> {
Expand All @@ -63,8 +67,9 @@ struct BulletinBoardFeature {
return .run { [isFirstLaunch = state.isFirstLaunch] send in
if isFirstLaunch { await send(.toggleLoading(true), animation: .bouncy) }
do {
let mainQuestion = try await fetchMainQuestion()
let response = try await bulletinBoardRepository.fetchBulletinBoardList(nil)
await send(.bulletinBoardListResponse(response.0, response.1))
await send(.bulletinBoardListResponse(mainQuestion, response.0, response.1))
Comment on lines 67 to +72
Copy link
Contributor Author

Choose a reason for hiding this comment

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

오늘의 질문을 불러와야해서 게시판 피처에 api호출 추가했습니다!

} catch {
await send(.networkingFailed(error))
}
Expand All @@ -83,7 +88,8 @@ struct BulletinBoardFeature {
await send(.toggleLoading(false), animation: .bouncy)
}

case let .bulletinBoardListResponse(bulletinBoardList, paginationInfo):
case let .bulletinBoardListResponse(mainQuestion, bulletinBoardList, paginationInfo):
state.todayQuestion = mainQuestion
state.isFirstLaunch = false
state.bulletinBoardList = bulletinBoardList.filter(UserDefaults.filterBoardBlockedUser)
state.paginationInfo = paginationInfo
Expand Down Expand Up @@ -144,6 +150,12 @@ struct BulletinBoardFeature {
case .postBoardButtonTapped:
return .none

case .questionNotiTapped:
return .none

case .popularAnswerTapped:
return .none

case let .seeMoreAction(board):
state.sheet = .seeMore(
.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,77 @@ private struct BulletinBoardContentView: View {
}
}

// MARK: - QuestionNotificationView

private struct QuestionNotificationView: View {

let store: StoreOf<BulletinBoardFeature>

var body: some View {
if !store.todayQuestion.isAnswered {
Button {
store.send(.questionNotiTapped(store.todayQuestion))
} label: {
HStack(spacing: 0) {
Comment on lines +87 to +96
Copy link
Contributor Author

Choose a reason for hiding this comment

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

답변 유무에 따른 UI 변경입니다!

Image("questionReady")
.resizable()
.scaledToFit()
.frame(width: 20, height: 20)
.padding(.trailing, 6)
.padding(.leading, 18)

Text("오늘의 질문이 도착했어요!")
.font(.pretendard(.semiBold, size: 15))
.foregroundStyle(.white)

Spacer()
}
.frame(width: 361, height: 47)
.background(RoundedRectangle(cornerRadius: 12)
.fill(.questionNoti)
.stroke(.button.opacity(0.17), lineWidth: 0.6)) // TODO: 그라데이션
}
} else {
Button {
store.send(.popularAnswerTapped(store.todayQuestion))
} label: {
HStack(spacing: 0) {
VStack(spacing: 0) {
Image("questionComplete")
.resizable()
.scaledToFit()
.frame(width: 20, height: 20)
.padding(.trailing, 8)
.padding(.leading, 18)

Spacer()
}


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

Spacer()

Text("프라이데이는 여자친구가 가지고 싶어요") // TODO: 인기 답변으로
.font(.pretendard(.regular, size: 15))
.foregroundStyle(.white)
}

Spacer()
}
.padding(.vertical, 12)
.frame(width: 361, height: 67)
.background(RoundedRectangle(cornerRadius: 12)
.fill(.questionNoti)
.stroke(.button.opacity(0.17), lineWidth: 0.6)) // TODO: 그라데이션
}
}
}
}

// MARK: - BulletionBoardListView

private struct BulletionBoardListView: View {
Expand All @@ -90,6 +161,11 @@ private struct BulletionBoardListView: View {

var body: some View {
ScrollView {

QuestionNotificationView(store: store)
.padding(.horizontal)
.padding(.top, 2)

LazyVStack(spacing: 0) {
ForEach(enumerated(store.bulletinBoardList), id: \.offset) { index, board in
Button {
Expand Down
30 changes: 15 additions & 15 deletions Qapple/Qapple/SourceCode/UIComponent/QPAcademyDayCounter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct QPAcademyDayCounter: View {
}
}
}
.padding(.vertical, 16)
.padding(.vertical, 14)
.padding(.horizontal, 20)
.background(.second)
.clipShape(RoundedRectangle(cornerRadius: 12))
Expand All @@ -44,21 +44,21 @@ private struct ContentView: View {
VStack(spacing: 0) {
Header(event: event, dayLeft: dayLeft, isCurrentEvent: true)

HStack {
Text(event.period.0.formatting(.mdKorean))
Spacer()
Text(event.period.1.formatting(.mdKorean))
}
.padding(.top, 16)
.padding(.horizontal, 2)
.foregroundStyle(.main).opacity(0.6)
.pretendard(.semiBold, 14)
// HStack {
// Text(event.period.0.formatting(.mdKorean))
// Spacer()
// Text(event.period.1.formatting(.mdKorean))
// }
// .padding(.top, 16)
// .padding(.horizontal, 2)
// .foregroundStyle(.main).opacity(0.6)
// .pretendard(.semiBold, 14)

ProgressBar(
event: event,
dayLeft: dayLeft
)
.padding(.top, 8)
// ProgressBar(
// event: event,
// dayLeft: dayLeft
// )
// .padding(.top, 8)
Comment on lines +47 to +61
Copy link
Contributor Author

Choose a reason for hiding this comment

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

캘린더 UI는 잠시 안녕..

Copy link
Contributor

Choose a reason for hiding this comment

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

건강하게 살아야한다 캘린더야~

}
}
}
Expand Down