Fix add account instance info view

This commit is contained in:
Thomas Ricouard 2023-01-07 18:12:56 +01:00
parent 039f786c16
commit a1a6c3091e
2 changed files with 28 additions and 18 deletions

View file

@ -51,7 +51,7 @@ struct AddAccountView: View {
} }
} }
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
InstanceInfoView(instance: instance) InstanceInfoSection(instance: instance)
} else { } else {
instancesListView instancesListView
} }

View file

@ -10,6 +10,20 @@ struct InstanceInfoView: View {
var body: some View { var body: some View {
Form { Form {
InstanceInfoSection(instance: instance)
}
.navigationTitle("Instance Info")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
}
}
public struct InstanceInfoSection: View {
@EnvironmentObject private var theme: Theme
let instance: Instance
public var body: some View {
Section("Instance info") { Section("Instance info") {
LabeledContent("Name", value: instance.title) LabeledContent("Name", value: instance.title)
Text(instance.shortDescription) Text(instance.shortDescription)
@ -28,8 +42,4 @@ struct InstanceInfoView: View {
} }
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
} }
.navigationTitle("Instance Info")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
}
} }