Refactor: Improve layout structure in ChannelSideDrawer
This commit enhances the layout structure of the ChannelSideDrawer component by reorganizing the placement of UI elements for better readability and visual separation. - Moved the HorizontalDivider to encapsulate the ChannelItem for SavedMessages, improving the visual hierarchy. - Removed redundant divider items and adjusted spacing for a cleaner layout. - Ensured consistent padding and alignment for UI elements within the drawer.
This commit is contained in:
parent
26e0c3443e
commit
99d47cd51a
|
|
@ -674,46 +674,42 @@ private fun ColumnScope.DirectMessagesChannelListRenderer(
|
|||
.fillMaxSize()
|
||||
.weight(1f)
|
||||
) {
|
||||
item("top-divider") {
|
||||
HorizontalDivider(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
)
|
||||
}
|
||||
|
||||
item(key = "saved_messages") {
|
||||
val notesChannel = RevoltAPI.channelCache.values.firstOrNull {
|
||||
it.channelType == ChannelType.SavedMessages
|
||||
}
|
||||
|
||||
if (notesChannel != null) {
|
||||
ChannelItem(
|
||||
channel = Channel(
|
||||
id = notesChannel.id,
|
||||
name = stringResource(R.string.channel_notes),
|
||||
channelType = ChannelType.SavedMessages
|
||||
),
|
||||
isCurrent = currentDestination is ChatRouterDestination.Channel &&
|
||||
currentDestination.channelId == notesChannel.id,
|
||||
onDestinationChanged = {
|
||||
onDestinationChanged(it)
|
||||
},
|
||||
hasUnread = false,
|
||||
onOpenChannelContextSheet = {},
|
||||
HorizontalDivider(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
)
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
ChannelItem(
|
||||
channel = Channel(
|
||||
id = notesChannel.id,
|
||||
name = stringResource(R.string.channel_notes),
|
||||
channelType = ChannelType.SavedMessages
|
||||
),
|
||||
isCurrent = currentDestination is ChatRouterDestination.Channel &&
|
||||
currentDestination.channelId == notesChannel.id,
|
||||
onDestinationChanged = {
|
||||
onDestinationChanged(it)
|
||||
},
|
||||
hasUnread = false,
|
||||
onOpenChannelContextSheet = {},
|
||||
)
|
||||
HorizontalDivider(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item("bottom-divider") {
|
||||
HorizontalDivider(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
}
|
||||
|
||||
if (dmAbleChannels.isEmpty()) {
|
||||
item(key = "empty-list-state") {
|
||||
Column(
|
||||
|
|
|
|||
Loading…
Reference in New Issue