Skip to content

Commit

Permalink
refactor: Directly use the KMP's order for transferTypes to be auto a…
Browse files Browse the repository at this point in the history
…ligned with iOS (#259)
  • Loading branch information
sirambd authored Dec 17, 2024
2 parents fe03ad9 + 09aded6 commit 8b19f19
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.Chain
import com.infomaniak.swisstransfer.ui.images.icons.Envelope
import com.infomaniak.swisstransfer.ui.images.icons.QrCode
import com.infomaniak.swisstransfer.ui.images.icons.WifiWave
import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.components.TransferTypeUi.Companion.toTransferTypeUi
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.GetSetCallbacks
Expand All @@ -46,7 +47,7 @@ fun TransferTypeButtons(horizontalPadding: Dp, transferType: GetSetCallbacks<Tra
BringIntoViewRow(
horizontalPadding = horizontalPadding,
spaceBy = Margin.Mini,
items = TransferTypeUi.entries,
items = TransferType.entries.map { it.toTransferTypeUi() },
) { transferTypeItem, bringIntoViewRequester ->

LaunchedEffect(Unit) {
Expand Down Expand Up @@ -78,6 +79,13 @@ enum class TransferTypeUi(
descriptionRes = null,
dbValue = TransferType.QR_CODE,
),
MAIL(
buttonIcon = AppIcons.Envelope,
buttonTextRes = R.string.transferTypeEmail,
titleRes = R.string.uploadSuccessEmailTitle,
descriptionRes = R.plurals.uploadSuccessEmailDescription,
dbValue = TransferType.MAIL,
),
LINK(
buttonIcon = AppIcons.Chain,
buttonTextRes = R.string.transferTypeLink,
Expand All @@ -91,13 +99,6 @@ enum class TransferTypeUi(
titleRes = R.string.uploadSuccessLinkTitle,
descriptionRes = R.string.uploadSuccessLinkDescription,
dbValue = TransferType.PROXIMITY,
),
MAIL(
buttonIcon = AppIcons.Envelope,
buttonTextRes = R.string.transferTypeEmail,
titleRes = R.string.uploadSuccessEmailTitle,
descriptionRes = R.plurals.uploadSuccessEmailDescription,
dbValue = TransferType.MAIL,
);

companion object {
Expand Down

0 comments on commit 8b19f19

Please sign in to comment.