Lambda parameters in a composable function should be in present tense, not past tense.

https://mrmans0n.github.io/compose-rules/rules/#naming-parameters-properly
This commit is contained in:
Benoit Marty 2024-05-29 10:48:29 +02:00
parent b8f3b66d0e
commit 87689d787e
250 changed files with 1698 additions and 1698 deletions

View file

@ -51,8 +51,8 @@ class BugReportNode @AssistedInject constructor(
BugReportView(
state = state,
modifier = modifier,
onBackPressed = { navigateUp() },
onDone = {
onBackClick = { navigateUp() },
onSuccess = {
activity?.toast(CommonStrings.common_report_submitted)
onDone()
},

View file

@ -57,8 +57,8 @@ import io.element.android.libraries.ui.strings.CommonStrings
fun BugReportView(
state: BugReportState,
onViewLogs: () -> Unit,
onDone: () -> Unit,
onBackPressed: () -> Unit,
onSuccess: () -> Unit,
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
) {
val eventSink = state.eventSink
@ -66,7 +66,7 @@ fun BugReportView(
Box(modifier = modifier) {
PreferencePage(
title = stringResource(id = CommonStrings.common_report_a_problem),
onBackPressed = onBackPressed
onBackClick = onBackClick
) {
val isFormEnabled = state.sending !is AsyncAction.Loading
var descriptionFieldState by textFieldState(
@ -163,7 +163,7 @@ fun BugReportView(
progressDialog = { },
onSuccess = {
eventSink(BugReportEvents.ResetAll)
onDone()
onSuccess()
},
errorMessage = { error ->
when (error) {
@ -181,8 +181,8 @@ fun BugReportView(
internal fun BugReportViewPreview(@PreviewParameter(BugReportStateProvider::class) state: BugReportState) = ElementPreview {
BugReportView(
state = state,
onDone = {},
onBackPressed = {},
onSuccess = {},
onBackClick = {},
onViewLogs = {},
)
}