Improved stretchy account header (#518)

This commit is contained in:
Matthias Buchetics 2023-01-30 07:13:38 +01:00 committed by GitHub
parent aff0c943f8
commit d9546d92d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -25,7 +25,11 @@ struct AccountDetailHeaderView: View {
var body: some View { var body: some View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Rectangle()
.frame(height: 200)
.overlay {
headerImageView headerImageView
}
accountInfoView accountInfoView
} }
} }

View file

@ -347,7 +347,7 @@ public struct AccountDetailView: View {
@ToolbarContentBuilder @ToolbarContentBuilder
private var toolbarContent: some ToolbarContent { private var toolbarContent: some ToolbarContent {
ToolbarItem(placement: .principal) { ToolbarItem(placement: .principal) {
if scrollOffset < -200 { if scrollOffset < -170 {
switch viewModel.accountState { switch viewModel.accountState {
case let .data(account): case let .data(account):
EmojiTextApp(.init(stringValue: account.safeDisplayName), emojis: account.emojis) EmojiTextApp(.init(stringValue: account.safeDisplayName), emojis: account.emojis)
@ -531,7 +531,7 @@ public struct AccountDetailView: View {
} }
} }
} label: { } label: {
if scrollOffset < -40 { if scrollOffset < -5 {
Image(systemName: "ellipsis.circle") Image(systemName: "ellipsis.circle")
} else { } else {
Image(systemName: "ellipsis.circle.fill") Image(systemName: "ellipsis.circle.fill")