change(members): update RoomMemberModerationView
This commit is contained in:
parent
f3f40de14a
commit
38eea9d4af
2 changed files with 23 additions and 21 deletions
|
|
@ -232,32 +232,34 @@ private fun RoomMemberActionsBottomSheet(
|
||||||
avatarData = user.getAvatarData(size = AvatarSize.RoomListManageUser),
|
avatarData = user.getAvatarData(size = AvatarSize.RoomListManageUser),
|
||||||
avatarType = AvatarType.User,
|
avatarType = AvatarType.User,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(bottom = 28.dp)
|
.padding(bottom = 24.dp)
|
||||||
.align(Alignment.CenterHorizontally)
|
.align(Alignment.CenterHorizontally)
|
||||||
)
|
)
|
||||||
user.displayName?.let {
|
val bestName = user.getBestName()
|
||||||
Text(
|
|
||||||
text = it,
|
|
||||||
style = ElementTheme.typography.fontHeadingLgBold,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(start = 16.dp, end = 16.dp, bottom = 8.dp)
|
|
||||||
.fillMaxWidth()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
Text(
|
||||||
text = user.userId.value,
|
text = bestName,
|
||||||
style = ElementTheme.typography.fontBodyLgRegular,
|
style = ElementTheme.typography.fontHeadingLgBold,
|
||||||
color = ElementTheme.colors.textSecondary,
|
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.padding(start = 16.dp, end = 16.dp, bottom = 8.dp)
|
||||||
|
.fillMaxWidth()
|
||||||
|
)
|
||||||
|
// Show user ID only if it's different from the display name
|
||||||
|
if (bestName != user.userId.value) {
|
||||||
|
Text(
|
||||||
|
text = user.userId.value,
|
||||||
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
|
color = ElementTheme.colors.textSecondary,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
)
|
)
|
||||||
|
}
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.height(32.dp))
|
||||||
|
|
||||||
for (actionState in actions) {
|
for (actionState in actions) {
|
||||||
|
|
@ -330,8 +332,8 @@ internal fun RoomMemberModerationViewPreview(@PreviewParameter(InternalRoomMembe
|
||||||
ElementPreview {
|
ElementPreview {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.heightIn(min = 64.dp)
|
.heightIn(min = 64.dp)
|
||||||
) {
|
) {
|
||||||
RoomMemberModerationView(
|
RoomMemberModerationView(
|
||||||
state = state,
|
state = state,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ enum class AvatarSize(val dp: Dp) {
|
||||||
InviteSender(16.dp),
|
InviteSender(16.dp),
|
||||||
|
|
||||||
EditRoomDetails(70.dp),
|
EditRoomDetails(70.dp),
|
||||||
RoomListManageUser(70.dp),
|
RoomListManageUser(96.dp),
|
||||||
|
|
||||||
NotificationsOptIn(32.dp),
|
NotificationsOptIn(32.dp),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue