Skip to content

Commit

Permalink
Merge SuccessMessage and ScreenContent
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Nov 13, 2024
1 parent b3c7e16 commit 6c6df6d
Showing 1 changed file with 22 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fun UploadSuccessQrScreen(transferType: TransferType, transferUrl: String, close
},
) {
Column {
ScreenContent(transferType, transferUrl)
SuccessMessage(transferType, transferUrl)

ShareAndCopyButtons(
modifier = Modifier.padding(bottom = Margin.Medium, top = Margin.Mini),
Expand All @@ -70,10 +70,7 @@ fun UploadSuccessQrScreen(transferType: TransferType, transferUrl: String, close
}

@Composable
private fun ColumnScope.ScreenContent(
transferType: TransferType,
transferUrl: String
) {
private fun ColumnScope.SuccessMessage(transferType: TransferType, transferUrl: String) {
Column(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -83,37 +80,32 @@ private fun ColumnScope.ScreenContent(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
SuccessMessage(transferType, transferUrl)
}
}

@Composable
private fun SuccessMessage(transferType: TransferType, transferUrl: String) {
Spacer(modifier = Modifier.height(Margin.Medium))
Spacer(modifier = Modifier.height(Margin.Medium))

Image(imageVector = AppIllus.Beers.image(), contentDescription = null)
Image(imageVector = AppIllus.Beers.image(), contentDescription = null)

Spacer(Modifier.height(Margin.Huge))
Spacer(Modifier.height(Margin.Huge))

Text(
text = stringResource(transferType.titleRes),
style = SwissTransferTheme.typography.h1,
color = SwissTransferTheme.colors.primaryTextColor,
)
Text(
text = stringResource(transferType.titleRes),
style = SwissTransferTheme.typography.h1,
color = SwissTransferTheme.colors.primaryTextColor,
)

Spacer(Modifier.height(Margin.Huge))
Spacer(Modifier.height(Margin.Huge))

QrCode(transferUrl)
QrCode(transferUrl)

transferType.descriptionRes?.let { descriptionRes ->
Spacer(Modifier.height(Margin.Huge))
Text(
text = stringResource(descriptionRes),
style = SwissTransferTheme.typography.bodyRegular,
textAlign = TextAlign.Center,
color = SwissTransferTheme.colors.secondaryTextColor,
modifier = Modifier.widthIn(max = Dimens.DescriptionWidth),
)
transferType.descriptionRes?.let { descriptionRes ->
Spacer(Modifier.height(Margin.Huge))
Text(
text = stringResource(descriptionRes),
style = SwissTransferTheme.typography.bodyRegular,
textAlign = TextAlign.Center,
color = SwissTransferTheme.colors.secondaryTextColor,
modifier = Modifier.widthIn(max = Dimens.DescriptionWidth),
)
}
}
}

Expand Down

0 comments on commit 6c6df6d

Please sign in to comment.