Skip to content

Commit bd367be

Browse files
authored
Merge pull request #363 from Team-Capple/feat#361-bulletinBoard-UI
[FEAT] ๊ฒŒ์‹œํŒ UI ์—…๋ฐ์ดํŠธ
2 parents 49ca2a7 + 8fbbb44 commit bd367be

File tree

7 files changed

+153
-28
lines changed

7 files changed

+153
-28
lines changed

โ€ŽQapple/Qapple.xcodeproj/project.pbxprojโ€Ž

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,17 @@
230230
isa = XCBuildConfiguration;
231231
buildSettings = {
232232
BUNDLE_LOADER = "$(TEST_HOST)";
233-
CODE_SIGN_STYLE = Automatic;
233+
CODE_SIGN_STYLE = Manual;
234234
CURRENT_PROJECT_VERSION = 1;
235-
DEVELOPMENT_TEAM = 7YZM4XMXXU;
235+
DEVELOPMENT_TEAM = "";
236+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "";
236237
GENERATE_INFOPLIST_FILE = YES;
237238
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
238239
MARKETING_VERSION = 1.0;
239240
PRODUCT_BUNDLE_IDENTIFIER = com.thinkyside.QappleTests;
240241
PRODUCT_NAME = "$(TARGET_NAME)";
242+
PROVISIONING_PROFILE_SPECIFIER = "";
243+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "";
241244
SWIFT_EMIT_LOC_STRINGS = NO;
242245
SWIFT_VERSION = 5.0;
243246
TARGETED_DEVICE_FAMILY = "1,2";
@@ -249,14 +252,17 @@
249252
isa = XCBuildConfiguration;
250253
buildSettings = {
251254
BUNDLE_LOADER = "$(TEST_HOST)";
252-
CODE_SIGN_STYLE = Automatic;
255+
CODE_SIGN_STYLE = Manual;
253256
CURRENT_PROJECT_VERSION = 1;
254-
DEVELOPMENT_TEAM = 7YZM4XMXXU;
257+
DEVELOPMENT_TEAM = "";
258+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "";
255259
GENERATE_INFOPLIST_FILE = YES;
256260
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
257261
MARKETING_VERSION = 1.0;
258262
PRODUCT_BUNDLE_IDENTIFIER = com.thinkyside.QappleTests;
259263
PRODUCT_NAME = "$(TARGET_NAME)";
264+
PROVISIONING_PROFILE_SPECIFIER = "";
265+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "";
260266
SWIFT_EMIT_LOC_STRINGS = NO;
261267
SWIFT_VERSION = 5.0;
262268
TARGETED_DEVICE_FAMILY = "1,2";
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0x25",
9+
"green" : "0x25",
10+
"red" : "0x25"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}

โ€ŽQapple/Qapple/SourceCode/Feature/1.MainFlow/MainFlowFeature.swiftโ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,20 @@ struct MainFlowFeature {
9494
state.path.append(.bulletinBoardPost(.init()))
9595
return .none
9696

97+
case let .bulletinBoardTab(.questionNotiTapped(question)):
98+
state.path.append(.writeAnswer(.init(question: question)))
99+
return .none
100+
101+
case let .bulletinBoardTab(.popularAnswerTapped(question)):
102+
if question.isAnswered {
103+
state.path.append(.answerList(.init(question: question)))
104+
}
105+
return .none
106+
97107
case let .bulletinBoardTab(.sheet(.presented(.seeMore(.reportButtonTapped(dataType))))):
98108
state.path.append(.report(.init(dataType: dataType)))
99109
return .none
110+
100111
case let .profileTab(.editProfileButtonTapped(nickname)):
101112
state.path.append(.profileEdit(.init(nickname: nickname, defaultNickname: nickname)))
102113
return .none

โ€ŽQapple/Qapple/SourceCode/Feature/3.BulletinBoard/3-1.BulletinBoard/BulletinBoardCell.swiftโ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ private struct NormalBoardCell: View {
5353
board: board,
5454
seeMore: seeMore
5555
)
56-
.padding(.horizontal, 16)
56+
.padding(.top)
57+
.padding(.horizontal)
5758

5859
ContentView(
5960
board: board,
6061
like: like
6162
)
62-
.padding(.horizontal, 16)
63+
.padding(.horizontal, 16)
6364

6465
Divider()
6566
.padding(.top, 16)
6667
}
67-
.padding(.top, 16)
6868
.background(Background.first)
6969
}
7070
}
@@ -115,7 +115,7 @@ private struct HeaderView: View {
115115
.padding(.leading, 8)
116116

117117
Text("\(board.createAt.timeAgo)")
118-
.pretendard(.regular, 14)
118+
.pretendard(.regular, 12)
119119
.foregroundStyle(TextLabel.sub4)
120120
.padding(.leading, 6)
121121

@@ -158,8 +158,8 @@ private struct ContentView: View {
158158
board: board,
159159
like: like
160160
)
161-
.padding(.top, 12)
162-
.disabled(board.isReported)
161+
.padding(.top, 12)
162+
.disabled(board.isReported)
163163
}
164164
}
165165
}

