Skip to content

Commit ab2356f

Browse files
authored
[Feature] Add ForumatePlus (#60)
1 parent 554410d commit ab2356f

27 files changed

+1240
-537
lines changed

Forumate.xcodeproj/project.pbxproj

+90-16
Large diffs are not rendered by default.

Forumate.xcodeproj/xcshareddata/xcschemes/Forumate.xcscheme

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
ReferencedContainer = "container:Forumate.xcodeproj">
6363
</BuildableReference>
6464
</BuildableProductRunnable>
65+
<StoreKitConfigurationFileReference
66+
identifier = "../../Forumate/Store/Forumate.storekit">
67+
</StoreKitConfigurationFileReference>
6568
</LaunchAction>
6669
<ProfileAction
6770
buildConfiguration = "Release"

Forumate/AppViewModifier.swift

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// AppViewModifier.swift
3+
// Forumate
4+
//
5+
// Created by Kyle on 2023/9/9.
6+
//
7+
8+
import SwiftUI
9+
10+
struct AppViewModifier: ViewModifier {
11+
#if os(iOS) || os(macOS)
12+
@Environment(ThemeManager.self)
13+
private var themeManager
14+
#endif
15+
16+
func body(content: Content) -> some View {
17+
content
18+
#if os(iOS) || os(macOS)
19+
.preferredColorScheme(themeManager.colorScheme)
20+
.tint(themeManager.accentColor)
21+
#endif
22+
}
23+
}

Forumate/ForumateApp.swift

+11-12
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,32 @@ struct ForumateApp: App {
2424
#if os(iOS) || os(macOS)
2525
@State private var themeManager = ThemeManager()
2626
#endif
27+
28+
@State private var plusManager = PlusManager()
2729

2830
var body: some Scene {
2931
WindowGroup {
3032
ContentView()
31-
.environmentObject(appState)
32-
#if os(iOS) || os(macOS)
33-
.preferredColorScheme(themeManager.colorScheme)
34-
.tint(themeManager.accentColor)
35-
#endif
33+
.modifier(AppViewModifier())
3634
}
37-
.modelContainer(container)
35+
.environmentObject(appState)
3836
#if os(iOS) || os(macOS)
3937
.environment(themeManager)
4038
#endif
39+
.environment(plusManager)
40+
.modelContainer(container)
41+
4142
#if os(iOS) || os(visionOS) || os(macOS)
4243
WindowGroup("Topic Detail", id: "topic", for: TopicDetailWindowModel.self) { $detailModel in
4344
DetailWindowView(detailModel: detailModel)
44-
#if os(iOS) || os(macOS)
45-
.preferredColorScheme(themeManager.colorScheme)
46-
.tint(themeManager.accentColor)
47-
#endif
45+
.modifier(AppViewModifier())
4846
}
49-
.modelContainer(container)
47+
.environmentObject(appState)
5048
#if os(iOS) || os(macOS)
5149
.environment(themeManager)
5250
#endif
51+
.environment(plusManager)
52+
.modelContainer(container)
5353
#endif
5454
}
5555
}
@@ -65,7 +65,6 @@ struct DetailWindowView: View {
6565
if let detailModel,
6666
let community = context.model(for: detailModel.communityID) as? Community {
6767
TopicDetail(topic: detailModel.topic)
68-
.environmentObject(appState)
6968
.environmentObject(CommunityDetailState(community: community))
7069
} else {
7170
PlaceholderView(text: "No Topic Detail")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "graph.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "extended-linear-srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "214",
9+
"green" : "222",
10+
"red" : "248"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "extended-linear-srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "244",
9+
"green" : "245",
10+
"red" : "215"
11+
}
12+
},
13+
"idiom" : "universal"
14+
}
15+
],
16+
"info" : {
17+
"author" : "xcode",
18+
"version" : 1
19+
}
20+
}

0 commit comments

Comments
 (0)