From bf427a79d950fea4902175b545163a43f236ee61 Mon Sep 17 00:00:00 2001 From: Infi Date: Wed, 14 Jun 2023 17:40:48 +0200 Subject: [PATCH] feat: spaghetti server banner impl Signed-off-by: Infi --- .../screens/chat/drawer/channel/ChannelList.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/java/chat/revolt/components/screens/chat/drawer/channel/ChannelList.kt b/app/src/main/java/chat/revolt/components/screens/chat/drawer/channel/ChannelList.kt index 193a5e22..1cdb03a4 100644 --- a/app/src/main/java/chat/revolt/components/screens/chat/drawer/channel/ChannelList.kt +++ b/app/src/main/java/chat/revolt/components/screens/chat/drawer/channel/ChannelList.kt @@ -28,10 +28,12 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import chat.revolt.R +import chat.revolt.api.REVOLT_FILES import chat.revolt.api.RevoltAPI import chat.revolt.api.internals.ChannelUtils import chat.revolt.api.schemas.ChannelType import chat.revolt.api.schemas.User +import chat.revolt.components.generic.RemoteImage import chat.revolt.components.generic.presenceFromStatus import chat.revolt.components.screens.chat.drawer.server.DrawerChannel import chat.revolt.sheets.ChannelContextSheet @@ -197,6 +199,20 @@ fun RowScope.ChannelList( ) } + server?.banner?.let { + item { + RemoteImage( + url = "$REVOLT_FILES/banners/${it.id}", + description = null, + modifier = Modifier + .fillMaxWidth() + .height(200.dp) + .padding(start = 16.dp, end = 16.dp, top = 0.dp, bottom = 16.dp) + .clip(RoundedCornerShape(16.dp)) + ) + } + } + if (server?.channels?.isEmpty() == true) { item { Column(