Files
andros 7c0fc19b79 Add Discover tab, change default history to 14 days, add Settings/About section, reorganize tabs to 5
- Discover: fetches all relay feeds, shuffles randomly, shows avatar/nick/bio with Follow/Unfollow per user
- Default post history: 7 → 14 days (OrgSocialApp.swift + TimelineViewModel fallback)
- Settings About section: Donate (liberapay.com/org-social) + Issue/PR (git.andros.dev/andros/contribute) links
- Tab bar: 5 tabs (Timeline, Notifications, Discover, Groups, Profile) — Settings accessible via gear in Profile toolbar
- OwnProfileView: shows Settings gear in toolbar; shows action button to open Settings when feed URL not configured
2026-04-19 19:59:35 +02:00

43 lines
1.4 KiB
Swift

import SwiftUI
struct OwnProfileView: View {
@AppStorage("publicFeedURL") private var publicFeedURLString = ""
@State private var showSettings = false
private var feedURL: URL? {
guard let url = URL(string: publicFeedURLString),
url.scheme?.hasPrefix("http") == true,
url.host != nil else { return nil }
return url
}
var body: some View {
NavigationStack {
Group {
if let url = feedURL {
ProfileView(feedURL: url)
} else {
ContentUnavailableView {
Label("No profile", systemImage: "person.slash")
} description: {
Text("Set your Feed URL in Settings to see your profile.")
} actions: {
Button("Open Settings") { showSettings = true }
.buttonStyle(.bordered)
}
}
}
.navigationTitle("Profile")
.navigationBarTitleDisplayMode(.large)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button { showSettings = true } label: {
Image(systemName: "gearshape")
}
}
}
.sheet(isPresented: $showSettings) { SettingsView() }
}
}
}