Skip to content

Commit fe133e9

Browse files
committed
Add support on boosty option
1 parent 259ef51 commit fe133e9

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

Modules/Sources/AnalyticsClient/Events/SettingsEvent.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public enum SettingsEvent: Event {
1414
case safariExtensionTapped
1515
case copyDebugIdTapped
1616
case clearCacheTapped
17+
case supportOnBoostyTapped
1718
case appDiscussion4pdaTapped
1819
case chatTelegramTapped
1920
case changelogTelegramTapped

Modules/Sources/Models/Common/Links.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import Foundation
99

1010
// TODO: Duplicate on github?
1111

12-
public struct Links {
12+
public enum Links {
1313

1414
public static let _4pda = URL(string: "https://4pda.to/")!
1515
public static let _4pdaAuthor = URL(string: "https://4pda.to/forum/index.php?showuser=3640948")!
16+
public static let boosty = URL(string: "https://boosty.to/forpda")!
1617
public static let appDiscussion = URL(string: "https://4pda.to/forum/index.php?showtopic=1104159")!
1718
public static let telegramChangelog = URL(string: "https://t.me/forpda_ios")!
1819
public static let telegramChat = URL(string: "https://t.me/forpda_ios_chat")!

Modules/Sources/SettingsFeature/Analytics/SettingsFeature+Analytics.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ extension SettingsFeature {
4747
case .clearCacheButtonTapped:
4848
analyticsClient.log(SettingsEvent.clearCacheTapped)
4949

50+
case .supportOnBoostyButtonTapped:
51+
analyticsClient.log(SettingsEvent.supportOnBoostyTapped)
52+
5053
case .appDiscussionButtonTapped:
5154
analyticsClient.log(SettingsEvent.appDiscussion4pdaTapped)
5255

Modules/Sources/SettingsFeature/Resources/Localizable.xcstrings

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
}
6363
},
6464
"Background color" : {
65+
"extractionState" : "stale",
6566
"localizations" : {
6667
"ru" : {
6768
"stringUnit" : {
@@ -393,23 +394,22 @@
393394
}
394395
}
395396
},
396-
"System" : {
397+
"Support on Boosty" : {
397398
"localizations" : {
398399
"ru" : {
399400
"stringUnit" : {
400401
"state" : "translated",
401-
"value" : "Системная"
402+
"value" : "Поддержать на Boosty"
402403
}
403404
}
404405
}
405406
},
406-
"Text size" : {
407-
"extractionState" : "stale",
407+
"System" : {
408408
"localizations" : {
409409
"ru" : {
410410
"stringUnit" : {
411411
"state" : "translated",
412-
"value" : "Размер текста"
412+
"value" : "Системная"
413413
}
414414
}
415415
}

Modules/Sources/SettingsFeature/SettingsFeature.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public struct SettingsFeature: Reducer, Sendable {
7878
case copyDebugIdButtonTapped
7979
// case copyPushTokenButtonTapped
8080
case clearCacheButtonTapped
81+
case supportOnBoostyButtonTapped
8182
case appDiscussionButtonTapped
8283
case telegramChangelogButtonTapped
8384
case telegramChatButtonTapped
@@ -150,6 +151,11 @@ public struct SettingsFeature: Reducer, Sendable {
150151
state.destination = .alert(.clearCache)
151152
return .none
152153

154+
case .supportOnBoostyButtonTapped:
155+
return .run { _ in
156+
await open(url: Links.boosty)
157+
}
158+
153159
case .appDiscussionButtonTapped:
154160
return .run { _ in
155161
await open(url: Links.appDiscussion)

Modules/Sources/SettingsFeature/SettingsScreen.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public struct SettingsScreen: View {
3030
List {
3131
ThemeSection()
3232
BasicSection()
33-
AdvancedSection()
3433
LinksSection()
34+
AdvancedSection()
3535
AboutAppSection()
3636
}
3737
.scrollContentBackground(.hidden)
@@ -72,6 +72,7 @@ public struct SettingsScreen: View {
7272
symbol: SFSymbol,
7373
title: LocalizedStringKey,
7474
type: RowType,
75+
isBold: Bool = false,
7576
toggle: Binding<Bool>? = nil,
7677
action: @escaping () -> Void = {}
7778
) -> some View {
@@ -89,6 +90,7 @@ public struct SettingsScreen: View {
8990
Text(title, bundle: .module)
9091
.font(.body)
9192
.foregroundStyle(Color(.Labels.primary))
93+
.bold(isBold)
9294

9395
Spacer(minLength: 8)
9496

@@ -239,7 +241,7 @@ public struct SettingsScreen: View {
239241
Section {
240242
Row(symbol: ._1Circle, title: "Starting page", type: .startPagePicker)
241243

242-
Row(symbol: .paintpalette, title: "Background color", type: .backgroundPicker)
244+
// Row(symbol: .paintpalette, title: "Background color", type: .backgroundPicker)
243245

244246
Row(symbol: .swatchpalette, title: "Accent color", type: .themePicker)
245247

@@ -296,8 +298,8 @@ public struct SettingsScreen: View {
296298
@ViewBuilder
297299
private func LinksSection() -> some View {
298300
Section {
299-
Row(symbol: .infoBubble, title: "App discussion on the forum", type: .navigation) {
300-
store.send(.appDiscussionButtonTapped)
301+
Row(symbol: .boltHeart, title: "Support on Boosty", type: .navigation, isBold: true) {
302+
store.send(.supportOnBoostyButtonTapped)
301303
}
302304

303305
Row(symbol: .paperplane, title: "App discussion in Telegram", type: .navigation) {
@@ -308,6 +310,10 @@ public struct SettingsScreen: View {
308310
store.send(.telegramChangelogButtonTapped)
309311
}
310312

313+
Row(symbol: .infoBubble, title: "App discussion on the forum", type: .navigation) {
314+
store.send(.appDiscussionButtonTapped)
315+
}
316+
311317
Row(symbol: .folderBadgeGearshape, title: "GitHub repository", type: .navigation) {
312318
store.send(.githubButtonTapped)
313319
}
@@ -433,4 +439,5 @@ private var isDebug: Bool {
433439
)
434440
}
435441
.environment(\.tintColor, Color(.Theme.primary))
442+
.environment(\.locale, Locale(identifier: "ru"))
436443
}

0 commit comments

Comments
 (0)