โ€ŽQapple/Qapple/SourceCode/Feature/3.BulletinBoard/3-1.BulletinBoard/BulletinBoardFeature.swiftโ€Ž

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct BulletinBoardFeature {
1515
@Presents var sheet: Sheet.State?
1616
@Presents var alert: AlertState<Action.Alert>?
1717
var bulletinBoardList: [BulletinBoard] = []
18+
var todayQuestion: Question = .initialState
1819
var paginationInfo = QappleAPI.PaginationInfo(threshold: "", hasNext: false)
1920
var isLoading: Bool = false
2021
var isFirstLaunch = true
@@ -24,7 +25,7 @@ struct BulletinBoardFeature {
2425
case onAppear
2526
case refresh
2627
case pagination
27-
case bulletinBoardListResponse([BulletinBoard], QappleAPI.PaginationInfo)
28+
case bulletinBoardListResponse(Question, [BulletinBoard], QappleAPI.PaginationInfo)
2829
case paginationResponse([BulletinBoard], QappleAPI.PaginationInfo)
2930

3031
case academyDayCounterTapped
@@ -40,6 +41,8 @@ struct BulletinBoardFeature {
4041
case networkingFailed(Error)
4142
case toggleLoading(Bool)
4243
case filterBlockedUser
44+
case questionNotiTapped(Question)
45+
case popularAnswerTapped(Question)
4346

4447
case sheet(PresentationAction<Sheet.Action>)
4548
case alert(PresentationAction<Alert>)
@@ -54,6 +57,7 @@ struct BulletinBoardFeature {
5457
}
5558
}
5659

60+
@Dependency(\.questionRepository.fetchMainQuestion) var fetchMainQuestion
5761
@Dependency(\.bulletinBoardRepository) var bulletinBoardRepository
5862

5963
var body: some ReducerOf<Self> {
@@ -63,8 +67,9 @@ struct BulletinBoardFeature {
6367
return .run { [isFirstLaunch = state.isFirstLaunch] send in
6468
if isFirstLaunch { await send(.toggleLoading(true), animation: .bouncy) }
6569
do {
70+
let mainQuestion = try await fetchMainQuestion()
6671
let response = try await bulletinBoardRepository.fetchBulletinBoardList(nil)
67-
await send(.bulletinBoardListResponse(response.0, response.1))
72+
await send(.bulletinBoardListResponse(mainQuestion, response.0, response.1))
6873
} catch {
6974
await send(.networkingFailed(error))
7075
}
@@ -83,7 +88,8 @@ struct BulletinBoardFeature {
8388
await send(.toggleLoading(false), animation: .bouncy)
8489
}
8590

86-
case let .bulletinBoardListResponse(bulletinBoardList, paginationInfo):
91+
case let .bulletinBoardListResponse(mainQuestion, bulletinBoardList, paginationInfo):
92+
state.todayQuestion = mainQuestion
8793
state.isFirstLaunch = false
8894
state.bulletinBoardList = bulletinBoardList.filter(UserDefaults.filterBoardBlockedUser)
8995
state.paginationInfo = paginationInfo
@@ -144,6 +150,12 @@ struct BulletinBoardFeature {
144150
case .postBoardButtonTapped:
145151
return .none
146152

153+
case .questionNotiTapped:
154+
return .none
155+
156+
case .popularAnswerTapped:
157+
return .none
158+
147159
case let .seeMoreAction(board):
148160
state.sheet = .seeMore(
149161
.init(

โ€ŽQapple/Qapple/SourceCode/Feature/3.BulletinBoard/3-1.BulletinBoard/BulletinBoardView.swiftโ€Ž

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,77 @@ private struct BulletinBoardContentView: View {
8282
}
8383
}
8484

85+
// MARK: - QuestionNotificationView
86+
87+
private struct QuestionNotificationView: View {
88+
89+
let store: StoreOf<BulletinBoardFeature>
90+
91+
var body: some View {
92+
if !store.todayQuestion.isAnswered {
93+
Button {
94+
store.send(.questionNotiTapped(store.todayQuestion))
95+
} label: {
96+
HStack(spacing: 0) {
97+
Image("questionReady")
98+
.resizable()
99+
.scaledToFit()
100+
.frame(width: 20, height: 20)
101+
.padding(.trailing, 6)
102+
.padding(.leading, 18)
103+
104+
Text("์˜ค๋Š˜์˜ ์งˆ๋ฌธ์ด ๋„์ฐฉํ–ˆ์–ด์š”!")
105+
.font(.pretendard(.semiBold, size: 15))
106+
.foregroundStyle(.white)
107+
108+
Spacer()
109+
}
110+
.frame(width: 361, height: 47)
111+
.background(RoundedRectangle(cornerRadius: 12)
112+
.fill(.questionNoti)
113+
.stroke(.button.opacity(0.17), lineWidth: 0.6)) // TODO: ๊ทธ๋ผ๋ฐ์ด์…˜
114+
}
115+
} else {
116+
Button {
117+
store.send(.popularAnswerTapped(store.todayQuestion))
118+
} label: {
119+
HStack(spacing: 0) {
120+
VStack(spacing: 0) {
121+
Image("questionComplete")
122+
.resizable()
123+
.scaledToFit()
124+
.frame(width: 20, height: 20)
125+
.padding(.trailing, 8)
126+
.padding(.leading, 18)
127+
128+
Spacer()
129+
}
130+
131+
132+
VStack(alignment: .leading, spacing: 0) {
133+
Text("์˜ค๋Š˜์˜ ์ธ๊ธฐ ๋‹ต๋ณ€")
134+
.font(.pretendard(.regular, size: 12))
135+
.foregroundStyle(TextLabel.sub4)
136+
137+
Spacer()
138+
139+
Text("ํ”„๋ผ์ด๋ฐ์ด๋Š” ์—ฌ์ž์นœ๊ตฌ๊ฐ€ ๊ฐ€์ง€๊ณ  ์‹ถ์–ด์š”") // TODO: ์ธ๊ธฐ ๋‹ต๋ณ€์œผ๋กœ
140+
.font(.pretendard(.regular, size: 15))
141+
.foregroundStyle(.white)
142+
}
143+
144+
Spacer()
145+
}
146+
.padding(.vertical, 12)
147+
.frame(width: 361, height: 67)
148+
.background(RoundedRectangle(cornerRadius: 12)
149+
.fill(.questionNoti)
150+
.stroke(.button.opacity(0.17), lineWidth: 0.6)) // TODO: ๊ทธ๋ผ๋ฐ์ด์…˜
151+
}
152+
}
153+
}
154+
}
155+
85156
// MARK: - BulletionBoardListView
86157

87158
private struct BulletionBoardListView: View {
@@ -90,6 +161,11 @@ private struct BulletionBoardListView: View {
90161

91162
var body: some View {
92163
ScrollView {
164+
165+
QuestionNotificationView(store: store)
166+
.padding(.horizontal)
167+
.padding(.top, 2)
168+
93169
LazyVStack(spacing: 0) {
94170
ForEach(enumerated(store.bulletinBoardList), id: \.offset) { index, board in
95171
Button {

โ€ŽQapple/Qapple/SourceCode/UIComponent/QPAcademyDayCounter.swiftโ€Ž

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct QPAcademyDayCounter: View {
2626
}
2727
}
2828
}
29-
.padding(.vertical, 16)
29+
.padding(.vertical, 14)
3030
.padding(.horizontal, 20)
3131
.background(.second)
3232
.clipShape(RoundedRectangle(cornerRadius: 12))
@@ -44,21 +44,21 @@ private struct ContentView: View {
4444
VStack(spacing: 0) {
4545
Header(event: event, dayLeft: dayLeft, isCurrentEvent: true)
4646

47-
HStack {
48-
Text(event.period.0.formatting(.mdKorean))
49-
Spacer()
50-
Text(event.period.1.formatting(.mdKorean))
51-
}
52-
.padding(.top, 16)
53-
.padding(.horizontal, 2)
54-
.foregroundStyle(.main).opacity(0.6)
55-
.pretendard(.semiBold, 14)
47+
// HStack {
48+
// Text(event.period.0.formatting(.mdKorean))
49+
// Spacer()
50+
// Text(event.period.1.formatting(.mdKorean))
51+
// }
52+
// .padding(.top, 16)
53+
// .padding(.horizontal, 2)
54+
// .foregroundStyle(.main).opacity(0.6)
55+
// .pretendard(.semiBold, 14)
5656

57-
ProgressBar(
58-
event: event,
59-
dayLeft: dayLeft
60-
)
61-
.padding(.top, 8)
57+
// ProgressBar(
58+
// event: event,
59+
// dayLeft: dayLeft
60+
// )
61+
// .padding(.top, 8)
6262
}
6363
}
6464
}

0 commit comments

Comments
ย (0)