mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 22:03:37 +00:00
[ios] Switched OSM profile to SwiftUI and redesigned it
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
db1ef9b148
commit
15c7e71866
75
iphone/Maps/UI/Settings/Profile/NoExistingProfileView.swift
Normal file
75
iphone/Maps/UI/Settings/Profile/NoExistingProfileView.swift
Normal 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])
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user