Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Aug 30, 2024
1 parent 614ba7a commit 686713a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun AppNavigationSuiteScaffold(
navigationItems: List<NavigationItem>,
currentDestination: MainNavigation,
navigateToSelectedItem: (MainNavigation) -> Unit,
content: @Composable (Boolean) -> Unit,
content: @Composable () -> Unit,
) {
Surface(color = SwissTransferTheme.materialColors.background) {
NavigationSuiteScaffoldLayout(
Expand Down Expand Up @@ -88,7 +88,7 @@ fun AppNavigationSuiteScaffold(
}
)
) {
content(layoutType == NavigationSuiteType.NavigationBar)
content()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ enum class ValidityPeriodOption(
private fun SettingsThemeScreenPreview() {
SwissTransferTheme {
Surface {
SettingsValidityPeriodScreen(navigateBack = {}, onValidityPeriodChange = {})
SettingsValidityPeriodScreen(
navigateBack = {},
onValidityPeriodChange = {}
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ enum class EmailLanguageOption(
private fun SettingsThemeScreenPreview() {
SwissTransferTheme {
Surface {
SettingsEmailLanguageScreen(emailLanguage = EmailLanguage.FRENCH, navigateBack = {}, onEmailLanguageChange = {})
SettingsEmailLanguageScreen(
emailLanguage = EmailLanguage.FRENCH,
navigateBack = {},
onEmailLanguageChange = {}
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,9 @@ private fun Theme?.getString(): String {

@Composable
private fun ValidityPeriod?.getString(): String {
return if (this == null) {
""
} else {
val validityPeriodValue = value.toInt()
pluralStringResource(R.plurals.settingsValidityPeriodValue, validityPeriodValue, validityPeriodValue)
}
return this?.value?.toInt()?.let {
pluralStringResource(R.plurals.settingsValidityPeriodValue, it, it)
} ?: ""
}

@Composable
Expand Down

0 comments on commit 686713a

Please sign in to comment.