Skip to content

Commit

Permalink
[Feat] #473 - Sort comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jim4020key committed Jul 24, 2023
1 parent 30d6706 commit 2d7c12b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions HappyAnding/HappyAnding/ViewModel/ReadShortcutViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ final class ReadShortcutViewModel: ObservableObject {
shortcutsZipViewModel.setData(model: comments)
commentText = ""
comment = comment.resetComment()
self.comments.comments = comments.fetchSortedComment()
}

func cancelNestedComment() {
Expand Down Expand Up @@ -147,4 +148,8 @@ final class ReadShortcutViewModel: ObservableObject {

shortcutsZipViewModel.setData(model: comments)
}

func fetchUserGrade(id: String) -> Image {
shortcutsZipViewModel.fetchShortcutGradeImage(isBig: false, shortcutGrade: shortcutsZipViewModel.checkShortcutGrade(userID: id))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ extension ReadShortcutView {
/// 유저 정보
HStack(spacing: 8) {

shortcutsZipViewModel.fetchShortcutGradeImage(isBig: false, shortcutGrade: shortcutsZipViewModel.checkShortcutGrade(userID: comment.user_id ))
viewModel.fetchUserGrade(id: comment.user_id)
.font(.system(size: 24, weight: .medium))
.frame(width: 24, height: 24)
.foregroundColor(.gray3)
Expand All @@ -653,7 +653,6 @@ extension ReadShortcutView {
}
.padding(.bottom, 4)


/// 댓글 내용
Text(comment.contents)
.shortcutsZipBody2()
Expand Down

0 comments on commit 2d7c12b

Please sign in to comment.