UI refinements

This commit is contained in:
Justin Mazzocchi 2020-09-10 18:59:43 -07:00
parent 7d0feaac54
commit 921e84c08b
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
4 changed files with 20 additions and 19 deletions

View file

@ -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";

View file

@ -55,7 +55,7 @@ public extension AddIdentityViewModel {
addIdentity(authenticated: true)
}
func browseAnonymouslyTapped() {
func browseTapped() {
addIdentity(authenticated: false)
}

View file

@ -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)

View file

@ -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) {