Conversation
Closed
thinkySide
commented
Apr 13, 2025
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 |
Contributor
Author
There was a problem hiding this comment.
isNewQuestion: 새로운 질문이 등록되었는지 여부를 확인
recentQuestionID: 가장 최근에 등록됐었던 질문의 ID
recentQuestionID의 경우 AppStorge에 저장함으로써 N번째 진입 시 SmallHeaderView를 보여줄 수 있도록 구현했습니다.
thinkySide
commented
Apr 13, 2025
Comment on lines
+85
to
+90
| if mainQuestion.id != state.recentQuestionID { | ||
| state.isNewQuestion = true | ||
| state.$recentQuestionID.withLock { $0 = mainQuestion.id } | ||
| } else { | ||
| state.isNewQuestion = false | ||
| } |
Contributor
Author
There was a problem hiding this comment.
메인 질문을 받아올 때 저장되어있던 Question ID값과 비교 후 새롭게 등록된 질문인지 판단 + 업데이트합니다.
thinkySide
commented
Apr 13, 2025
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) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
새롭게 등록됐으면 LargeHeader, 이미 봤던 질문이라면 SmallHeader
thinkySide
commented
Apr 13, 2025
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) | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
QPAnswerCell UI 컴포넌트 내부에 좋아요, 댓글 버튼 등록해뒀습니다! 게시글 Cell과 동일해욧
Contributor
Author
There was a problem hiding this comment.
++ 답변 셀도 크기가 조금 더 커졌습니다! 게시글 Cell 작업하실 때도 체크 부탁드립니다!
mooninbeom
approved these changes
Apr 14, 2025
Contributor
mooninbeom
left a comment
There was a problem hiding this comment.
한번 봤던 질문은 작아지는게 참 기가막히군요 호호
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #358
TO-DO
스크린샷