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.
|
- 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`.
|
- 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.
|
- 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) {
|
composable(route = Routes.Settings) {
|
||||||
SettingsRoute(
|
SettingsRoute(
|
||||||
onBackToChats = { navController.navigate(Routes.Chats) },
|
|
||||||
onOpenProfile = { navController.navigate(Routes.Profile) },
|
onOpenProfile = { navController.navigate(Routes.Profile) },
|
||||||
onSwitchAccount = {
|
onSwitchAccount = {
|
||||||
viewModel.recheckSession()
|
viewModel.recheckSession()
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ private enum class SettingsFolder(val title: String) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsRoute(
|
fun SettingsRoute(
|
||||||
onBackToChats: () -> Unit,
|
|
||||||
onOpenProfile: () -> Unit,
|
onOpenProfile: () -> Unit,
|
||||||
onSwitchAccount: () -> Unit,
|
onSwitchAccount: () -> Unit,
|
||||||
onLogout: () -> Unit,
|
onLogout: () -> Unit,
|
||||||
@@ -96,7 +95,6 @@ fun SettingsRoute(
|
|||||||
viewModel: AccountViewModel = hiltViewModel(),
|
viewModel: AccountViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
SettingsScreen(
|
SettingsScreen(
|
||||||
onBackToChats = onBackToChats,
|
|
||||||
onOpenProfile = onOpenProfile,
|
onOpenProfile = onOpenProfile,
|
||||||
onSwitchAccount = onSwitchAccount,
|
onSwitchAccount = onSwitchAccount,
|
||||||
onLogout = onLogout,
|
onLogout = onLogout,
|
||||||
@@ -107,7 +105,6 @@ fun SettingsRoute(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsScreen(
|
fun SettingsScreen(
|
||||||
onBackToChats: () -> Unit,
|
|
||||||
onOpenProfile: () -> Unit,
|
onOpenProfile: () -> Unit,
|
||||||
onSwitchAccount: () -> Unit,
|
onSwitchAccount: () -> Unit,
|
||||||
onLogout: () -> Unit,
|
onLogout: () -> Unit,
|
||||||
@@ -151,7 +148,6 @@ fun SettingsScreen(
|
|||||||
state = state,
|
state = state,
|
||||||
folder = folder ?: SettingsFolder.Account,
|
folder = folder ?: SettingsFolder.Account,
|
||||||
onBack = { folder = null },
|
onBack = { folder = null },
|
||||||
onBackToChats = onBackToChats,
|
|
||||||
onSwitchAccount = onSwitchAccount,
|
onSwitchAccount = onSwitchAccount,
|
||||||
onLogout = onLogout,
|
onLogout = onLogout,
|
||||||
onOpenProfile = onOpenProfile,
|
onOpenProfile = onOpenProfile,
|
||||||
@@ -213,7 +209,6 @@ private fun SettingsFolderView(
|
|||||||
state: AccountUiState,
|
state: AccountUiState,
|
||||||
folder: SettingsFolder,
|
folder: SettingsFolder,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onBackToChats: () -> Unit,
|
|
||||||
onSwitchAccount: () -> Unit,
|
onSwitchAccount: () -> Unit,
|
||||||
onLogout: () -> Unit,
|
onLogout: () -> Unit,
|
||||||
onOpenProfile: () -> Unit,
|
onOpenProfile: () -> Unit,
|
||||||
@@ -252,8 +247,6 @@ private fun SettingsFolderView(
|
|||||||
|
|
||||||
if (!state.message.isNullOrBlank()) Text(state.message.orEmpty(), color = MaterialTheme.colorScheme.primary)
|
if (!state.message.isNullOrBlank()) Text(state.message.orEmpty(), color = MaterialTheme.colorScheme.primary)
|
||||||
if (!state.errorMessage.isNullOrBlank()) Text(state.errorMessage.orEmpty(), color = MaterialTheme.colorScheme.error)
|
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