mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +00:00
UI refinements
This commit is contained in:
parent
7d0feaac54
commit
921e84c08b
4 changed files with 20 additions and 19 deletions
|
@ -4,13 +4,13 @@
|
|||
"apns-default-message" = "New notification";
|
||||
"add-identity.instance-url" = "Instance URL";
|
||||
"add-identity.log-in" = "Log in";
|
||||
"add-identity.browse-anonymously" = "Browse anonymously";
|
||||
"add-identity.browse" = "Browse";
|
||||
"add-identity.unable-to-connect-to-instance" = "Unable to connect to instance";
|
||||
"secondary-navigation.manage-accounts" = "Manage Accounts";
|
||||
"secondary-navigation.lists" = "Lists";
|
||||
"secondary-navigation.preferences" = "Preferences";
|
||||
"identities.accounts" = "Accounts";
|
||||
"identities.browsing-anonymously" = "Browsing Anonymously";
|
||||
"identities.browsing" = "Browsing";
|
||||
"lists.new-list-title" = "New List Title";
|
||||
"preferences" = "Preferences";
|
||||
"preferences.posting-reading" = "Posting and Reading";
|
||||
|
|
|
@ -55,7 +55,7 @@ public extension AddIdentityViewModel {
|
|||
addIdentity(authenticated: true)
|
||||
}
|
||||
|
||||
func browseAnonymouslyTapped() {
|
||||
func browseTapped() {
|
||||
addIdentity(authenticated: false)
|
||||
}
|
||||
|
||||
|
|
|
@ -15,21 +15,7 @@ struct AddIdentityView: View {
|
|||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.keyboardType(.URL)
|
||||
Group {
|
||||
if viewModel.loading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Button("add-identity.log-in",
|
||||
action: viewModel.logInTapped)
|
||||
if viewModel.isPublicTimelineAvailable {
|
||||
Button("add-identity.browse-anonymously", action: viewModel.browseAnonymouslyTapped)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
}
|
||||
if let instance = viewModel.instance {
|
||||
Section {
|
||||
if let instance = viewModel.instance {
|
||||
VStack(alignment: .center) {
|
||||
KFImage(instance.thumbnail)
|
||||
.placeholder {
|
||||
|
@ -37,15 +23,30 @@ struct AddIdentityView: View {
|
|||
}
|
||||
.resizable()
|
||||
.aspectRatio(16 / 9, contentMode: .fill)
|
||||
.background(Color.blue)
|
||||
Spacer()
|
||||
Text(instance.title)
|
||||
.font(.headline)
|
||||
Text(instance.uri)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
Spacer()
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.listRowInsets(EdgeInsets())
|
||||
}
|
||||
Group {
|
||||
if viewModel.loading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Button("add-identity.log-in",
|
||||
action: viewModel.logInTapped)
|
||||
if viewModel.isPublicTimelineAvailable {
|
||||
Button("add-identity.browse", action: viewModel.browseTapped)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
}
|
||||
}
|
||||
.animation(.default)
|
||||
|
|
|
@ -20,7 +20,7 @@ struct IdentitiesView: View {
|
|||
})
|
||||
}
|
||||
section(title: "identities.accounts", identities: viewModel.authenticated)
|
||||
section(title: "identities.browsing-anonymously", identities: viewModel.unauthenticated)
|
||||
section(title: "identities.browsing", identities: viewModel.unauthenticated)
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: ToolbarItemPlacement.navigationBarTrailing) {
|
||||
|
|
Loading…
Reference in a new issue