Ferrite-backup/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsBaseUrlView.swift
kingbri cfc4a74afe Tree: Remove InlineHeader
Was a workaround for iOS 15. No longer required.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-11-27 23:34:26 -05:00

36 lines
1,014 B
Swift

//
// SourceSettingsBaseUrlView.swift
// Ferrite
//
// Created by Brian Dashore on 3/24/23.
//
import SwiftUI
struct SourceSettingsBaseUrlView: View {
@ObservedObject var selectedSource: Source
@State private var tempSite: String = ""
var body: some View {
Section(
header: Text("Base URL"),
footer: Text("Enter the base URL of your server.")
) {
TextField("https://...", text: $tempSite, onEditingChanged: { isFocused in
if !isFocused {
if tempSite.last == "/" {
selectedSource.website = String(tempSite.dropLast())
} else {
selectedSource.website = tempSite
}
}
})
.keyboardType(.URL)
.autocorrectionDisabled(true)
.autocapitalization(.none)
.onAppear {
tempSite = selectedSource.website ?? ""
}
}
}
}