Skip to content

Commit

Permalink
[Internal] Fix toast and update TF notes (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Sep 10, 2023
1 parent 9b03579 commit ded138c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions Forumate/ForumateApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct ForumateApp: App {
#endif

#if os(iOS) || os(visionOS) || os(macOS)
// FIXME: This will lead to a crash for themeManager currently.
WindowGroup("Topic Detail", id: "topic", for: TopicDetailWindowModel.self) { $detailModel in
DetailWindowView(detailModel: detailModel)
.modifier(AppViewModifier())
Expand Down
1 change: 1 addition & 0 deletions Forumate/Model/TopicDetailWindowModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
import SwiftData

struct TopicDetailWindowModel: Codable, Hashable {
// FIXME: use topic id instead
let topic: Topic
let communityID: PersistentIdentifier
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ struct CommunityDetail: View {
}
.navigationTitle(state.community.title)
.environmentObject(state)
.toast(isPresented: $state.unimplementedToast) {
Label("Unimplemented Feature", systemImage: "paperplane")
.foregroundStyle(.white)
.tint(Color.accentColor.opacity(0.8))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,12 @@ struct TopicLabel: View {
Divider()
Button {
// TODO: Mark as read feature unimplemented
unimplementedToast.toggle()
state.unimplementedToast.toggle()
} label: {
Label("Mark As Read", systemImage: "doc.text.image")
}
.toast(isPresented: $unimplementedToast) {
Label("Unimplemented Feature", systemImage: "paperplane")
.foregroundStyle(.white)
.tint(Color.accentColor.opacity(0.8))
}
} preview: {
// FIXME: The size for the preview is not correct.
TopicDetail(topic: topic)
.frame(maxHeight: 800)
.environmentObject(appState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ class CommunityDetailState: ObservableObject {
static var unspecified: CommunityDetailState.ViewByType { categories }
}

@AppStorage var viewByType: ViewByType
@AppStorage var viewByType: ViewByType

@Published var unimplementedToast = false
}

enum DefaultViewByTypeSetting: Setting {
Expand Down
4 changes: 4 additions & 0 deletions TestFlight/WhatToTest.en-US.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
What's new in v0.7.0-beta

- Updated layout for topic detail view
- New toolbar item for topic detail view
- Recommend Community System update

0 comments on commit ded138c

Please sign in to comment.