Skip to content

Commit

Permalink
Make content the last param on ScreenWithTopBar
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury committed Oct 3, 2024
1 parent c7e3017 commit 0ea0d7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ fun MessageView(
@Composable
fun ScreenWithTopBar(
title: String,
content: @Composable () -> Unit,
onCloseClick: () -> Unit,
isScrollable: Boolean,
closeIcon: ImageVector = Icons.Default.Close,
content: @Composable () -> Unit,
) {
M3Theme {
Scaffold(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ fun SelfHostedUsersScreen(
else -> false
}

val content: @Composable () -> Unit = @Composable {
ScreenWithTopBar(
title = title,
onCloseClick = { onCloseClick() },
isScrollable = isScrollable,
closeIcon = closeIcon,
) {
when (state) {
is SelfHostedUserState.Loading -> {
ProgressDialog(
Expand Down Expand Up @@ -95,14 +100,6 @@ fun SelfHostedUsersScreen(
}
}
}

ScreenWithTopBar(
content = content,
title = title,
onCloseClick = { onCloseClick() },
isScrollable = isScrollable,
closeIcon = closeIcon,
)
}

@Composable
Expand Down

0 comments on commit 0ea0d7e

Please sign in to comment.