Replace 'leave room' text with 'leave conversation' for DMs (#2231)
* Replace 'leave room' text with 'leave conversation' for DMs * Add `isDm` property to both `RoomSummary` and `RoomListRoomSummary` * Remove redundant `leave_conversation_alert_subtitle_*` texts * Fix maestro flow --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
a9776f9fcb
commit
64a18afc1b
77 changed files with 115 additions and 19 deletions
|
|
@ -190,9 +190,10 @@ fun RoomDetailsView(
|
|||
BlockUserDialogs(roomMemberState)
|
||||
}
|
||||
|
||||
OtherActionsSection(onLeaveRoom = {
|
||||
state.eventSink(RoomDetailsEvent.LeaveRoom)
|
||||
})
|
||||
OtherActionsSection(
|
||||
isDm = state.roomType is RoomDetailsType.Dm,
|
||||
onLeaveRoom = { state.eventSink(RoomDetailsEvent.LeaveRoom) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -410,10 +411,17 @@ private fun SecuritySection(modifier: Modifier = Modifier) {
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun OtherActionsSection(onLeaveRoom: () -> Unit, modifier: Modifier = Modifier) {
|
||||
private fun OtherActionsSection(isDm: Boolean, onLeaveRoom: () -> Unit, modifier: Modifier = Modifier) {
|
||||
PreferenceCategory(showDivider = false, modifier = modifier) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(R.string.screen_room_details_leave_room_title)) },
|
||||
headlineContent = {
|
||||
val leaveText = stringResource(id = if (isDm) {
|
||||
R.string.screen_room_details_leave_conversation_title
|
||||
} else {
|
||||
R.string.screen_room_details_leave_room_title
|
||||
})
|
||||
Text(leaveText)
|
||||
},
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave)),
|
||||
style = ListItemStyle.Destructive,
|
||||
onClick = onLeaveRoom,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
<string name="screen_dm_details_unblock_alert_action">"Unblock"</string>
|
||||
<string name="screen_dm_details_unblock_alert_description">"You\'ll be able to see all messages from them again."</string>
|
||||
<string name="screen_dm_details_unblock_user">"Unblock user"</string>
|
||||
<string name="screen_room_details_leave_conversation_title">"Leave conversation"</string>
|
||||
<string name="screen_room_details_leave_room_title">"Leave room"</string>
|
||||
<string name="screen_room_details_security_title">"Security"</string>
|
||||
<string name="screen_room_details_topic_title">"Topic"</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue