iOS client for Grain grain.social
ios photography atproto
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add "What's an atmosphere account?" link and in-app Safari for login

Opens all links on the login screen (atmosphere account, legal links) in
an in-app Safari sheet instead of leaving the app. Standardizes heading
to "Sign in" for consistency with button and legal text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+27 -1
+27 -1
Grain/Views/LoginView.swift
··· 1 + import SafariServices 1 2 import SwiftUI 2 3 3 4 struct LoginView: View { ··· 15 16 @State private var searchTask: Task<Void, Never>? 16 17 @State private var highlightedSuggestionIndex: Int? 17 18 @Namespace private var suggestionHighlightNS 19 + @State private var safariURL: URL? 18 20 19 21 var body: some View { 20 22 GeometryReader { geo in ··· 72 74 73 75 if suggestions.isEmpty { 74 76 // Heading 75 - Text("Log in with your atmosphere account") 77 + Text("Sign in with your atmosphere account") 76 78 .font(.title3.weight(.semibold)) 77 79 .foregroundStyle(.white) 78 80 .multilineTextAlignment(.center) ··· 239 241 .foregroundStyle(.white.opacity(0.5)) 240 242 .tint(.white.opacity(0.7)) 241 243 .multilineTextAlignment(.center) 244 + 245 + Button("What's an atmosphere account?") { 246 + safariURL = URL(string: "https://atmosphereaccount.com/") 247 + } 248 + .font(.footnote) 249 + .foregroundStyle(.white.opacity(0.5)) 250 + .padding(.top, 4) 242 251 } 243 252 .padding(24) 244 253 ··· 275 284 } 276 285 .scrollDismissesKeyboard(.interactively) 277 286 .scrollIndicators(.hidden) 287 + .environment(\.openURL, OpenURLAction { url in 288 + safariURL = url 289 + return .handled 290 + }) 291 + .sheet(item: $safariURL) { url in 292 + LoginSafariView(url: url) 293 + .ignoresSafeArea() 294 + } 278 295 } // ScrollViewReader 279 296 } 280 297 } ··· 449 466 } 450 467 .clipped() 451 468 } 469 + } 470 + 471 + private struct LoginSafariView: UIViewControllerRepresentable { 472 + let url: URL 473 + func makeUIViewController(context _: Context) -> SFSafariViewController { 474 + SFSafariViewController(url: url) 475 + } 476 + 477 + func updateUIViewController(_: SFSafariViewController, context _: Context) {} 452 478 } 453 479 454 480 #Preview {