mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 20:38:40 +00:00
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:
+4
-4
@@ -34,18 +34,18 @@ class WelcomeNode @AssistedInject constructor(
|
||||
private val buildMeta: BuildMeta,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun onContinueClicked()
|
||||
fun onContinueClick()
|
||||
}
|
||||
|
||||
private fun onContinueClicked() {
|
||||
plugins.filterIsInstance<Callback>().forEach { it.onContinueClicked() }
|
||||
private fun onContinueClick() {
|
||||
plugins.filterIsInstance<Callback>().forEach { it.onContinueClick() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
WelcomeView(
|
||||
applicationName = buildMeta.applicationName,
|
||||
onContinueClicked = ::onContinueClicked,
|
||||
onContinueClick = ::onContinueClick,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
+4
-4
@@ -52,9 +52,9 @@ import kotlinx.collections.immutable.persistentListOf
|
||||
fun WelcomeView(
|
||||
applicationName: String,
|
||||
modifier: Modifier = Modifier,
|
||||
onContinueClicked: () -> Unit,
|
||||
onContinueClick: () -> Unit,
|
||||
) {
|
||||
BackHandler(onBack = onContinueClicked)
|
||||
BackHandler(onBack = onContinueClick)
|
||||
OnBoardingPage(
|
||||
modifier = modifier
|
||||
.systemBarsPadding()
|
||||
@@ -90,7 +90,7 @@ fun WelcomeView(
|
||||
Button(
|
||||
text = stringResource(CommonStrings.action_continue),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
onClick = onContinueClicked
|
||||
onClick = onContinueClick
|
||||
)
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
}
|
||||
@@ -113,6 +113,6 @@ private fun listItems() = persistentListOf(
|
||||
@Composable
|
||||
internal fun WelcomeViewPreview() {
|
||||
ElementPreview {
|
||||
WelcomeView(applicationName = "Element X", onContinueClicked = {})
|
||||
WelcomeView(applicationName = "Element X", onContinueClick = {})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user