refactor: rename user context sheet to user info sheet
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
551be72a94
commit
adba9da754
|
|
@ -104,7 +104,7 @@ import chat.revolt.sheets.EmoteInfoSheet
|
||||||
import chat.revolt.sheets.LinkInfoSheet
|
import chat.revolt.sheets.LinkInfoSheet
|
||||||
import chat.revolt.sheets.ServerContextSheet
|
import chat.revolt.sheets.ServerContextSheet
|
||||||
import chat.revolt.sheets.StatusSheet
|
import chat.revolt.sheets.StatusSheet
|
||||||
import chat.revolt.sheets.UserContextSheet
|
import chat.revolt.sheets.UserInfoSheet
|
||||||
import com.airbnb.lottie.RenderMode
|
import com.airbnb.lottie.RenderMode
|
||||||
import com.airbnb.lottie.compose.LottieAnimation
|
import com.airbnb.lottie.compose.LottieAnimation
|
||||||
import com.airbnb.lottie.compose.LottieCompositionSpec
|
import com.airbnb.lottie.compose.LottieCompositionSpec
|
||||||
|
|
@ -584,7 +584,7 @@ fun ChatRouterScreen(
|
||||||
showUserContextSheet = false
|
showUserContextSheet = false
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
UserContextSheet(
|
UserInfoSheet(
|
||||||
userId = userContextSheetTarget,
|
userId = userContextSheetTarget,
|
||||||
serverId = userContextSheetServer
|
serverId = userContextSheetServer
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,9 @@ import chat.revolt.components.generic.UserAvatar
|
||||||
import chat.revolt.components.generic.presenceFromStatus
|
import chat.revolt.components.generic.presenceFromStatus
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import javax.inject.Inject
|
|
||||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
val DO_NOT_FETCH_OFFLINE_MEMBERS_SERVERS = listOf(
|
val DO_NOT_FETCH_OFFLINE_MEMBERS_SERVERS = listOf(
|
||||||
"01F7ZSBSFHQ8TA81725KQCSDDP" // Revolt Lounge
|
"01F7ZSBSFHQ8TA81725KQCSDDP" // Revolt Lounge
|
||||||
|
|
@ -245,7 +245,7 @@ fun MemberListSheet(
|
||||||
showUserContextSheet = false
|
showUserContextSheet = false
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
UserContextSheet(
|
UserInfoSheet(
|
||||||
userId = userContextSheetTarget,
|
userId = userContextSheetTarget,
|
||||||
serverId = serverId
|
serverId = serverId
|
||||||
)
|
)
|
||||||
|
|
@ -312,11 +312,13 @@ fun MemberListMemberUser(
|
||||||
onSelectUser: (String) -> Unit
|
onSelectUser: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
val highestColourRole = serverId?.let {
|
val highestColourRole = serverId?.let {
|
||||||
Roles.resolveHighestRole(
|
user.id?.let { userId ->
|
||||||
it,
|
Roles.resolveHighestRole(
|
||||||
user.id!!,
|
it,
|
||||||
true
|
userId,
|
||||||
)
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val colour = highestColourRole?.colour?.let { WebCompat.parseColour(it) }
|
val colour = highestColourRole?.colour?.let { WebCompat.parseColour(it) }
|
||||||
?: Brush.solidColor(LocalContentColor.current)
|
?: Brush.solidColor(LocalContentColor.current)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ import chat.revolt.components.screens.settings.RawUserOverview
|
||||||
|
|
||||||
@OptIn(ExperimentalLayoutApi::class)
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun UserContextSheet(userId: String, serverId: String? = null) {
|
fun UserInfoSheet(userId: String, serverId: String? = null) {
|
||||||
val user = RevoltAPI.userCache[userId]
|
val user = RevoltAPI.userCache[userId]
|
||||||
|
|
||||||
val member = serverId?.let { RevoltAPI.members.getMember(it, userId) }
|
val member = serverId?.let { RevoltAPI.members.getMember(it, userId) }
|
||||||
Loading…
Reference in New Issue