Skip to content

Commit 4387072

Browse files
committed
✨ :: Add mission list click navigation
1 parent 0948c26 commit 4387072

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

feature/main/src/main/java/com/stackknowledge/main/component/MissionList.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import remote.response.mission.MissionResponseModel
3131
fun MissionList(
3232
modifier: Modifier = Modifier,
3333
getMissionUiState: GetMissionUiState,
34+
onClick: (Int) -> Unit,
3435
) {
3536
StackKnowledgeAndroidTheme { colors, typography ->
3637
Column(
@@ -75,7 +76,8 @@ fun MissionList(
7576
MissionListItem(
7677
teacherName = list[index].user.name,
7778
title = list[index].title,
78-
point = list[index].point.toString()
79+
point = list[index].point.toString(),
80+
onClick = { onClick(index) },
7981
)
8082
Spacer(modifier = modifier.width(16.dp))
8183
}

feature/main/src/main/java/com/stackknowledge/main/component/MissionListItem.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.stackknowledge.main.component
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.clickable
45
import androidx.compose.foundation.layout.Box
56
import androidx.compose.foundation.layout.Column
67
import androidx.compose.foundation.layout.Row
@@ -24,6 +25,7 @@ fun MissionListItem(
2425
teacherName: String,
2526
title: String,
2627
point: String,
28+
onClick: () -> Unit,
2729
) {
2830
StackKnowledgeAndroidTheme { colors, typography ->
2931
Box(
@@ -33,7 +35,8 @@ fun MissionListItem(
3335
.background(
3436
color = colors.WHITE,
3537
shape = RoundedCornerShape(20.dp)
36-
),
38+
)
39+
.clickable(onClick = onClick),
3740
contentAlignment = Alignment.Center
3841
) {
3942
Column(
@@ -77,6 +80,7 @@ fun MissionListItemPre() {
7780
MissionListItem(
7881
teacherName = "미소쌤",
7982
title = "북학파의 배경",
80-
point = "1000"
83+
point = "1000",
84+
onClick = {}
8185
)
8286
}

0 commit comments

Comments
 (0)