generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from School-of-Company/398-add-fetch-applied-…
…lecture-student-detail-feature 🔀 :: [#398] 강의 이수중인 학생 상세조회 기능 추가
- Loading branch information
Showing
39 changed files
with
392 additions
and
296 deletions.
There are no files selected for viewing
This file contains 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 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
91 changes: 50 additions & 41 deletions
91
...ources/Feature/LectureApplicantListFeature/Source/Component/LectureApplicantListRow.swift
This file contains 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 |
---|---|---|
@@ -1,51 +1,60 @@ | ||
import SwiftUI | ||
import Service | ||
|
||
struct LectureApplicantListRow: View { | ||
let studentID: String | ||
@State var isComplete: Bool | ||
let email: String | ||
let name: String | ||
let grade: Int | ||
let classNumber: Int | ||
let number: Int | ||
let cohort: Int | ||
let phoneNumber: String | ||
let schoolName: String | ||
let clubName: String | ||
let onSelectedStudent: (Bool, String) -> Void | ||
let studentInfo: ApplicantInfoEntity | ||
@Binding var state: LectureApplicantListPageState | ||
@Binding var isSelected: Bool | ||
|
||
var body: some View { | ||
HStack(alignment: .top, spacing: 24) { | ||
CheckButton( | ||
isSelected: Binding( | ||
get: { isComplete }, | ||
set: { isSelected in | ||
if isSelected { | ||
isComplete = isSelected | ||
onSelectedStudent(isSelected, studentID) | ||
} else { | ||
isComplete = isSelected | ||
onSelectedStudent(isSelected, studentID) | ||
} | ||
} | ||
) | ||
) | ||
|
||
VStack(alignment: .leading, spacing: 8) { | ||
BitgouelText( | ||
text: "\(grade)학년 \(classNumber)반 \(number)번 \(cohort)기 \(name)", | ||
font: .text1 | ||
) | ||
|
||
Group { | ||
Text("\(phoneNumber.withHypen) | \(email)") | ||
|
||
Text(schoolName) | ||
|
||
Text(clubName) | ||
HStack(alignment: .center, spacing: 16) { | ||
completionStatusCheckButton() | ||
|
||
VStack(alignment: .leading, spacing: 4) { | ||
HStack(spacing: 4) { | ||
BitgouelText( | ||
text: studentInfo.name, | ||
font: .text1 | ||
) | ||
|
||
completionStatusText() | ||
} | ||
|
||
HStack(spacing: 4) { | ||
Text(studentInfo.school) | ||
|
||
Text("\(studentInfo.grade)학년 \(studentInfo.classNumber)반 \(studentInfo.number)번") | ||
} | ||
.bitgouelFont(.caption, color: .greyscale(.g7)) | ||
.bitgouelFont(.caption, color: .greyscale(.g4)) | ||
|
||
Text(studentInfo.clubName) | ||
.bitgouelFont(.caption, color: .greyscale(.g7)) | ||
} | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func completionStatusCheckButton() -> some View { | ||
switch state { | ||
case .general: | ||
EmptyView() | ||
|
||
case .check: | ||
CheckButton(isSelected: $isSelected) | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func completionStatusText() -> some View { | ||
switch state { | ||
case .general: | ||
if studentInfo.isComplete { | ||
Text("이수완료") | ||
.bitgouelFont(.caption, color: .primary(.p5)) | ||
} | ||
|
||
case .check: | ||
EmptyView() | ||
} | ||
} | ||
} |
This file contains 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 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 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.