fix: logic and positioning for user dropdown
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
e9c3b8ec95
commit
3127b95d9e
|
|
@ -5,7 +5,6 @@ import androidx.compose.animation.animateContentSize
|
|||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
|
|
@ -218,21 +217,12 @@ fun UserButtons(
|
|||
"BlockedOther" -> Box(Modifier.weight(1f))
|
||||
}
|
||||
|
||||
when (user.relationship) {
|
||||
"Friend", "Incoming", "Outgoing", "None", "Blocked", "BlockedOther" -> {
|
||||
Column { // Prevent the dropdown menu from counting towards arrangement spacing
|
||||
IconButton(
|
||||
onClick = {
|
||||
menuOpen = true
|
||||
}
|
||||
if (user.relationship != "User") {
|
||||
Row { // Prevent the dropdown menu from counting towards arrangement spacing
|
||||
DropdownMenu(
|
||||
expanded = menuOpen,
|
||||
onDismissRequest = { menuOpen = false }
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.MoreVert,
|
||||
contentDescription = stringResource(R.string.menu)
|
||||
)
|
||||
}
|
||||
|
||||
DropdownMenu(expanded = menuOpen, onDismissRequest = { menuOpen = false }) {
|
||||
when (user.relationship) {
|
||||
"Friend" -> {
|
||||
DropdownMenuItem(
|
||||
|
|
@ -293,6 +283,16 @@ fun UserButtons(
|
|||
}
|
||||
)
|
||||
}
|
||||
|
||||
IconButton(
|
||||
onClick = {
|
||||
menuOpen = true
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.MoreVert,
|
||||
contentDescription = stringResource(R.string.menu)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue