Skip to content

Commit

Permalink
♻️ :: Selector Component click이벤트 CallBack함수 컨벤션 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaejongin12 committed May 31, 2024
1 parent c4eecb2 commit aed63b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun SelectedIndicator(
isSelected: Boolean,
modifier: Modifier = Modifier,
enabled: Boolean = true,
onClick: (() -> Unit)?
onClicked: (() -> Unit)?
) {
val interactionSource = remember { mutableStateOf(MutableInteractionSource()) }
BitgoeulAndroidTheme { colors, _ ->
Expand All @@ -37,8 +37,8 @@ fun SelectedIndicator(
interactionSource = interactionSource.value,
indication = rememberRipple(bounded = false)
) {
if (onClick != null && enabled) {
onClick()
if (onClicked != null && enabled) {
onClicked()
}
},
) {
Expand All @@ -64,8 +64,8 @@ fun SelectedIndicatorPre() {
.background(Color.White)
.fillMaxSize()
) {
SelectedIndicator(isSelected = selected.value == "0", onClick = { selected.value = "0" })
SelectedIndicator(isSelected = selected.value == "0", onClicked = { selected.value = "0" })
Spacer(modifier = Modifier.height(15.dp))
SelectedIndicator(isSelected = selected.value == "1", onClick = { selected.value = "1" })
SelectedIndicator(isSelected = selected.value == "1", onClicked = { selected.value = "1" })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.msg.design_system.theme.BitgoeulAndroidTheme
fun Selector(
value: String,
isSelected: Boolean,
onClick: () -> Unit
onClicked: () -> Unit
) {
BitgoeulAndroidTheme { _, typography ->
Box(
Expand All @@ -29,7 +29,7 @@ fun Selector(
indication = null,
interactionSource = remember { MutableInteractionSource() }
) {
onClick()
onClicked()
}
) {
Text(
Expand All @@ -40,8 +40,8 @@ fun Selector(
SelectedIndicator(
isSelected = isSelected,
modifier = Modifier.align(Alignment.CenterEnd),
onClick = {
onClick()
onClicked = {
onClicked()
}
)
}
Expand Down

0 comments on commit aed63b6

Please sign in to comment.