[ios] Switched OSM profile to SwiftUI and redesigned it

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-04 21:20:43 +02:00
committed by Yannik Bloscheck
parent db1ef9b148
commit 15c7e71866
127 changed files with 1753 additions and 2503 deletions

View File

@@ -0,0 +1,75 @@
import SwiftUI
/// View for the OpenStreetMapp profile
struct NoExistingProfileView: View {
// MARK: - Properties
/// The open url action of the environment
@Environment(\.openURL) private var openUrl
/// If the login form should be shown in the Safari view
@State private var showLogin: Bool = false
/// The actual view
var body: some View {
VStack(alignment: .leading) {
ScrollView {
VStack(alignment: .leading) {
Text("osm_profile_promt")
.font(.headline)
HStack(alignment: .top) {
Image(.osmLogo)
.resizable()
.aspectRatio(1, contentMode: .fit)
.frame(maxWidth: 50)
.padding(.top, 6)
Text("osm_profile_explanation")
}
}
.padding()
}
Spacer(minLength: 0)
VStack {
VStack {
Button {
showLogin = true
} label: {
Text("osm_profile_login")
.frame(maxWidth: .infinity)
}
.buttonStyle(BorderedProminentButtonStyle())
.controlSize(.large)
.font(.headline)
.sheet(isPresented: $showLogin) {
SafariView(url: Profile.authorizationUrl, dismissButton: .cancel)
}
}
Divider()
.padding([.top, .bottom])
VStack(alignment: .leading) {
Text("osm_profile_register_promt")
Button {
openUrl(Profile.registrationUrl)
} label: {
Text("osm_profile_register")
.frame(maxWidth: .infinity)
}
.buttonStyle(BorderedButtonStyle())
.controlSize(.large)
.font(.headline)
}
}
.padding([.bottom, .leading, .trailing])
}
}
}