Extract MainActionsSection from the when cases, since this is code duplication.
This commit is contained in:
parent
e730c2c213
commit
a2c8dc42cb
1 changed files with 6 additions and 13 deletions
|
|
@ -135,14 +135,7 @@ fun RoomDetailsView(
|
||||||
openAvatarPreview(state.roomName, avatarUrl)
|
openAvatarPreview(state.roomName, avatarUrl)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
MainActionsSection(
|
|
||||||
state = state,
|
|
||||||
onShareRoom = onShareRoom,
|
|
||||||
onInvitePeople = invitePeople,
|
|
||||||
onCall = onJoinCallClick,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is RoomDetailsType.Dm -> {
|
is RoomDetailsType.Dm -> {
|
||||||
val member = state.roomType.roomMember
|
val member = state.roomType.roomMember
|
||||||
UserProfileHeaderSection(
|
UserProfileHeaderSection(
|
||||||
|
|
@ -153,14 +146,14 @@ fun RoomDetailsView(
|
||||||
openAvatarPreview(member.getBestName(), avatarUrl)
|
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))
|
Spacer(Modifier.height(12.dp))
|
||||||
|
|
||||||
if (state.roomTopic !is RoomTopicState.Hidden) {
|
if (state.roomTopic !is RoomTopicState.Hidden) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue