Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 1b52cd9d authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Add ContributionFooter

parent 0473e3da
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
package app.k9mail.feature.funding.googleplay.ui.contribution

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme

@Composable
@Preview(showBackground = true)
fun ContributionFooterPreview() {
    PreviewWithTheme {
        ContributionFooter(
            onClick = {},
            isPurchaseEnabled = true,
        )
    }
}

@Composable
@Preview(showBackground = true)
fun ContributionFooterDisabledPreview() {
    PreviewWithTheme {
        ContributionFooter(
            onClick = {},
            isPurchaseEnabled = false,
        )
    }
}
+29 −0
Original line number Diff line number Diff line
package app.k9mail.feature.funding.googleplay.ui.contribution

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonFilled
import app.k9mail.feature.funding.googleplay.R

@Composable
internal fun ContributionFooter(
    onClick: () -> Unit,
    isPurchaseEnabled: Boolean,
    modifier: Modifier = Modifier,
) {
    Row(
        modifier = modifier,
    ) {
        ButtonFilled(
            text = stringResource(
                R.string.funding_googleplay_contribution_footer_payment_button,
            ),
            onClick = onClick,
            enabled = isPurchaseEnabled,
            modifier = Modifier.fillMaxWidth(),
        )
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -8,4 +8,6 @@
    <string name="funding_googleplay_contribution_list_type_one_time">Give once</string>
    <string name="funding_googleplay_contribution_list_type_recurring">Monthly</string>
    <string name="funding_googleplay_contribution_list_disclaimer">Contributions are not tax-deductible as charitable donations.</string>

    <string name="funding_googleplay_contribution_footer_payment_button">Continue to payment</string>
</resources>