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

Unverified Commit 75b3ea66 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #8292 from wmontwe/add-funding-ui-part-4

Add funding UI - Part 4
parents 588033f1 27487bb2
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,
        )
    }
}
+13 −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)
internal fun ContributionHeaderPreview() {
    PreviewWithTheme {
        ContributionHeader()
    }
}
+28 −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)
internal fun ContributionListItemPreview() {
    PreviewWithTheme {
        ContributionListItem(
            text = "Monthly",
            onClick = {},
        )
    }
}

@Composable
@Preview(showBackground = true)
internal fun ContributionListItemPreviewSelected() {
    PreviewWithTheme {
        ContributionListItem(
            text = "Monthly",
            onClick = {},
            isSelected = true,
        )
    }
}
+35 −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)
internal fun ContributionListPreview() {
    PreviewWithTheme {
        ContributionList(
            contributions = FakeData.recurringContributions,
            isRecurringContributionSelected = true,
            selectedItem = FakeData.recurringContributions.first(),
            onOneTimeContributionTypeClick = {},
            onRecurringContributionTypeClick = {},
            onItemClick = {},
        )
    }
}

@Composable
@Preview(showBackground = true)
internal fun ContributionListRecurringPreview() {
    PreviewWithTheme {
        ContributionList(
            contributions = FakeData.oneTimeContributions,
            selectedItem = FakeData.oneTimeContributions.last(),
            isRecurringContributionSelected = false,
            onOneTimeContributionTypeClick = {},
            onRecurringContributionTypeClick = {},
            onItemClick = {},
        )
    }
}
+74 −0
Original line number Diff line number Diff line
package app.k9mail.feature.funding.googleplay.ui.contribution

import app.k9mail.feature.funding.googleplay.domain.entity.OneTimeContribution
import app.k9mail.feature.funding.googleplay.domain.entity.RecurringContribution
import kotlinx.collections.immutable.persistentListOf

internal object FakeData {

    val recurringContributions = persistentListOf(
        RecurringContribution(
            id = "monthly_subscription_250",
            title = "Monthly subscription: $250",
            price = "$250",
        ),
        RecurringContribution(
            id = "monthly_subscription_140",
            title = "Monthly subscription: $140",
            price = "$140",
        ),
        RecurringContribution(
            id = "monthly_subscription_80",
            title = "Monthly subscription: $80",
            price = "$80",
        ),
        RecurringContribution(
            id = "monthly_subscription_50",
            title = "Monthly subscription: $50",
            price = "$50",
        ),
        RecurringContribution(
            id = "monthly_subscription_25",
            title = "Monthly subscription: $25",
            price = "$25",
        ),
        RecurringContribution(
            id = "monthly_subscription_15",
            title = "Monthly subscription: $15",
            price = "$15",
        ),
    )

    val oneTimeContributions = persistentListOf(
        OneTimeContribution(
            id = "one_time_payment_250",
            title = "One time payment: $250",
            price = "$250",
        ),
        OneTimeContribution(
            id = "one_time_payment_140",
            title = "One time payment: $140",
            price = "$140",
        ),
        OneTimeContribution(
            id = "one_time_payment_80",
            title = "One time payment: $80",
            price = "$80",
        ),
        OneTimeContribution(
            id = "one_time_payment_50",
            title = "One time payment: $50",
            price = "$50",
        ),
        OneTimeContribution(
            id = "one_time_payment_25",
            title = "One time payment: $25",
            price = "$25",
        ),
        OneTimeContribution(
            id = "one_time_payment_15",
            title = "One time payment: $15",
            price = "$15",
        ),
    )
}
Loading