Skip to content

Commit

Permalink
Merge pull request #56 from Infomaniak/sent-list-screen
Browse files Browse the repository at this point in the history
Move SentListScreen to its own file
  • Loading branch information
KevinBoulongne authored Sep 18, 2024
2 parents b99d775 + 98805ab commit db743b8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Infomaniak SwissTransfer - Android
* Copyright (C) 2024 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.swisstransfer.ui.screen.main.sent

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.NewTransferFab
import com.infomaniak.swisstransfer.ui.components.NewTransferFabType
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
import com.infomaniak.swisstransfer.ui.utils.PreviewTablet

@Composable
fun SentListScreen(
navType: NavigationSuiteType,
) {
Scaffold(
floatingActionButton = {
if (navType == NavigationSuiteType.NavigationBar) NewTransferFab(newTransferFabType = NewTransferFabType.BOTTOM_BAR)
},
) { contentPadding ->
Text(
text = "Sent screen",
modifier = Modifier.padding(contentPadding),
)
}
}

@PreviewMobile
@PreviewTablet
@Composable
private fun SentListScreenPreview() {
SwissTransferTheme {
Surface {
SentListScreen(navType = NavigationSuiteType.NavigationRail)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@
*/
package com.infomaniak.swisstransfer.ui.screen.main.sent

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.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.infomaniak.swisstransfer.ui.components.NewTransferFab
import com.infomaniak.swisstransfer.ui.components.NewTransferFabType
import com.infomaniak.swisstransfer.ui.screen.main.LocalNavType
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
Expand Down Expand Up @@ -57,22 +51,6 @@ private fun SentScreen(transfers: List<Any>?, navType: NavigationSuiteType) {
}
}

@Composable
private fun SentListScreen(
navType: NavigationSuiteType,
) {
Scaffold(
floatingActionButton = {
if (navType == NavigationSuiteType.NavigationBar) NewTransferFab(newTransferFabType = NewTransferFabType.BOTTOM_BAR)
},
) { contentPadding ->
Text(
text = "Sent screen",
modifier = Modifier.padding(contentPadding),
)
}
}

@PreviewMobile
@Composable
private fun SentScreenMobilePreview() {
Expand Down

0 comments on commit db743b8

Please sign in to comment.