Skip to content

Commit

Permalink
feature(bank-sdk): Skonto Invoice Preview. Code refactor
Browse files Browse the repository at this point in the history
PP-643
  • Loading branch information
ndubkov-distcotech committed Aug 22, 2024
1 parent 8603323 commit 79db3c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import net.gini.android.bank.sdk.R
import net.gini.android.bank.sdk.capture.skonto.colors.SkontoScreenColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoFooterSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInfoDialogColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInvoiceScanSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInvoicePreviewSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.WithoutSkontoSectionColors
import net.gini.android.bank.sdk.capture.skonto.model.SkontoData
Expand Down Expand Up @@ -323,7 +323,7 @@ private fun ScreenReadyState(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
YourInvoiceScanSection(
InvoicePreviewSection(
modifier = Modifier
.padding(top = 8.dp)
.tabletMaxWidth(),
Expand Down Expand Up @@ -417,9 +417,9 @@ private fun NavigationActionBack(
}

@Composable
private fun YourInvoiceScanSection(
private fun InvoicePreviewSection(
modifier: Modifier = Modifier,
colorScheme: SkontoInvoiceScanSectionColors,
colorScheme: SkontoInvoicePreviewSectionColors,
onClick: () -> Unit,
) {
Card(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoFooterSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInfoDialogColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInvoiceScanSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoInvoicePreviewSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoSectionColors
import net.gini.android.bank.sdk.capture.skonto.colors.section.WithoutSkontoSectionColors
import net.gini.android.capture.ui.components.picker.date.GiniDatePickerDialogColors
Expand All @@ -16,7 +16,7 @@ import net.gini.android.capture.ui.theme.GiniTheme
data class SkontoScreenColors(
val backgroundColor: Color,
val topAppBarColors: GiniTopBarColors,
val invoiceScanSectionColors: SkontoInvoiceScanSectionColors,
val invoiceScanSectionColors: SkontoInvoicePreviewSectionColors,
val skontoSectionColors: SkontoSectionColors,
val withoutSkontoSectionColors: WithoutSkontoSectionColors,
val footerSectionColors: SkontoFooterSectionColors,
Expand All @@ -27,18 +27,26 @@ data class SkontoScreenColors(
companion object {
@Composable
fun colors(
backgroundColor: Color = GiniTheme.colorScheme.background.primary,
topAppBarColors: GiniTopBarColors = GiniTopBarColors.colors(),
skontoInvoiceScanSectionColors: SkontoInvoiceScanSectionColors = SkontoInvoiceScanSectionColors.colors(),
discountSectionColors: SkontoSectionColors = SkontoSectionColors.colors(),
withoutSkontoSectionColors: WithoutSkontoSectionColors = WithoutSkontoSectionColors.colors(),
skontoFooterSectionColors: SkontoFooterSectionColors = SkontoFooterSectionColors.colors(),
datePickerColor: GiniDatePickerDialogColors = GiniDatePickerDialogColors.colors(),
infoDialogColors: SkontoInfoDialogColors = SkontoInfoDialogColors.colors(),
backgroundColor: Color =
GiniTheme.colorScheme.background.primary,
topAppBarColors: GiniTopBarColors =
GiniTopBarColors.colors(),
skontoInvoicePreviewSectionColors: SkontoInvoicePreviewSectionColors =
SkontoInvoicePreviewSectionColors.colors(),
discountSectionColors: SkontoSectionColors =
SkontoSectionColors.colors(),
withoutSkontoSectionColors: WithoutSkontoSectionColors =
WithoutSkontoSectionColors.colors(),
skontoFooterSectionColors: SkontoFooterSectionColors =
SkontoFooterSectionColors.colors(),
datePickerColor: GiniDatePickerDialogColors =
GiniDatePickerDialogColors.colors(),
infoDialogColors: SkontoInfoDialogColors =
SkontoInfoDialogColors.colors(),
) = SkontoScreenColors(
backgroundColor = backgroundColor,
topAppBarColors = topAppBarColors,
invoiceScanSectionColors = skontoInvoiceScanSectionColors,
invoiceScanSectionColors = skontoInvoicePreviewSectionColors,
skontoSectionColors = discountSectionColors,
withoutSkontoSectionColors = withoutSkontoSectionColors,
footerSectionColors = skontoFooterSectionColors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.ui.graphics.Color
import net.gini.android.capture.ui.theme.GiniTheme

@Immutable
data class SkontoInvoiceScanSectionColors(
data class SkontoInvoicePreviewSectionColors(
val cardBackgroundColor: Color,
val titleTextColor: Color,
val subtitleTextColor: Color,
Expand All @@ -24,7 +24,7 @@ data class SkontoInvoiceScanSectionColors(
iconBackgroundColor: Color = GiniTheme.colorScheme.placeholder.background,
iconTint: Color = GiniTheme.colorScheme.placeholder.tint,
arrowTint: Color = GiniTheme.colorScheme.icons.secondary,
) = SkontoInvoiceScanSectionColors(
) = SkontoInvoicePreviewSectionColors(
cardBackgroundColor = cardBackgroundColor,
titleTextColor = titleTextColor,
subtitleTextColor = subtitleTextColor,
Expand All @@ -33,4 +33,4 @@ data class SkontoInvoiceScanSectionColors(
arrowTint = arrowTint,
)
}
}
}

0 comments on commit 79db3c7

Please sign in to comment.