Skip to content

Commit

Permalink
Add fab in ReceivedScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Aug 14, 2024
1 parent 56507da commit 9ecfdc2
Showing 1 changed file with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,55 @@

package com.infomaniak.swisstransfer.ui.screen.main.received

import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.infomaniak.swisstransfer.ui.components.MainScreenFab
import com.infomaniak.swisstransfer.ui.components.MainScreenFabType
import com.infomaniak.swisstransfer.ui.screen.main.LocalNavType
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
import com.infomaniak.swisstransfer.ui.utils.PreviewTablet

@Composable
fun ReceivedScreen(navigateToDetails: (transferId: Int) -> Unit) {
Text("Received screen")
ReceivedScreen(navType = LocalNavType.current)
}

@Composable
private fun ReceivedScreen(navType: NavigationSuiteType) {
Scaffold(
floatingActionButton = {
if (navType == NavigationSuiteType.NavigationBar) MainScreenFab(mainScreenFabType = MainScreenFabType.BOTTOM_BAR)
}
) { contentPadding ->
Text(
text = "Received screen",
modifier = Modifier.padding(contentPadding),
)
}
}

@PreviewMobile
@Composable
private fun ReceivedScreenMobilePreview() {
SwissTransferTheme {
Surface {
ReceivedScreen(navType = NavigationSuiteType.NavigationBar)
}
}
}

@PreviewTablet
@Composable
private fun ReceivedScreenTabletPreview() {
SwissTransferTheme {
Surface {
ReceivedScreen(navType = NavigationSuiteType.NavigationRail)
}
}
}

0 comments on commit 9ecfdc2

Please sign in to comment.