Skip to content

Commit

Permalink
[Feature] Add ForumatePlus (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye authored Sep 9, 2023
1 parent 554410d commit ab2356f
Show file tree
Hide file tree
Showing 27 changed files with 1,240 additions and 537 deletions.
106 changes: 90 additions & 16 deletions Forumate.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Forumate.xcodeproj/xcshareddata/xcschemes/Forumate.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
ReferencedContainer = "container:Forumate.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<StoreKitConfigurationFileReference
identifier = "../../Forumate/Store/Forumate.storekit">
</StoreKitConfigurationFileReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
23 changes: 23 additions & 0 deletions Forumate/AppViewModifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AppViewModifier.swift
// Forumate
//
// Created by Kyle on 2023/9/9.
//

import SwiftUI

struct AppViewModifier: ViewModifier {
#if os(iOS) || os(macOS)
@Environment(ThemeManager.self)
private var themeManager
#endif

func body(content: Content) -> some View {
content
#if os(iOS) || os(macOS)
.preferredColorScheme(themeManager.colorScheme)
.tint(themeManager.accentColor)
#endif
}
}
23 changes: 11 additions & 12 deletions Forumate/ForumateApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ struct ForumateApp: App {
#if os(iOS) || os(macOS)
@State private var themeManager = ThemeManager()
#endif

@State private var plusManager = PlusManager()

var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(appState)
#if os(iOS) || os(macOS)
.preferredColorScheme(themeManager.colorScheme)
.tint(themeManager.accentColor)
#endif
.modifier(AppViewModifier())
}
.modelContainer(container)
.environmentObject(appState)
#if os(iOS) || os(macOS)
.environment(themeManager)
#endif
.environment(plusManager)
.modelContainer(container)

#if os(iOS) || os(visionOS) || os(macOS)
WindowGroup("Topic Detail", id: "topic", for: TopicDetailWindowModel.self) { $detailModel in
DetailWindowView(detailModel: detailModel)
#if os(iOS) || os(macOS)
.preferredColorScheme(themeManager.colorScheme)
.tint(themeManager.accentColor)
#endif
.modifier(AppViewModifier())
}
.modelContainer(container)
.environmentObject(appState)
#if os(iOS) || os(macOS)
.environment(themeManager)
#endif
.environment(plusManager)
.modelContainer(container)
#endif
}
}
Expand All @@ -65,7 +65,6 @@ struct DetailWindowView: View {
if let detailModel,
let community = context.model(for: detailModel.communityID) as? Community {
TopicDetail(topic: detailModel.topic)
.environmentObject(appState)
.environmentObject(CommunityDetailState(community: community))
} else {
PlaceholderView(text: "No Topic Detail")
Expand Down
6 changes: 6 additions & 0 deletions Forumate/Other/Assets.xcassets/graph/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
12 changes: 12 additions & 0 deletions Forumate/Other/Assets.xcassets/graph/graph.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "graph.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
61 changes: 61 additions & 0 deletions Forumate/Other/Assets.xcassets/graph/graph.imageset/graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions Forumate/Other/Assets.xcassets/graph/graph1.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "extended-linear-srgb",
"components" : {
"alpha" : "1.000",
"blue" : "214",
"green" : "222",
"red" : "248"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions Forumate/Other/Assets.xcassets/graph/graph2.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "extended-linear-srgb",
"components" : {
"alpha" : "1.000",
"blue" : "244",
"green" : "245",
"red" : "215"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit ab2356f

Please sign in to comment.