fix: colours in member sheet
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
a37307a766
commit
0cc8ca79a5
|
|
@ -16,6 +16,7 @@ import chat.revolt.api.schemas.Member
|
|||
import chat.revolt.api.schemas.User
|
||||
import chat.revolt.components.generic.UserAvatar
|
||||
import chat.revolt.components.generic.presenceFromStatus
|
||||
import chat.revolt.internals.extensions.TransparentListItemColours
|
||||
|
||||
@Composable
|
||||
fun MemberListItem(
|
||||
|
|
@ -40,6 +41,7 @@ fun MemberListItem(
|
|||
?: Brush.solidColor(LocalContentColor.current)
|
||||
|
||||
ListItem(
|
||||
colors = TransparentListItemColours,
|
||||
modifier = modifier,
|
||||
headlineContent = {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import androidx.compose.ui.unit.dp
|
|||
@Composable
|
||||
fun ListHeader(
|
||||
modifier: Modifier = Modifier,
|
||||
backgroundColor: Color = MaterialTheme.colorScheme.surface,
|
||||
backgroundColor: Color = Color.Transparent,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
CompositionLocalProvider(LocalTextStyle provides MaterialTheme.typography.labelLarge) {
|
||||
|
|
@ -39,7 +39,7 @@ fun ListHeader(
|
|||
fun CountableListHeader(
|
||||
text: String,
|
||||
count: Int,
|
||||
backgroundColor: Color = MaterialTheme.colorScheme.surface
|
||||
backgroundColor: Color = Color.Transparent
|
||||
) {
|
||||
ListHeader(backgroundColor = backgroundColor) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@ import androidx.compose.foundation.clickable
|
|||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.ListItemDefaults
|
||||
import androidx.compose.material3.LocalContentColor
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import chat.revolt.internals.extensions.TransparentListItemColours
|
||||
|
||||
@Composable
|
||||
fun SheetButton(
|
||||
|
|
@ -28,9 +27,7 @@ fun SheetButton(
|
|||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
ListItem(
|
||||
colors = ListItemDefaults.colors().copy(
|
||||
containerColor = Color.Transparent
|
||||
),
|
||||
colors = TransparentListItemColours,
|
||||
headlineContent = {
|
||||
CompositionLocalProvider(
|
||||
value = if (dangerous) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package chat.revolt.internals.extensions
|
||||
|
||||
import androidx.compose.material3.ListItemColors
|
||||
import androidx.compose.material3.ListItemDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val TransparentListItemColours: ListItemColors
|
||||
@Composable
|
||||
get() = ListItemDefaults.colors().copy(
|
||||
containerColor = Color.Transparent
|
||||
)
|
||||
|
|
@ -17,7 +17,6 @@ import androidx.compose.material3.MaterialTheme
|
|||
import androidx.compose.material3.ModalBottomSheet
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.rememberModalBottomSheetState
|
||||
import androidx.compose.material3.surfaceColorAtElevation
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
|
|
@ -314,7 +313,7 @@ fun MemberListSheet(
|
|||
CountableListHeader(
|
||||
text = item.category,
|
||||
count = item.count,
|
||||
backgroundColor = MaterialTheme.colorScheme.surfaceColorAtElevation(2.dp)
|
||||
backgroundColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue