Ferrite-backup/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoAboutView.swift
kingbri d918039810 Plugins: Add website and about properties
These will serve as descriptions for a plugin which will be displayed
in the Plugin Info screen.

website has also replaced baseUrl and dynamicWebsite has replaced
dynamicBaseUrl

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-02 14:53:22 -04:00

30 lines
846 B
Swift

//
// PluginInfoAboutView.swift
// Ferrite
//
// Created by Brian Dashore on 4/2/23.
//
import SwiftUI
struct PluginInfoAboutView<P: Plugin>: View {
@ObservedObject var selectedPlugin: P
var body: some View {
Section(header: InlineHeader("Description")) {
VStack(alignment: .leading, spacing: 10) {
if let pluginAbout = selectedPlugin.about {
if pluginAbout.last == "\n" {
Text(pluginAbout.dropLast())
} else {
Text(pluginAbout)
}
}
if let pluginWebsite = selectedPlugin.website {
Link("Website", destination: URL(string: pluginWebsite) ?? URL(string: "https://kingbri.dev/ferrite")!)
}
}
}
}
}