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

Unverified Commit 0473e3da authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Add ContributionHeader

parent d4a528fd
Loading
Loading
Loading
Loading
+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()
    }
}
+54 −0
Original line number Diff line number Diff line
package app.k9mail.feature.funding.googleplay.ui.contribution

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.designsystem.atom.image.FixedScaleImage
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodyMedium
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadlineSmall
import app.k9mail.core.ui.compose.theme2.MainTheme
import app.k9mail.feature.funding.googleplay.R
import app.k9mail.feature.funding.googleplay.ui.contribution.image.HearthSunburst

@Composable
internal fun ContributionHeader(
    modifier: Modifier = Modifier,
) {
    Column(
        modifier = modifier,
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.spacedBy(MainTheme.spacings.triple),
    ) {
        Box(
            modifier = Modifier
                .fillMaxWidth()
                .padding(top = MainTheme.spacings.triple)
                .height(MainTheme.sizes.large),
        ) {
            FixedScaleImage(
                imageVector = HearthSunburst,
                contentDescription = stringResource(
                    R.string.funding_googleplay_contribution_header_logo_content_description,
                ),
                alignment = Alignment.TopCenter,
                allowOverflow = true,
            )
        }

        TextHeadlineSmall(
            text = stringResource(R.string.funding_googleplay_contribution_header_title),
            color = MainTheme.colors.primary,
        )

        TextBodyMedium(
            text = stringResource(R.string.funding_googleplay_contribution_header_description),
        )
    }
}
+4 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="funding_googleplay_contribution_header_title">Support Thunderbird</string>
    <string name="funding_googleplay_contribution_header_description">Our mission is to provide an open source email app that is secure, private and free for users around the world. Your contribution supports this work. Will you give today?</string>
    <string name="funding_googleplay_contribution_header_logo_content_description">Image of a hearth emitting sunbursts</string>

    <string name="funding_googleplay_contribution_list_title">Secure donation</string>
    <string name="funding_googleplay_contribution_list_type_one_time">Give once</string>
    <string name="funding_googleplay_contribution_list_type_recurring">Monthly</string>