android: remove back-to-chats from settings folders
This commit is contained in:
@@ -807,3 +807,11 @@
|
||||
- Removed bottom `Back to chats` button from profile screen.
|
||||
- Simplified profile layout so the editable profile form is the primary secondary section toggled by `Edit`.
|
||||
- Updated `ProfileRoute` navigation contract to match the simplified screen API.
|
||||
|
||||
### Step 117 - Settings folders cleanup (remove back button action)
|
||||
- Removed `Back to chats` button from all Settings folder pages.
|
||||
- Simplified Settings navigation contract by removing unused `onBackToChats` parameter from:
|
||||
- `SettingsRoute`
|
||||
- `SettingsScreen`
|
||||
- `SettingsFolderView`
|
||||
- Updated `AppNavGraph` Settings destination call-site accordingly.
|
||||
|
||||
@@ -247,7 +247,6 @@ fun MessengerNavHost(
|
||||
|
||||
composable(route = Routes.Settings) {
|
||||
SettingsRoute(
|
||||
onBackToChats = { navController.navigate(Routes.Chats) },
|
||||
onOpenProfile = { navController.navigate(Routes.Profile) },
|
||||
onSwitchAccount = {
|
||||
viewModel.recheckSession()
|
||||
|
||||
@@ -88,7 +88,6 @@ private enum class SettingsFolder(val title: String) {
|
||||
|
||||
@Composable
|
||||
fun SettingsRoute(
|
||||
onBackToChats: () -> Unit,
|
||||
onOpenProfile: () -> Unit,
|
||||
onSwitchAccount: () -> Unit,
|
||||
onLogout: () -> Unit,
|
||||
@@ -96,7 +95,6 @@ fun SettingsRoute(
|
||||
viewModel: AccountViewModel = hiltViewModel(),
|
||||
) {
|
||||
SettingsScreen(
|
||||
onBackToChats = onBackToChats,
|
||||
onOpenProfile = onOpenProfile,
|
||||
onSwitchAccount = onSwitchAccount,
|
||||
onLogout = onLogout,
|
||||
@@ -107,7 +105,6 @@ fun SettingsRoute(
|
||||
|
||||
@Composable
|
||||
fun SettingsScreen(
|
||||
onBackToChats: () -> Unit,
|
||||
onOpenProfile: () -> Unit,
|
||||
onSwitchAccount: () -> Unit,
|
||||
onLogout: () -> Unit,
|
||||
@@ -151,7 +148,6 @@ fun SettingsScreen(
|
||||
state = state,
|
||||
folder = folder ?: SettingsFolder.Account,
|
||||
onBack = { folder = null },
|
||||
onBackToChats = onBackToChats,
|
||||
onSwitchAccount = onSwitchAccount,
|
||||
onLogout = onLogout,
|
||||
onOpenProfile = onOpenProfile,
|
||||
@@ -213,7 +209,6 @@ private fun SettingsFolderView(
|
||||
state: AccountUiState,
|
||||
folder: SettingsFolder,
|
||||
onBack: () -> Unit,
|
||||
onBackToChats: () -> Unit,
|
||||
onSwitchAccount: () -> Unit,
|
||||
onLogout: () -> Unit,
|
||||
onOpenProfile: () -> Unit,
|
||||
@@ -252,8 +247,6 @@ private fun SettingsFolderView(
|
||||
|
||||
if (!state.message.isNullOrBlank()) Text(state.message.orEmpty(), color = MaterialTheme.colorScheme.primary)
|
||||
if (!state.errorMessage.isNullOrBlank()) Text(state.errorMessage.orEmpty(), color = MaterialTheme.colorScheme.error)
|
||||
|
||||
OutlinedButton(onClick = onBackToChats, modifier = Modifier.fillMaxWidth()) { Text("Back to chats") }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user