Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmedalijaK committed Feb 4, 2025
1 parent 902ffb3 commit 538b30e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ data class MembershipStatusResponse(
@SerialName("renews_on") val renewsOn: Long? = null,
@SerialName("origin") val origin: String? = null,
@SerialName("edited_shoutout") val editedShoutout: String? = null,
@SerialName("donated_btc") val donatedBtc: String?,
@SerialName("donated_btc") val donatedBtc: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private fun PremiumHomeScreen(
Scaffold(
topBar = {
PrimalTopAppBar(
title = stringResource(id = R.string.premium_member_title),
title = stringResource(id = R.string.premium_home_member_title),
navigationIcon = PrimalIcons.ArrowBack,
onNavigationIconClick = onClose,
showDivider = false,
Expand All @@ -108,14 +108,14 @@ private fun PremiumHomeScreen(
bottomBar = {
if (state.membership?.isExpired() == true) {
BottomBarButton(
text = stringResource(id = R.string.premium_renew_subscription),
text = stringResource(id = R.string.premium_home_renew_subscription),
onClick = {
onRenewSubscription(state.membership.premiumName)
},
)
} else {
BottomBarButton(
text = stringResource(id = R.string.premium_manage_premium_button),
text = stringResource(id = R.string.premium_home_premium_button),
onClick = onManagePremium,
)
}
Expand Down Expand Up @@ -166,7 +166,7 @@ private fun PremiumHomeScreen(
if (state.membership.isPremiumFreeTier()) {
Text(
modifier = Modifier.padding(horizontal = 36.dp),
text = stringResource(id = R.string.premium_member_early_primal_user),
text = stringResource(id = R.string.premium_home_member_early_primal_user),
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
style = AppTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
Expand All @@ -188,27 +188,24 @@ private fun PremiumHomeScreen(
state.membership.isExpired() -> {
Text(
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
text = stringResource(id = R.string.premium_expired_subscription_notice),
text = stringResource(id = R.string.premium_home_expired_subscription_notice),
style = AppTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
}

else -> {
if (state.showSupportUsNotice) {
when (state.membership.isPrimalLegendTier()) {
true -> {
SupportUsNoticeLegend(
visible = state.membership.donatedBtc != null,
donatedSats = state.membership.donatedBtc?.toSats()?.toLong() ?: 0L,
onSupportPrimal = onSupportPrimal,
)
}
false -> {
SupportUsNoticePremium(
onSupportPrimal = onSupportPrimal,
)
}
if (state.membership.isPrimalLegendTier()) {
SupportUsNoticeLegend(
visible = state.membership.donatedBtc != null,
donatedSats = state.membership.donatedBtc?.toSats()?.toLong() ?: 0L,
onSupportPrimal = onSupportPrimal,
)
} else {
SupportUsNoticePremium(
onSupportPrimal = onSupportPrimal,
)
}
}
}
Expand Down Expand Up @@ -252,29 +249,26 @@ private fun SupportUsNoticePremium(onSupportPrimal: () -> Unit) {
) {
Text(
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
text = stringResource(id = R.string.premium_enjoying_primal),
text = stringResource(id = R.string.premium_home_enjoying_primal),
style = AppTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
Row {
Text(
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
text = stringResource(id = R.string.premium_enjoying_primal_if_so) + " ",
text = stringResource(id = R.string.premium_home_enjoying_primal_if_so) + " ",
style = AppTheme.typography.bodyMedium,
)
Text(
modifier = Modifier
.clickable(
onClick = onSupportPrimal,
),
modifier = Modifier.clickable(onClick = onSupportPrimal),
style = AppTheme.typography.bodyMedium,
text = buildAnnotatedString {
withStyle(
style = SpanStyle(
color = AppTheme.colorScheme.secondary,
),
) {
append(stringResource(id = R.string.premium_support_us))
append(stringResource(id = R.string.premium_home_support_us))
}
withStyle(
style = SpanStyle(
Expand Down Expand Up @@ -303,14 +297,11 @@ private fun SupportUsNoticeLegend(
Row {
Text(
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
text = stringResource(id = R.string.legend_contribution_title) + " ",
text = stringResource(id = R.string.premium_home_legend_contribution_title) + " ",
style = AppTheme.typography.bodyMedium,
)
Text(
modifier = Modifier
.clickable(
onClick = onSupportPrimal,
),
modifier = Modifier.clickable(onClick = onSupportPrimal),
style = AppTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
text = buildAnnotatedString {
Expand All @@ -327,7 +318,7 @@ private fun SupportUsNoticeLegend(
if (donatedSats > 0L) {
Text(
color = AppTheme.extraColorScheme.onSurfaceVariantAlt2,
text = stringResource(id = R.string.legend_support_appreciation),
text = stringResource(id = R.string.premium_home_legend_support_appreciation),
style = AppTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
Expand All @@ -338,7 +329,7 @@ private fun SupportUsNoticeLegend(
onClick = onSupportPrimal,
),
color = AppTheme.colorScheme.secondary,
text = stringResource(id = R.string.legend_contribute_more),
text = stringResource(id = R.string.premium_home_legend_contribute_more),
style = AppTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ fun PrimalPremiumTable(
PrimalDivider()
if (premiumMembership.isPrimalLegendTier()) {
PrimalPremiumTableRow(
key = stringResource(id = R.string.premium_table_expires),
value = stringResource(id = R.string.premium_table_never),
key = stringResource(id = R.string.premium_home_table_expires),
value = stringResource(id = R.string.premium_home_table_never),
alwaysHideApply = true,
)
} else {
PrimalPremiumTableRow(
key = when {
premiumMembership.isExpired() -> stringResource(id = R.string.premium_table_expired_on)
premiumMembership.recurring -> stringResource(id = R.string.premium_table_renews_on)
else -> stringResource(id = R.string.premium_table_expires_on)
premiumMembership.isExpired() -> stringResource(id = R.string.premium_home_table_expired_on)
premiumMembership.recurring -> stringResource(id = R.string.premium_home_table_renews_on)
else -> stringResource(id = R.string.premium_home_table_expires_on)
},
value = when {
premiumMembership.recurring && premiumMembership.renewsOn != null ->
Expand All @@ -80,7 +80,7 @@ fun PrimalPremiumTable(
premiumMembership.expiresOn != null -> Instant.ofEpochSecond(premiumMembership.expiresOn)
.formatToDefaultDateFormat(FormatStyle.LONG)

else -> stringResource(R.string.premium_table_never)
else -> stringResource(R.string.premium_home_table_never)
},
alwaysHideApply = true,
)
Expand Down Expand Up @@ -148,7 +148,7 @@ private fun PrimalPremiumTableRow(
}
Text(
modifier = Modifier.clickable { onApplyClick?.invoke() },
text = stringResource(id = R.string.premium_table_apply),
text = stringResource(id = R.string.premium_home_table_apply),
color = AppTheme.colorScheme.secondary,
style = AppTheme.typography.bodyMedium,
)
Expand Down
37 changes: 18 additions & 19 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,27 @@
<string name="premium_promo_code_apply_button">Apply Promo Code</string>
<string name="premium_promo_code_cancel_button">Cancel</string>

<string name="premium_member_title">Premium</string>
<string name="premium_member_early_primal_user">Hey there! You are an early Primal user who interacted with our team, so we gave you 6 months of Primal Premium for free. ♥\uFE0F\uD83E\uDEC2</string>
<string name="premium_manage_premium_button">Manage Premium</string>
<string name="premium_renew_subscription">Renew Subscription</string>
<string name="premium_extend_subscription">Extend Subscription</string>
<string name="premium_enjoying_primal">Are you enjoying Primal?</string>
<string name="premium_enjoying_primal_if_so">If so, see how you can</string>
<string name="premium_support_us">support us</string>
<string name="premium_table_expires">Expires</string>
<string name="premium_table_never">Never</string>
<string name="premium_table_renews_on">Renews on</string>
<string name="premium_table_expires_on">Expires on</string>
<string name="premium_table_expired_on">Expired on</string>
<string name="premium_table_apply">apply</string>
<string name="premium_expired_subscription_notice">Your Primal Premium subscription has expired.\nYou can renew it below:</string>
<string name="premium_home_member_title">Premium</string>
<string name="premium_home_member_early_primal_user">Hey there! You are an early Primal user who interacted with our team, so we gave you 6 months of Primal Premium for free. ♥\uFE0F\uD83E\uDEC2</string>
<string name="premium_home_premium_button">Manage Premium</string>
<string name="premium_home_renew_subscription">Renew Subscription</string>
<string name="premium_home_extend_subscription">Extend Subscription</string>
<string name="premium_home_enjoying_primal">Are you enjoying Primal?</string>
<string name="premium_home_enjoying_primal_if_so">If so, see how you can</string>
<string name="premium_home_support_us">support us</string>
<string name="premium_home_table_expires">Expires</string>
<string name="premium_home_table_never">Never</string>
<string name="premium_home_table_renews_on">Renews on</string>
<string name="premium_home_table_expires_on">Expires on</string>
<string name="premium_home_table_expired_on">Expired on</string>
<string name="premium_home_table_apply">apply</string>
<string name="premium_home_expired_subscription_notice">Your Primal Premium subscription has expired.\nYou can renew it below:</string>
<string name="premium_home_legend_contribution_title">Your contribution to Primal:</string>
<string name="premium_home_legend_support_appreciation">Thank you for your support! 💜🫂</string>
<string name="premium_home_legend_contribute_more">Want to contribute more?</string>

<string name="premium_support_primal_title">Support Primal</string>

<string name="legend_contribution_title">Your contribution to Primal:</string>
<string name="legend_support_appreciation">Thank you for your support! 💜🫂</string>
<string name="legend_contribute_more">Want to contribute more?</string>

<string name="premium_become_legend_primal_title">Primal Legend</string>
<string name="premium_become_legend_intro_description">The Legend tier was created to recognize users who have made a significant\ncontribution to Primal.</string>
<string name="premium_become_legend_intro_subtitle">Donate $1000 or more to gain:</string>
Expand Down

0 comments on commit 538b30e

Please sign in to comment.