Drop "Name" field from modules (#909)
Will rather add a "Notes" field to profiles. Module names feel overwhelming.
This commit is contained in:
parent
72f6a1b1a1
commit
366dc62231
|
@ -80,7 +80,7 @@ struct OpenVPNView: View, ModuleDraftEditing {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
contentView
|
contentView
|
||||||
.moduleView(editor: editor, draft: draft.wrappedValue, withName: !isServerPushed)
|
.moduleView(editor: editor, draft: draft.wrappedValue)
|
||||||
.fileImporter(
|
.fileImporter(
|
||||||
isPresented: $isImporting,
|
isPresented: $isImporting,
|
||||||
allowedContentTypes: [.item],
|
allowedContentTypes: [.item],
|
||||||
|
|
|
@ -33,16 +33,8 @@ struct ModuleViewModifier<T>: ViewModifier where T: ModuleBuilder & Equatable {
|
||||||
|
|
||||||
let draft: T
|
let draft: T
|
||||||
|
|
||||||
let withName: Bool
|
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
Form {
|
Form {
|
||||||
if withName {
|
|
||||||
NameSection(
|
|
||||||
name: editor.binding(forNameOf: draft.id),
|
|
||||||
placeholder: draft.moduleType.localizedDescription
|
|
||||||
)
|
|
||||||
}
|
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
.themeForm()
|
.themeForm()
|
||||||
|
@ -52,7 +44,7 @@ struct ModuleViewModifier<T>: ViewModifier where T: ModuleBuilder & Equatable {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension View {
|
extension View {
|
||||||
func moduleView<T>(editor: ProfileEditor, draft: T, withName: Bool = true) -> some View where T: ModuleBuilder & Equatable {
|
func moduleView<T>(editor: ProfileEditor, draft: T) -> some View where T: ModuleBuilder & Equatable {
|
||||||
modifier(ModuleViewModifier(editor: editor, draft: draft, withName: withName))
|
modifier(ModuleViewModifier(editor: editor, draft: draft))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue