feat: restructure Leave Server section with improved layout and visual hierarchy
This commit is contained in:
+33
-19
@@ -307,27 +307,41 @@ fun SettingsScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave Server button relocated below Diagnostics section
|
// Leave Server section
|
||||||
Button(
|
Text(
|
||||||
onClick = { showLeaveDialog = true },
|
text = "Leave Server",
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
)
|
||||||
|
Card(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
enabled = !isLeaving,
|
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
|
||||||
colors =
|
|
||||||
ButtonDefaults.buttonColors(
|
|
||||||
containerColor = MaterialTheme.colorScheme.error,
|
|
||||||
contentColor = MaterialTheme.colorScheme.onError,
|
|
||||||
),
|
|
||||||
) {
|
) {
|
||||||
if (isLeaving) {
|
Column(
|
||||||
CircularProgressIndicator(
|
modifier = Modifier.padding(12.dp),
|
||||||
modifier = Modifier.size(16.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
color = MaterialTheme.colorScheme.onError,
|
) {
|
||||||
strokeWidth = 2.dp,
|
Button(
|
||||||
)
|
onClick = { showLeaveDialog = true },
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
modifier = Modifier.fillMaxWidth(),
|
||||||
Text("Leaving...")
|
enabled = !isLeaving,
|
||||||
} else {
|
colors =
|
||||||
Text("Leave Server")
|
ButtonDefaults.buttonColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.error,
|
||||||
|
contentColor = MaterialTheme.colorScheme.onError,
|
||||||
|
),
|
||||||
|
) {
|
||||||
|
if (isLeaving) {
|
||||||
|
CircularProgressIndicator(
|
||||||
|
modifier = Modifier.size(16.dp),
|
||||||
|
color = MaterialTheme.colorScheme.onError,
|
||||||
|
strokeWidth = 2.dp,
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text("Leaving...")
|
||||||
|
} else {
|
||||||
|
Text("Leave Server")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user