Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import co.kr.tnt.designsystem.theme.TnTTheme
@Composable
fun TnTCheckToggle(
isChecked: Boolean = false,
onCheckClick: () -> Unit,
onClickCheck: () -> Unit,
modifier: Modifier = Modifier,
) {
val icon = if (isChecked) {
Expand All @@ -47,7 +47,7 @@ fun TnTCheckToggle(
modifier = modifier
.size(24.dp)
.clip(CircleShape)
.clickable(onClick = onCheckClick),
.clickable(onClick = onClickCheck),
)
}

Expand Down Expand Up @@ -96,7 +96,7 @@ private fun TnTCheckTogglePreview() {

TnTCheckToggle(
isChecked = isChecked,
onCheckClick = { isChecked = !isChecked },
onClickCheck = { isChecked = !isChecked },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun TnTCheckToggleDialog(
onLeftButtonClick: () -> Unit,
onRightButtonClick: () -> Unit,
cancelable: Boolean = false,
onCheckClick: () -> Unit,
onClickCheck: () -> Unit,
onDismiss: () -> Unit,
) {
Dialog(
Expand Down Expand Up @@ -88,15 +88,15 @@ fun TnTCheckToggleDialog(
) {
TnTCheckToggle(
isChecked = isChecked,
onCheckClick = onCheckClick,
onClickCheck = onClickCheck,
)
Text(
text = checkToggleText,
style = TnTTheme.typography.body2Medium,
color = TnTTheme.colors.neutralColors.Neutral500,
modifier = Modifier
.padding(start = 4.dp)
.clickable(onClick = onCheckClick),
.clickable(onClick = onClickCheck),
)
}
Row(
Expand Down Expand Up @@ -135,7 +135,7 @@ private fun TnTCheckToggleDialogPreview() {
isChecked = isChecked,
onLeftButtonClick = {},
onRightButtonClick = {},
onCheckClick = { isChecked = !isChecked },
onClickCheck = { isChecked = !isChecked },
leftButtonText = "다음에",
rightButtonText = "연결하기",
onDismiss = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class RoleSelectionContract {
) : UiState

sealed interface RoleSelectionUiEvent : UiEvent {
data class OnNextClick(val role: RoleState) : RoleSelectionUiEvent
data class OnClickNext(val role: RoleState) : RoleSelectionUiEvent
}

sealed interface RoleSelectionEffect : UiSideEffect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal fun RoleSelectionRoute(
navigateToTrainerSignUp: () -> Unit,
) {
RoleSelectionScreen(
onNextClick = { viewModel.setEvent(RoleSelectionUiEvent.OnNextClick(it)) },
onClickNext = { viewModel.setEvent(RoleSelectionUiEvent.OnClickNext(it)) },
)

LaunchedEffect(viewModel.effect) {
Expand All @@ -60,7 +60,7 @@ internal fun RoleSelectionRoute(

@Composable
fun RoleSelectionScreen(
onNextClick: (RoleState) -> Unit = {},
onClickNext: (RoleState) -> Unit = {},
) {
var selectedRole by remember { mutableStateOf(RoleState.fromDomain(UserType.TRAINER)) }

Expand All @@ -69,7 +69,7 @@ fun RoleSelectionScreen(
TnTBottomButton(
text = stringResource(uiResource.string.next),
enabled = true,
onClick = { onNextClick(selectedRole) },
onClick = { onClickNext(selectedRole) },
modifier = Modifier.navigationBarsPadding(),
)
},
Expand Down Expand Up @@ -112,7 +112,11 @@ fun RoleSelectionScreen(
text = stringResource(RoleState.Trainer.textResId),
modifier = Modifier.weight(1f),
size = ButtonSize.Large,
type = if (selectedRole == RoleState.Trainer) ButtonType.RedOutline else ButtonType.GrayOutline,
type = if (selectedRole == RoleState.Trainer) {
ButtonType.RedOutline
} else {
ButtonType.GrayOutline
},
onClick = {
selectedRole = RoleState.Trainer
},
Expand All @@ -121,7 +125,11 @@ fun RoleSelectionScreen(
text = stringResource(RoleState.Trainee.textResId),
modifier = Modifier.weight(1f),
size = ButtonSize.Large,
type = if (selectedRole == RoleState.Trainee) ButtonType.RedOutline else ButtonType.GrayOutline,
type = if (selectedRole == RoleState.Trainee) {
ButtonType.RedOutline
} else {
ButtonType.GrayOutline
},
onClick = {
selectedRole = RoleState.Trainee
},
Expand All @@ -137,7 +145,7 @@ fun RoleSelectionScreen(
private fun RoleScreenPreview() {
TnTTheme {
RoleSelectionScreen(
onNextClick = {},
onClickNext = { },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class RoleSelectionViewModel @Inject constructor() :
) {
override suspend fun handleEvent(event: RoleSelectionUiEvent) {
when (event) {
is RoleSelectionUiEvent.OnNextClick -> navigateToSignUp(event.role)
is RoleSelectionUiEvent.OnClickNext -> navigateToSignUp(event.role)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ internal fun CodeEntryPage(
inviteCode: String,
inputState: InputState,
screenMode: ScreenMode,
onSkipClick: () -> Unit,
onBackClick: () -> Unit,
onNextClick: () -> Unit,
onClickSkip: () -> Unit,
onClickBack: () -> Unit,
onClickNext: () -> Unit,
onChangeInviteCode: (code: String) -> Unit,
onValidateClick: (code: String) -> Unit,
onCancelClick: () -> Unit,
onDismissPopup: () -> Unit,
onClickValidate: (code: String) -> Unit,
onClickCancel: () -> Unit,
onDismissDialog: () -> Unit,
) {
BackHandler {
when (screenMode) {
ScreenMode.BACK -> onBackClick()
ScreenMode.SKIP -> onSkipClick()
ScreenMode.CLOSE -> onBackClick()
ScreenMode.BACK -> onClickBack()
ScreenMode.SKIP -> onClickSkip()
ScreenMode.CLOSE -> onClickBack()
}
}

Expand All @@ -61,7 +61,7 @@ internal fun CodeEntryPage(
ScreenMode.BACK -> {
TnTTopBarWithBackButton(
title = stringResource(coreR.string.connect),
onBackClick = onBackClick,
onBackClick = onClickBack,
)
}
ScreenMode.SKIP -> {
Expand All @@ -72,9 +72,7 @@ internal fun CodeEntryPage(
text = stringResource(coreR.string.skip),
color = TnTTheme.colors.neutralColors.Neutral400,
style = TnTTheme.typography.body2Medium,
modifier = Modifier.clickable {
onSkipClick()
},
modifier = Modifier.clickable { onClickSkip() },
)
},
)
Expand All @@ -84,7 +82,7 @@ internal fun CodeEntryPage(
title = stringResource(coreR.string.connect),
trailingComponent = {
IconButton(
onClick = onBackClick,
onClick = onClickBack,
) {
Icon(
painter = painterResource(uiResource.drawable.ic_delete),
Expand Down Expand Up @@ -119,15 +117,15 @@ internal fun CodeEntryPage(
text = stringResource(R.string.verification),
size = ButtonSize.Small,
enabled = inviteCode.isNotBlank(),
onClick = { onValidateClick(inviteCode) },
onClick = { onClickValidate(inviteCode) },
)
},
)
}
TnTBottomButton(
text = stringResource(coreR.string.next),
enabled = inputState.isValid,
onClick = onNextClick,
onClick = onClickNext,
modifier = Modifier.align(Alignment.BottomCenter),
)
}
Expand All @@ -139,9 +137,9 @@ internal fun CodeEntryPage(
content = stringResource(R.string.warning_reconnect_needed),
leftButtonText = stringResource(coreR.string.cancel),
rightButtonText = stringResource(coreR.string.ok),
onLeftButtonClick = onCancelClick,
onRightButtonClick = onDismissPopup,
onDismiss = onDismissPopup,
onLeftButtonClick = onClickCancel,
onRightButtonClick = onDismissDialog,
onDismiss = onDismissDialog,
)
}
}
Expand All @@ -155,13 +153,13 @@ private fun CodeEntryPagePreview() {
inputState = InputState.FOCUS,
inviteCode = "23A4SDA31",
screenMode = ScreenMode.CLOSE,
onSkipClick = {},
onNextClick = {},
onValidateClick = {},
onChangeInviteCode = {},
onBackClick = {},
onDismissPopup = {},
onCancelClick = {},
onClickSkip = { },
onClickNext = { },
onClickBack = { },
onClickValidate = { },
onChangeInviteCode = { },
onDismissDialog = { },
onClickCancel = { },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ internal fun PTSessionFormPage(
onChangeSessionStartDate: (date: LocalDate) -> Unit,
onChangeCompletedSessionCount: (count: String) -> Unit,
onChangeTotalSessionCount: (count: String) -> Unit,
onNextClick: () -> Unit,
onBackClick: () -> Unit,
onClickNext: () -> Unit,
onClickBack: () -> Unit,
) {
BackHandler { onBackClick() }
BackHandler { onClickBack() }

val today = LocalDate.now()

Expand Down Expand Up @@ -84,7 +84,7 @@ internal fun PTSessionFormPage(
topBar = {
TnTTopBarWithBackButton(
title = stringResource(R.string.add_pt_info),
onBackClick = onBackClick,
onBackClick = onClickBack,
)
},
containerColor = TnTTheme.colors.commonColors.Common0,
Expand Down Expand Up @@ -210,7 +210,7 @@ internal fun PTSessionFormPage(
text = stringResource(uiResource.string.next),
modifier = Modifier.align(Alignment.BottomCenter),
enabled = isFormValid,
onClick = throttled { onNextClick() },
onClick = throttled { onClickNext() },
)
}
}
Expand Down Expand Up @@ -311,8 +311,8 @@ private fun PTSessionFormPagePreview() {
completedSessionCount = "15",
totalSessionCount = "10",
isLoading = false,
onNextClick = { },
onBackClick = { },
onClickNext = { },
onClickBack = { },
onChangeSessionStartDate = { },
onChangeCompletedSessionCount = { },
onChangeTotalSessionCount = { },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ internal fun TraineeConnectCompletePage(
trainerImage: String,
traineeName: String,
traineeImage: String,
onNextClick: () -> Unit,
onBackClick: () -> Unit,
onClickNext: () -> Unit,
onClickBack: () -> Unit,
) {
BackHandler { onBackClick() }
BackHandler { onClickBack() }

val context = LocalContext.current

Expand Down Expand Up @@ -108,7 +108,7 @@ internal fun TraineeConnectCompletePage(
}
TnTBottomButton(
text = stringResource(uiResource.string.next),
onClick = onNextClick,
onClick = onClickNext,
modifier = Modifier.align(Alignment.BottomCenter),
)
}
Expand Down Expand Up @@ -162,8 +162,8 @@ private fun TraineeConnectCompletePagePreview() {
trainerImage = "",
traineeName = "김회원",
traineeImage = "",
onNextClick = {},
onBackClick = {},
onClickNext = { },
onClickBack = { },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ internal class TraineeConnectContract {
) : UiState

sealed interface TraineeConnectUiEvent : UiEvent {
data class OnCodeValidateClick(val code: String) : TraineeConnectUiEvent
data class OnClickValidateCode(val code: String) : TraineeConnectUiEvent
data class OnChangeInviteCode(val code: String) : TraineeConnectUiEvent
data object OnChangeDialogState : TraineeConnectUiEvent
data class OnChangeSessionStartDate(val date: LocalDate) : TraineeConnectUiEvent
data class OnChangeCompletedSessionCount(val count: String) : TraineeConnectUiEvent
data class OnChangeTotalSessionCount(val count: String) : TraineeConnectUiEvent
data object OnNextClick : TraineeConnectUiEvent
data object OnBackClick : TraineeConnectUiEvent
data object OnSkipClick : TraineeConnectUiEvent
data object OnClickNext : TraineeConnectUiEvent
data object OnClickBack : TraineeConnectUiEvent
data object OnClickSkip : TraineeConnectUiEvent
}

sealed interface TraineeConnectSideEffect : UiSideEffect {
Expand Down
Loading