File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
feature/main/src/main/java/com/stackknowledge/main/component Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import remote.response.mission.MissionResponseModel
31
31
fun MissionList (
32
32
modifier : Modifier = Modifier ,
33
33
getMissionUiState : GetMissionUiState ,
34
+ onClick : (Int ) -> Unit ,
34
35
) {
35
36
StackKnowledgeAndroidTheme { colors, typography ->
36
37
Column (
@@ -75,7 +76,8 @@ fun MissionList(
75
76
MissionListItem (
76
77
teacherName = list[index].user.name,
77
78
title = list[index].title,
78
- point = list[index].point.toString()
79
+ point = list[index].point.toString(),
80
+ onClick = { onClick(index) },
79
81
)
80
82
Spacer (modifier = modifier.width(16 .dp))
81
83
}
Original file line number Diff line number Diff line change 1
1
package com.stackknowledge.main.component
2
2
3
3
import androidx.compose.foundation.background
4
+ import androidx.compose.foundation.clickable
4
5
import androidx.compose.foundation.layout.Box
5
6
import androidx.compose.foundation.layout.Column
6
7
import androidx.compose.foundation.layout.Row
@@ -24,6 +25,7 @@ fun MissionListItem(
24
25
teacherName : String ,
25
26
title : String ,
26
27
point : String ,
28
+ onClick : () -> Unit ,
27
29
) {
28
30
StackKnowledgeAndroidTheme { colors, typography ->
29
31
Box (
@@ -33,7 +35,8 @@ fun MissionListItem(
33
35
.background(
34
36
color = colors.WHITE ,
35
37
shape = RoundedCornerShape (20 .dp)
36
- ),
38
+ )
39
+ .clickable(onClick = onClick),
37
40
contentAlignment = Alignment .Center
38
41
) {
39
42
Column (
@@ -77,6 +80,7 @@ fun MissionListItemPre() {
77
80
MissionListItem (
78
81
teacherName = " 미소쌤" ,
79
82
title = " 북학파의 배경" ,
80
- point = " 1000"
83
+ point = " 1000" ,
84
+ onClick = {}
81
85
)
82
86
}
You can’t perform that action at this time.
0 commit comments