add missing strings
add height back to purchase view button on year and month
This commit is contained in:
Trey t
2023-01-05 13:48:21 -06:00
parent e7e9367896
commit e7efd1ab25
6 changed files with 31 additions and 14 deletions

View File

@@ -49,7 +49,7 @@ enum PersonalityPack: Int, CaseIterable {
} }
final class DefaultTitles: PersonalityPackable { final class DefaultTitles: PersonalityPackable {
static var title = "Nice" static var title = String(localized: "nice")
static var notificationTitles: [String] { static var notificationTitles: [String] {
[ [
@@ -79,7 +79,7 @@ final class DefaultTitles: PersonalityPackable {
} }
final class RudeTitles: PersonalityPackable { final class RudeTitles: PersonalityPackable {
static var title = "Rude" static var title = String(localized: "rude")
static var notificationTitles: [String] { static var notificationTitles: [String] {
[ [

View File

@@ -45,7 +45,7 @@ struct CustomWigetView: View {
.padding() .padding()
.cornerRadius(10) .cornerRadius(10)
Text("[How to add widget](https://support.apple.com/guide/iphone/add-widgets-iphb8f1bf206/ios)") Text("[\(String(localized: "how_to_add_widget"))](https://support.apple.com/guide/iphone/add-widgets-iphb8f1bf206/ios)")
.accentColor(textColor) .accentColor(textColor)
.padding(.bottom) .padding(.bottom)
} }

View File

@@ -86,7 +86,7 @@ struct MonthView: View {
if iapManager.showIAP { if iapManager.showIAP {
VStack { VStack {
Spacer() Spacer()
PurchaseButtonView(iapManager: iapManager) PurchaseButtonView(height: 250, iapManager: iapManager)
} }
} else if iapManager.showIAPWarning { } else if iapManager.showIAPWarning {
VStack { VStack {

View File

@@ -17,8 +17,13 @@ struct PurchaseButtonView: View {
private let showCountdownTimer: Bool private let showCountdownTimer: Bool
private let showManageSubClosure: (() -> Void)? private let showManageSubClosure: (() -> Void)?
private let height: CGFloat?
public init(iapManager: IAPManager, showManageSubClosure: (() -> Void)? = nil, showCountdownTimer: Bool = false) {
public init(height: CGFloat? = nil,
iapManager: IAPManager,
showManageSubClosure: (() -> Void)? = nil,
showCountdownTimer: Bool = false) {
self.height = height
self.showManageSubClosure = showManageSubClosure self.showManageSubClosure = showManageSubClosure
self.iapManager = iapManager self.iapManager = iapManager
self.showCountdownTimer = showCountdownTimer self.showCountdownTimer = showCountdownTimer
@@ -31,8 +36,14 @@ struct PurchaseButtonView: View {
switch iapManager.showIAPWarning { switch iapManager.showIAPWarning {
case true: case true:
VStack { VStack {
buyOptionsView if let height = self.height {
.background(theme.currentTheme.secondaryBGColor) buyOptionsView
.background(theme.currentTheme.secondaryBGColor)
.frame(height: height)
} else {
buyOptionsView
.background(theme.currentTheme.secondaryBGColor)
}
} }
case false: case false:
subscribedView subscribedView
@@ -122,12 +133,13 @@ struct PurchaseButtonView: View {
} }
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
} }
Text(String(localized: "purchase_view_current_why_subscribe"))
.font(.body)
.bold()
.foregroundColor(textColor)
} }
Text(String(localized: "purchase_view_current_why_subscribe"))
.font(.body)
.bold()
.foregroundColor(textColor)
HStack { HStack {
ForEach(iapManager.sortedSubscriptionKeysByPriceOptions) { product in ForEach(iapManager.sortedSubscriptionKeysByPriceOptions) { product in
Button(action: { Button(action: {

View File

@@ -67,7 +67,7 @@ struct YearView: View {
if iapManager.showIAP { if iapManager.showIAP {
VStack { VStack {
Spacer() Spacer()
PurchaseButtonView(iapManager: iapManager) PurchaseButtonView(height: 250, iapManager: iapManager)
} }
} else if iapManager.showIAPWarning { } else if iapManager.showIAPWarning {
VStack { VStack {

View File

@@ -138,4 +138,9 @@
"share_view_month_moods_total_template_title" = "Total Entries for %@ - %d"; "share_view_month_moods_total_template_title" = "Total Entries for %@ - %d";
"share_view_current_streak_template_title" = "Last 10 Days"; "share_view_current_streak_template_title" = "Last 10 Days";
"share_view_longest_streak_template_title" = "Longest consecutive days I was %@"; "share_view_longest_streak_template_title" = "Longest consecutive days I was %@";
"how_to_add_widget" = "How to Add Widget";
"nice" = "Nice";
"rude" = "Rude";
/* end not used */ /* end not used */