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.api.schemas.User
|
||||||
import chat.revolt.components.generic.UserAvatar
|
import chat.revolt.components.generic.UserAvatar
|
||||||
import chat.revolt.components.generic.presenceFromStatus
|
import chat.revolt.components.generic.presenceFromStatus
|
||||||
|
import chat.revolt.internals.extensions.TransparentListItemColours
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MemberListItem(
|
fun MemberListItem(
|
||||||
|
|
@ -40,6 +41,7 @@ fun MemberListItem(
|
||||||
?: Brush.solidColor(LocalContentColor.current)
|
?: Brush.solidColor(LocalContentColor.current)
|
||||||
|
|
||||||
ListItem(
|
ListItem(
|
||||||
|
colors = TransparentListItemColours,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
Text(
|
Text(
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import androidx.compose.ui.unit.dp
|
||||||
@Composable
|
@Composable
|
||||||
fun ListHeader(
|
fun ListHeader(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
backgroundColor: Color = MaterialTheme.colorScheme.surface,
|
backgroundColor: Color = Color.Transparent,
|
||||||
content: @Composable () -> Unit,
|
content: @Composable () -> Unit,
|
||||||
) {
|
) {
|
||||||
CompositionLocalProvider(LocalTextStyle provides MaterialTheme.typography.labelLarge) {
|
CompositionLocalProvider(LocalTextStyle provides MaterialTheme.typography.labelLarge) {
|
||||||
|
|
@ -39,7 +39,7 @@ fun ListHeader(
|
||||||
fun CountableListHeader(
|
fun CountableListHeader(
|
||||||
text: String,
|
text: String,
|
||||||
count: Int,
|
count: Int,
|
||||||
backgroundColor: Color = MaterialTheme.colorScheme.surface
|
backgroundColor: Color = Color.Transparent
|
||||||
) {
|
) {
|
||||||
ListHeader(backgroundColor = backgroundColor) {
|
ListHeader(backgroundColor = backgroundColor) {
|
||||||
Text(
|
Text(
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
import androidx.compose.material3.ListItemDefaults
|
|
||||||
import androidx.compose.material3.LocalContentColor
|
import androidx.compose.material3.LocalContentColor
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import chat.revolt.internals.extensions.TransparentListItemColours
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SheetButton(
|
fun SheetButton(
|
||||||
|
|
@ -28,9 +27,7 @@ fun SheetButton(
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
colors = ListItemDefaults.colors().copy(
|
colors = TransparentListItemColours,
|
||||||
containerColor = Color.Transparent
|
|
||||||
),
|
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
CompositionLocalProvider(
|
CompositionLocalProvider(
|
||||||
value = if (dangerous) {
|
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.ModalBottomSheet
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.rememberModalBottomSheetState
|
import androidx.compose.material3.rememberModalBottomSheetState
|
||||||
import androidx.compose.material3.surfaceColorAtElevation
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
|
@ -314,7 +313,7 @@ fun MemberListSheet(
|
||||||
CountableListHeader(
|
CountableListHeader(
|
||||||
text = item.category,
|
text = item.category,
|
||||||
count = item.count,
|
count = item.count,
|
||||||
backgroundColor = MaterialTheme.colorScheme.surfaceColorAtElevation(2.dp)
|
backgroundColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue