Extract MainActionsSection from the when cases, since this is code duplication.

This commit is contained in:
Benoit Marty
2024-06-21 15:03:07 +02:00
committed by Benoit Marty
parent e730c2c213
commit a2c8dc42cb

View File

@@ -135,14 +135,7 @@ fun RoomDetailsView(
openAvatarPreview(state.roomName, avatarUrl)
},
)
MainActionsSection(
state = state,
onShareRoom = onShareRoom,
onInvitePeople = invitePeople,
onCall = onJoinCallClick,
)
}
is RoomDetailsType.Dm -> {
val member = state.roomType.roomMember
UserProfileHeaderSection(
@@ -153,14 +146,14 @@ fun RoomDetailsView(
openAvatarPreview(member.getBestName(), avatarUrl)
},
)
MainActionsSection(
state = state,
onShareRoom = onShareRoom,
onInvitePeople = invitePeople,
onCall = onJoinCallClick,
)
}
}
MainActionsSection(
state = state,
onShareRoom = onShareRoom,
onInvitePeople = invitePeople,
onCall = onJoinCallClick,
)
Spacer(Modifier.height(12.dp))
if (state.roomTopic !is RoomTopicState.Hidden) {