mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-22 08:20:59 +00:00
Fix add account instance info view
This commit is contained in:
parent
039f786c16
commit
a1a6c3091e
2 changed files with 28 additions and 18 deletions
|
@ -51,7 +51,7 @@ struct AddAccountView: View {
|
|||
}
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
InstanceInfoView(instance: instance)
|
||||
InstanceInfoSection(instance: instance)
|
||||
} else {
|
||||
instancesListView
|
||||
}
|
||||
|
|
|
@ -10,26 +10,36 @@ struct InstanceInfoView: View {
|
|||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section("Instance info") {
|
||||
LabeledContent("Name", value: instance.title)
|
||||
Text(instance.shortDescription)
|
||||
LabeledContent("Email", value: instance.email)
|
||||
LabeledContent("Version", value: instance.version)
|
||||
LabeledContent("Users", value: "\(instance.stats.userCount)")
|
||||
LabeledContent("Posts", value: "\(instance.stats.statusCount)")
|
||||
LabeledContent("Domains", value: "\(instance.stats.domainCount)")
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
|
||||
Section("Instance rules") {
|
||||
ForEach(instance.rules) { rule in
|
||||
Text(rule.text)
|
||||
}
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
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") {
|
||||
LabeledContent("Name", value: instance.title)
|
||||
Text(instance.shortDescription)
|
||||
LabeledContent("Email", value: instance.email)
|
||||
LabeledContent("Version", value: instance.version)
|
||||
LabeledContent("Users", value: "\(instance.stats.userCount)")
|
||||
LabeledContent("Posts", value: "\(instance.stats.statusCount)")
|
||||
LabeledContent("Domains", value: "\(instance.stats.domainCount)")
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
|
||||
Section("Instance rules") {
|
||||
ForEach(instance.rules) { rule in
|
||||
Text(rule.text)
|
||||
}
|
||||
}
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue