Skip to content

Commit

Permalink
Simplified modifier on composable Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury committed Oct 2, 2024
1 parent 48b4a5b commit 5eed1ac
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import coil.request.ImageRequest
import org.wordpress.android.R
import org.wordpress.android.ui.compose.theme.M3Theme

/**
* These composables were created for the self-hosted users feature but were written to be reusable
* in other projects.
*/
@Composable
fun UserAvatar(
avatarUrl: String?,
Expand Down Expand Up @@ -166,19 +170,18 @@ fun UserScreen(
)
},
) { contentPadding ->
val extraModifier = if (isScrollable) {
Modifier
.padding(contentPadding)
.verticalScroll(rememberScrollState())
} else {
Modifier
}
Column(
modifier = if (isScrollable) {
Modifier
.fillMaxSize()
.imePadding()
.padding(contentPadding)
.verticalScroll(rememberScrollState())
} else {
Modifier
.fillMaxSize()
.imePadding()
.padding(contentPadding)
}
modifier = Modifier
.fillMaxSize()
.imePadding()
.then(extraModifier)
) {
content()
}
Expand Down

0 comments on commit 5eed1ac

Please sign in to comment.