-
Notifications
You must be signed in to change notification settings - Fork 0
Style/#428 댓글, 답글 UI 구현 #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "style/#428-\uB313\uAE00-ui"
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1ae504e
add: #428 댓글, 좋아요 이미지 추가
y-eonee 25d3085
style: #428 퀘스트 content, 댓글 컴포넌트 분리
y-eonee 33d1a93
feat: #428 좋아요 누르기 구현
y-eonee 23b5086
style: #428 나의여정에서도 프로필아이콘이 뜨도록 수정
y-eonee 8eaeb44
refactor: #428 extension 적용
y-eonee 1a38631
setting: #428 리퀴드글래스 미적용
y-eonee e695a05
feat: #428 댓글 입력 컴포넌트 구현
y-eonee a94efc5
chore: #428 주석 삭제
y-eonee 349d4ab
refactor: #428 변경된 DTO 수정
y-eonee 5cb40bf
feat: #428 재사용을 위해 answer entity 수정 및 comment entity 작성
y-eonee 840d3b0
refactor: #428 profile Icon String -> Image 전역으로 분리
y-eonee 809f5dc
feat: #428 Textview line 수 계산 익스텐션
y-eonee 55b01b1
style: #428 댓글 UI 구현
y-eonee 70c5108
refactor: #428 entity 수정에 따른 configure 함수 내부 수정
y-eonee cac5977
refactor: #428 profileIcon 로직 뷰모델 내부에서 삭제
y-eonee ba83a40
feat: #428 comment Table View VC에 연결
y-eonee 5755451
fix: #428 컴포넌트 재사용에 따른 UI 로직 수정
y-eonee 4e56be0
style: #428 History View UI
y-eonee 5a5b38f
feat: #428 scrollView, tableView 중첩을 위한 익스텐션
y-eonee 5997863
feat: #428 댓글 더보기 구현
y-eonee c4dbe52
add: #428 답글 아이콘 추가
y-eonee 2da80d8
chore: #428 comment entity stub 추가
y-eonee 0d248ec
feat: #428 댓글, 답글 레이아웃 분기처리 수정
y-eonee a3e1ea0
style: #428 답글 바텀시트 UI 구현
y-eonee 34610bf
feat: #428 답글 뷰 모델 생성
y-eonee cd2ae9b
refactor: #428 키보드 로직 분리
y-eonee d2f185f
feat: #428 답글 기능 구현
y-eonee ee5f919
style: #428 separator 설정
y-eonee fdca78c
fix: #428 stub id 수정
y-eonee d8fa920
refactor: #428 불필요한 분기처리 삭제
y-eonee 35423f3
refactor: #428 코드리뷰 반영
y-eonee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
ByeBoo-iOS/ByeBoo-iOS/Data/Model/CommonQuestAnswerDetailResponseDTO.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // | ||
| // CommonQuestAnswerDetailResponseDTO.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 이나연 on 5/5/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct CommonQuestAnswerDetailResponseDTO: Decodable { | ||
| let question: String | ||
| let answer: CommonQuestAnswerResponseDTO | ||
| let comments: [CommonQuestCommentResponseDTO] | ||
| } | ||
|
|
||
| struct CommonQuestCommentResponseDTO: Decodable { | ||
| let commentId: Int | ||
| let replyCount: Int | ||
| let writerId: Int | ||
| let writer: String | ||
| let profileIcon: String | ||
| let writtenAt: String | ||
| let content: String | ||
| } | ||
|
|
||
| extension CommonQuestAnswerDetailResponseDTO { | ||
| func toEntity() -> [CommonQuestCommentEntity] { | ||
| comments.map { | ||
| $0.toEntity() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension CommonQuestCommentResponseDTO { | ||
| func toEntity() -> CommonQuestCommentEntity { | ||
| .init( | ||
| commentID: commentId, | ||
| replyCount: replyCount, | ||
| writerID: writerId, | ||
| writer: writer, | ||
| profileIcon: profileIcon, | ||
| writtenAt: writtenAt, | ||
| content: content | ||
| ) | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
ByeBoo-iOS/ByeBoo-iOS/Data/Model/CommonQuestAnswerRepliesResponseDTO.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // | ||
| // CommonQuestAnswerRepliesResponseDTO.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 이나연 on 5/5/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct CommonQuestAnswerRepliesResponseDTO: Decodable { | ||
| let totalCount: Int | ||
| let comment: CommonQuestAnswerCommentResponseDTO | ||
| let replies: [CommonQuestAnswerReplyResponseDTO] | ||
| } | ||
|
|
||
| struct CommonQuestAnswerCommentResponseDTO: Decodable { | ||
| let content: String | ||
| let writer: String | ||
| let createdAt: String | ||
| let profileIcon: String | ||
| let commentId: Int | ||
| let writerId: Int | ||
| } | ||
|
|
||
| struct CommonQuestAnswerReplyResponseDTO: Decodable { | ||
| let content: String | ||
| let writer: String | ||
| let createdAt: String | ||
| let profileIcon: String | ||
| let commentId: Int | ||
| let writerId: Int | ||
| } | ||
|
|
||
| extension CommonQuestAnswerRepliesResponseDTO { | ||
| func toEntity() -> [CommonQuestCommentEntity] { | ||
| replies.map { | ||
| $0.toEntity() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension CommonQuestAnswerReplyResponseDTO { | ||
| func toEntity() -> CommonQuestCommentEntity { | ||
| .init( | ||
| commentID: commentId, | ||
| replyCount: nil, | ||
| writerID: writerId, | ||
| writer: writer, | ||
| profileIcon: profileIcon, | ||
| writtenAt: createdAt, | ||
| content: content | ||
| ) | ||
| } | ||
| } | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,14 @@ struct CommonQuestAnswersEntity { | |
| struct CommonQuestAnswerEntity { | ||
| let isMyAnswer: Bool | ||
| let answerID: Int | ||
| let writer: String | ||
| let writerID: String | ||
| let profileIcon: String | ||
| let writtenAt: String | ||
| let content: String | ||
| let writerID: Int | ||
| let userID: Int | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. writerID는 왜 이름을 id라고 지은 건가용?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 디티오가 바뀌어서 그거에 따라 수정해주었습니다!! |
||
| let likeCount: Int | ||
| let commentCount: Int | ||
| let isLiked: Bool | ||
| } | ||
|
|
||
| extension CommonQuestAnswersEntity { | ||
|
|
@@ -35,11 +38,14 @@ extension CommonQuestAnswersEntity { | |
| CommonQuestAnswerEntity( | ||
| isMyAnswer: false, | ||
| answerID: $0, | ||
| writer: "유저\($0)", | ||
| writerID: "유저\($0)", | ||
| profileIcon: profileIcons[$0 % 4], | ||
| writtenAt: Date.now.toString(), | ||
| content: "\($0)번째 테스트 답변", | ||
| writerID: 1 | ||
| userID: $0, | ||
| likeCount: 1, | ||
| commentCount: 1, | ||
| isLiked: false | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -61,11 +67,14 @@ extension CommonQuestAnswerEntity { | |
| .init( | ||
| isMyAnswer: false, | ||
| answerID: 1, | ||
| writer: "장원영", | ||
| writerID: "장원영", | ||
| profileIcon: "SO_SO", | ||
| writtenAt: "2025-10-12", | ||
| content: "헤어진 지 벌써 일주일이 지났습니다. 처음에는 실감이 안 나서 눈물조차 나오지 않았어요. 그저 멍하니 천장만 바라보며 시간을 보냈습니다. 그런데 오늘 아침, 습관적으로 휴대폰을 확인하다가 더 이상 '굿모닝' 인사를 보낼 사람이 없다는 사실을 깨닫고 그제야 무너져 내렸습니다. 밥알이 모래알 같아서 잘 넘어가지도 않네요. 친구들은 시간이 약이라고, 더 좋은 사람 만날 거라고 위로하지만 지금 당장은 그 어떤 말도 귀에 들어오지 않습니다.", | ||
| writerID: 1 | ||
| userID: 12, | ||
| likeCount: 3, | ||
| commentCount: 4, | ||
| isLiked: false | ||
| ) | ||
| } | ||
| } | ||
73 changes: 73 additions & 0 deletions
73
ByeBoo-iOS/ByeBoo-iOS/Domain/Entity/CommonQuestCommentEntity.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| // | ||
| // CommonQuestCommentEntity.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 이나연 on 5/5/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct CommonQuestCommentEntity: Hashable { | ||
| let commentID: Int | ||
| let replyCount: Int? | ||
| let writerID: Int | ||
| let writer: String | ||
| let profileIcon: String | ||
| let writtenAt: String | ||
| let content: String | ||
| } | ||
|
|
||
| extension CommonQuestCommentEntity { | ||
| static func toCommentListStub() -> [Self] { | ||
| return (1...5).map { | ||
| .init( | ||
| commentID: $0, | ||
| replyCount: $0 - 1, | ||
| writerID: 2, | ||
| writer: "장원영", | ||
| profileIcon: "SADNESS", | ||
| writtenAt: "2026-02-19T02:09:43.735730", | ||
| content: "나도여ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜ냐냐냐냐냐냐냐냐냐" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| static func toCommentStub() -> Self { | ||
| .init( | ||
| commentID: 1, | ||
| replyCount: 2, | ||
| writerID: 2, | ||
| writer: "가을이", | ||
| profileIcon: "SELF_UNDERSTANDING", | ||
| writtenAt: "2026-02-19T02:09:43.735730", | ||
| content: "나도여ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜ냐냐냐냐냐냐냐냐냐" | ||
| ) | ||
| } | ||
|
|
||
| static func toReplyListStub() -> [Self] { | ||
| return (6...10).map { | ||
| .init( | ||
| commentID: $0, | ||
| replyCount: nil, | ||
| writerID: 2, | ||
| writer: "안유진", | ||
| profileIcon: "SADNESS", | ||
| writtenAt: "2026-02-19T02:09:43.735730", | ||
| content: "헤어짐ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| static func toReplyStub() -> Self { | ||
| .init( | ||
| commentID: 1, | ||
| replyCount: nil, | ||
| writerID: 2, | ||
| writer: "가을이", | ||
| profileIcon: "SELF_UNDERSTANDING", | ||
| writtenAt: "2026-02-19T02:09:43.735730", | ||
| content: "헤어짐" | ||
| ) | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // | ||
| // ProfileIcon.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 이나연 on 5/5/26. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| enum ProfileIcon: String, CaseIterable { | ||
| case sad = "SADNESS" | ||
| case selfUnderstanding = "SELF_UNDERSTANDING" | ||
| case soso = "SO_SO" | ||
| case relieved = "RELIEVED" | ||
|
|
||
| var image: UIImage { | ||
| switch self { | ||
| case .sad: | ||
| return .sadnessBadge | ||
| case .selfUnderstanding: | ||
| return .selfUnderstandingBadge | ||
| case .soso: | ||
| return .sosoBadge | ||
| case .relieved: | ||
| return .relievedBadge | ||
| } | ||
| } | ||
|
|
||
| static func image(for iconString: String) -> UIImage? { | ||
| ProfileIcon(rawValue: iconString)?.image | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment도 여러 개 들어올 수 있지 않나요?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하나의 댓글에 대한 답글 리스트 DTO여서 comment는 하나만 들어올 수 있습니다!!