Skip to content

Commit

Permalink
the advanced feature known as emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
prapooskur committed Jan 21, 2024
1 parent 22007a0 commit cbe3428
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ fun CourseSectionsBox(courseInfo: CourseInfo) {
color = MaterialTheme.colorScheme.surfaceColorAtElevation(ELEV_VALUE),
shape = MaterialTheme.shapes.medium
) {

Column(
Modifier
.fillMaxWidth()
Expand All @@ -326,6 +327,11 @@ fun CourseSectionsBox(courseInfo: CourseInfo) {
}
Divider(modifier = Modifier.padding(top = 4.dp, bottom = 4.dp))
courseInfo.secondary_sections.forEachIndexed { index, section ->
val emoji = when (section.enrl_status) {
"Open" -> "\uD83D\uDFE2"
"Waitlisted" -> "\uD83D\uDFE1"
else -> "\uD83D\uDFE6"
}
section.meetings.forEachIndexed { index, meeting ->
Spacer(Modifier.height(4.dp))
Row(Modifier.fillMaxWidth()) {
Expand All @@ -350,6 +356,12 @@ fun CourseSectionsBox(courseInfo: CourseInfo) {
modifier = Modifier.padding(start = 4.dp, end = 4.dp)
)
}
Row(Modifier.fillMaxWidth()) {
Text(
"$emoji Enrolled: ${section.enrl_total}/${section.capacity}",
modifier = Modifier.padding(start = 4.dp, end = 4.dp)
)
}

Spacer(Modifier.height(4.dp))

Expand Down

0 comments on commit cbe3428

Please sign in to comment.