Skip to content

Conversation

@thinkySide
Copy link
Contributor

@thinkySide thinkySide commented Apr 13, 2025

close #358

TO-DO

  • 오늘의 질문 View Large / Small UI 업데이트
  • 첫 번째 진입, N번째 진입 로직 구현

스크린샷

기능 스크린샷
업데이트 UI

@thinkySide thinkySide added Feat 기능 구현 PR-InProgress 작업 중인 PR labels Apr 13, 2025
@thinkySide thinkySide self-assigned this Apr 13, 2025
@thinkySide thinkySide linked an issue Apr 13, 2025 that may be closed by this pull request
Comment on lines +22 to +25
var isNewQuestion = false
@Presents var sheet: Sheet.State?
@Presents var alert: AlertState<Action.Alert>?
@Shared(.appStorage(Constant.recentQuestionID)) var recentQuestionID = 0
Copy link
Contributor Author

@thinkySide thinkySide Apr 13, 2025

Choose a reason for hiding this comment

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

isNewQuestion: 새로운 질문이 등록되었는지 여부를 확인
recentQuestionID: 가장 최근에 등록됐었던 질문의 ID

recentQuestionID의 경우 AppStorge에 저장함으로써 N번째 진입 시 SmallHeaderView를 보여줄 수 있도록 구현했습니다.

Comment on lines +85 to +90
if mainQuestion.id != state.recentQuestionID {
state.isNewQuestion = true
state.$recentQuestionID.withLock { $0 = mainQuestion.id }
} else {
state.isNewQuestion = false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

메인 질문을 받아올 때 저장되어있던 Question ID값과 비교 후 새롭게 등록된 질문인지 판단 + 업데이트합니다.

Comment on lines +16 to 25
ScrollView {
VStack(spacing: 0) {
if store.isNewQuestion {
LargeHeaderView(store: store)
LargeQuestionButton(store: store)
} else {
SmallHeaderView(store: store)
}
AnswerPreviewList(store: store)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

새롭게 등록됐으면 LargeHeader, 이미 봤던 질문이라면 SmallHeader

Comment on lines +148 to +184
private func Footer() -> some View {
HStack(spacing: 0) {
Circle()
.foregroundStyle(.clear)
.frame(width: 28, height: 28)

Button {
likeAction()
} label: {
HStack(spacing: 4) {
Image(true ? .heartActive : .heart)
.resizable()
.frame(width: 18, height: 18)

Text("32")
.pretendard(.regular, 13)
.foregroundStyle(.sub3)
}
}
.padding(.leading, 8)

Button {
commentAction()
} label: {
HStack(spacing: 4) {
Image(systemName: "text.bubble.fill")
.resizable()
.frame(width: 15, height: 14)

Text("32")
.pretendard(.regular, 13)
}
.foregroundStyle(.sub3)
}
.padding(.leading, 12)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

QPAnswerCell UI 컴포넌트 내부에 좋아요, 댓글 버튼 등록해뒀습니다! 게시글 Cell과 동일해욧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

++ 답변 셀도 크기가 조금 더 커졌습니다! 게시글 Cell 작업하실 때도 체크 부탁드립니다!

@thinkySide thinkySide added PR-Reviewing 현재 리뷰 중인 PR and removed PR-InProgress 작업 중인 PR labels Apr 13, 2025
Copy link
Contributor

@mooninbeom mooninbeom left a comment

Choose a reason for hiding this comment

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

한번 봤던 질문은 작아지는게 참 기가막히군요 호호
LGTM

Copy link
Contributor

@OhMyungJin OhMyungJin left a comment

Choose a reason for hiding this comment

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

cell크기 확인했습니다~! LGTM

@thinkySide thinkySide merged commit 8b01e87 into develop Apr 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat 기능 구현 PR-Reviewing 현재 리뷰 중인 PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 오늘의 질문 UI 업데이트

4 participants