feat: 订阅样式

This commit is contained in:
jinyaqiu 2025-09-02 09:44:20 +08:00
parent 8d5d69fb4a
commit ac5d7d11cc
3 changed files with 30 additions and 10 deletions

View File

@ -13,7 +13,7 @@ struct SVGImage: UIViewRepresentable {
private func createImageView() -> SVGKFastImageView { private func createImageView() -> SVGKFastImageView {
let emptySVGString = """ let emptySVGString = """
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" preserveAspectRatio="xMidYMid meet"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" preserveAspectRatio="xMidYMid meet">
<rect width="1" height="1" fill="red" opacity="0.5"/> <rect width="1" height="1" fill="transparent"/>
</svg> </svg>
""" """
@ -21,10 +21,13 @@ struct SVGImage: UIViewRepresentable {
let svgImage = SVGKImage(data: data) { let svgImage = SVGKImage(data: data) {
let imageView = SVGKFastImageView(svgkImage: svgImage) ?? SVGKFastImageView() let imageView = SVGKFastImageView(svgkImage: svgImage) ?? SVGKFastImageView()
imageView.contentMode = .scaleAspectFit imageView.contentMode = .scaleAspectFit
imageView.backgroundColor = .clear
return imageView return imageView
} }
return SVGKFastImageView() let fallbackView = SVGKFastImageView()
fallbackView.backgroundColor = .clear
return fallbackView
} }
func makeUIView(context: Context) -> SVGKFastImageView { func makeUIView(context: Context) -> SVGKFastImageView {
@ -69,6 +72,7 @@ struct SVGImage: UIViewRepresentable {
imageView.contentMode = contentMode == .fit ? .scaleAspectFit : .scaleAspectFill imageView.contentMode = contentMode == .fit ? .scaleAspectFit : .scaleAspectFill
imageView.clipsToBounds = true imageView.clipsToBounds = true
imageView.translatesAutoresizingMaskIntoConstraints = false imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.backgroundColor = .clear
// //
imageView.autoresizingMask = [.flexibleWidth, .flexibleHeight] imageView.autoresizingMask = [.flexibleWidth, .flexibleHeight]

View File

@ -32,8 +32,8 @@ struct CreditsInfoCard: View {
mainCreditsSection mainCreditsSection
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
.background(Theme.Colors.primaryLight) .background(Color.themeTextWhite)
.cornerRadius(Theme.CornerRadius.extraLarge) .cornerRadius(Theme.CornerRadius.round)
// .shadow(color: Theme.Shadows.small, radius: Theme.Shadows.cardShadow.radius, x: Theme.Shadows.cardShadow.x, y: Theme.Shadows.cardShadow.y) // .shadow(color: Theme.Shadows.small, radius: Theme.Shadows.cardShadow.radius, x: Theme.Shadows.cardShadow.x, y: Theme.Shadows.cardShadow.y)
} }

View File

@ -61,7 +61,6 @@ struct SubscribeView: View {
dismiss() dismiss()
} }
.background(Color.themeTextWhiteSecondary) .background(Color.themeTextWhiteSecondary)
.padding(.bottom, Theme.Spacing.lg)
ScrollView { ScrollView {
VStack(spacing: 0) { VStack(spacing: 0) {
@ -232,6 +231,9 @@ struct SubscribeView: View {
HStack(spacing: 8) { HStack(spacing: 8) {
Button(action: { Button(action: {
// //
if let url = URL(string: "https://memorywake.com/privacy-policy") {
UIApplication.shared.open(url)
}
}) { }) {
Text("Terms of Service") Text("Terms of Service")
.underline() .underline()
@ -242,6 +244,9 @@ struct SubscribeView: View {
Button(action: { Button(action: {
// //
if let url = URL(string: "https://memorywake.com/privacy-policy") {
UIApplication.shared.open(url)
}
}) { }) {
Text("Privacy Policy") Text("Privacy Policy")
.underline() .underline()
@ -250,13 +255,24 @@ struct SubscribeView: View {
Text("|") Text("|")
.foregroundColor(.secondary) .foregroundColor(.secondary)
// Button(action: {
// Task { await store.restorePurchases() }
// }) {
// Text("Restore Purchase")
// .underline()
// }
Button(action: { Button(action: {
Task { await store.restorePurchases() } //
}) { if let url = URL(string: "https://memorywake.com/privacy-policy") {
Text("Restore Purchase") UIApplication.shared.open(url)
.underline() }
}) {
Text("AI Usage Guidelines")
.underline()
}
} }
}
.font(Typography.font(for: .caption, family: .quicksandRegular)) .font(Typography.font(for: .caption, family: .quicksandRegular))
.foregroundColor(.secondary) .foregroundColor(.secondary)
.padding(.top, Theme.Spacing.sm) .padding(.top, Theme.Spacing.sm)