mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
fix(editable avatar) : disable avatar editing if no permission
This commit is contained in:
+1
@@ -110,6 +110,7 @@ fun RoomDetailsEditView(
|
|||||||
} else {
|
} else {
|
||||||
AvatarType.Room()
|
AvatarType.Room()
|
||||||
},
|
},
|
||||||
|
enabled = state.canChangeAvatar,
|
||||||
onAvatarClick = ::onAvatarClick,
|
onAvatarClick = ::onAvatarClick,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
|
|||||||
+2
@@ -56,6 +56,7 @@ fun EditableAvatarView(
|
|||||||
avatarType: AvatarType,
|
avatarType: AvatarType,
|
||||||
onAvatarClick: () -> Unit,
|
onAvatarClick: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
enabled: Boolean = true,
|
||||||
) {
|
) {
|
||||||
val a11yAvatar = stringResource(CommonStrings.a11y_avatar)
|
val a11yAvatar = stringResource(CommonStrings.a11y_avatar)
|
||||||
val editIconRadius = 15.dp
|
val editIconRadius = 15.dp
|
||||||
@@ -66,6 +67,7 @@ fun EditableAvatarView(
|
|||||||
.wrapContentSize()
|
.wrapContentSize()
|
||||||
.size(height = parentHeight, width = parentWidth)
|
.size(height = parentHeight, width = parentWidth)
|
||||||
.clickable(
|
.clickable(
|
||||||
|
enabled = enabled,
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
onClickLabel = stringResource(CommonStrings.a11y_edit_avatar),
|
onClickLabel = stringResource(CommonStrings.a11y_edit_avatar),
|
||||||
onClick = onAvatarClick,
|
onClick = onAvatarClick,
|
||||||
|
|||||||
Reference in New Issue
Block a user