diff --git a/CHANGELOG.md b/CHANGELOG.md index be3c3d0..6ef474b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ The format has been adjusted to include a release Title. This has been inserted ## [Unreleased] +### Added +- Added an announcement for the Minna Discord channel. + ## [0.15.1] - Post Clone Fixes - 2026-09-02 ### Fixed diff --git a/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Contents.json b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Contents.json new file mode 100644 index 0000000..0a3a25f --- /dev/null +++ b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Discord Announcement.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Discord Announcement@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Discord Announcement@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement.png b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement.png new file mode 100644 index 0000000..9e3d9e1 Binary files /dev/null and b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement.png differ diff --git a/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@2x.png b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@2x.png new file mode 100644 index 0000000..ec2ede1 Binary files /dev/null and b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@2x.png differ diff --git a/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@3x.png b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@3x.png new file mode 100644 index 0000000..62fe51f Binary files /dev/null and b/Minna/Resources/Assets.xcassets/discord_announcement.imageset/Discord Announcement@3x.png differ diff --git a/Minna/Views/Common/AnnouncementView.swift b/Minna/Views/Common/AnnouncementView.swift new file mode 100644 index 0000000..d5c479c --- /dev/null +++ b/Minna/Views/Common/AnnouncementView.swift @@ -0,0 +1,83 @@ +// +// AnnouncementView.swift +// Minna +// +// Created by Taylor Lineman on 9/3/26. +// + +import SwiftUI +import SFSafeSymbols + +struct Announcement { + let title: String + let caption: String? + let description: String + + let image: ImageResource + + let urlLabel: String + let urlSymbol: String + let url: URL +} + +struct AnnouncementView: View { + @Environment(\.dismiss) var dismiss + let announcement: Announcement + + var body: some View { + ZStack(alignment: .topTrailing) { + HStack { + Image(announcement.image) + .accessibilityHidden(true) + Spacer() + VStack(alignment: .leading, spacing: 10) { + Text(announcement.title) + .font(.title) + if let caption = announcement.caption { + Text(caption) + .font(.caption) + } + Text(announcement.description) + + Link(destination: announcement.url) { + HStack { + Text(announcement.urlLabel) + Image(systemName: announcement.urlSymbol) + .accessibilityHidden(true) + } + } + .buttonStyle(.borderedProminent) + } + .padding(.trailing) + } + Button { + dismiss() + } label: { + Image(systemSymbol: .xmark) + .accessibilityLabel("Dismiss announcement.") + .padding(5) + } + .buttonBorderShape(.circle) + .buttonStyle(.glass) + .padding(10) + + } + .frame(width: 500) + + } +} + +#Preview { +// Text("Hello") +// .sheet(isPresented: .constant(true)) { + AnnouncementView(announcement: Announcement( + title: "Join our Discord!", + caption: nil, + description: "Get app support, send feedback, and talk about feature you would love! The discord is a great place to get involved with Minna.", + image: ImageResource(name: "discord_announcement", bundle: .main), + urlLabel: "Join the discord", + urlSymbol: SFSymbol.arrowUpRight.rawValue, + url: URL(string: "https://discord.gg/fveUWjck3W")! + )) +// } +} diff --git a/Minna/Views/Navigation/NavigationCore.swift b/Minna/Views/Navigation/NavigationCore.swift index 6205df8..5c444df 100644 --- a/Minna/Views/Navigation/NavigationCore.swift +++ b/Minna/Views/Navigation/NavigationCore.swift @@ -23,6 +23,9 @@ public struct NavigationCore: View { @AppStorage("knowledgeExpanded") var knowledgeExpanded: Bool = true @AppStorage("connectionsExpanded") var connectionsExpanded: Bool = true + + @AppStorage("hasShownDiscord") var hasShownDiscordSheet: Bool = false + @State var presentingDiscordSheet: Bool = false @State var navigationRouter: NavigationRouter = NavigationRouter() @@ -100,6 +103,11 @@ public struct NavigationCore: View { } } .onAppear { + if !hasShownDiscordSheet { + presentingDiscordSheet = true + hasShownDiscordSheet = true + } + modelContext.undoManager = undoManager do { @@ -181,6 +189,17 @@ public struct NavigationCore: View { Text("Please contact support (support@tryminna.com). Error: \(database.initializationError?.localizedDescription ?? "unknown")") } .standardDropDestination(presented: $isDroppingFile, selectedFolder: navigationRouter.currentFolder, modelContext: modelContext, irisContext: irisContext, database: database) + .sheet(isPresented: $presentingDiscordSheet) { + AnnouncementView(announcement: Announcement( + title: "Join our Discord!", + caption: nil, + description: "Get app support, send feedback, and talk about features you would love! The Discord is a great place to get involved with Minna.", + image: ImageResource(name: "discord_announcement", bundle: .main), + urlLabel: "Join the discord", + urlSymbol: SFSymbol.arrowUpRight.rawValue, + url: URL(string: "https://discord.gg/fveUWjck3W")! + )) + } } func addFolder(in folder: Folder?) {