Skip to content

Commit

Permalink
Add MainScreenFab to the navigation rail
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Aug 14, 2024
1 parent 5220829 commit 56507da
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
package com.infomaniak.swisstransfer.ui.screen.main.components

import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.*
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldLayout
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.ui.components.MainScreenFab
import com.infomaniak.swisstransfer.ui.components.MainScreenFabType
import com.infomaniak.swisstransfer.ui.navigation.MainNavigation
import com.infomaniak.swisstransfer.ui.navigation.NavigationItem
import com.infomaniak.swisstransfer.ui.theme.Margin
Expand Down Expand Up @@ -87,9 +87,10 @@ private fun AppNavigationBar(currentDestination: MainNavigation, navigateToSelec
private fun AppNavigationRail(currentDestination: MainNavigation, navigateToSelectedItem: (MainNavigation) -> Unit) {
NavigationRail(
header = {
FloatingActionButton(onClick = {}, modifier = Modifier.padding(bottom = Margin.Large)) {
Icon(Icons.Default.Add, contentDescription = null)
}
MainScreenFab(
modifier = Modifier.padding(vertical = Margin.Large),
mainScreenFabType = MainScreenFabType.NAVIGATION_RAIL,
)
},
containerColor = SwissTransferTheme.colors.navigationItemBackground
) {
Expand All @@ -113,4 +114,4 @@ private fun NavigationIcon(isNavigationBar: Boolean, navigationItem: NavigationI
@Composable
private fun NavigationLabel(navigationItem: NavigationItem) {
Text(stringResource(navigationItem.label))
}
}

0 comments on commit 56507da

Please sign in to comment.