-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatar picker empty views #338
Conversation
I'll wait for #337 to be merged first. We'll have some conflicts otherwise. |
# Conflicts: # Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerView.swift
imagePicker { | ||
CTAButtonView("Upload image") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button now is scrolling out of view together with the grid.
I guess we don't have a good definition on the design of how the elements should scroll, so probably no need to be too strict about this right now.
I'd say for example that the avatar card shouldn't scroll out either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revert this change. Not directly related with this PR anyway.
private func contentLoadingErrorView( | ||
title: String, | ||
subtext: String, | ||
image: Image?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image could default to nil
to avoid sending nil from the init call.
image: Image("setup-avatar-emoji", bundle: .module), actionButton: { | ||
imagePicker { | ||
CTAButtonView("Upload image") | ||
} | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actionButton:
should probably go on a new line, right? 🤔
Interesting that the swift formatter didn't catch this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
I have two questions:
I get this error message even when the token is not expired, but just wrong.
I'm not sure if we can differentiate these two scenarios, can we?
If we don't I guess is fine since this is the scenario we want to cover more carefully.
I've been trying to figure out from where the different subtitle text color come from:
Text(title)
.font(.title2)
.fontWeight(.semibold)
.foregroundColor(Color(UIColor.label))
.padding(.init(top: 0, leading: 0, bottom: .DS.Padding.half, trailing: 0))
Text(subtext)
.font(.subheadline)
Text(subtext)
doesn't specify the color, so I'd spect it to be black/white as is shown on the ContentLoadingErrorView
preview. But it's grey on the AvatarPickerView
preview and runtime 🤔
I'm very curious 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code change proposals won't need a new review (feel free to change or keep what you think is best)
And the questions are not blocking, so I'd say let's merge when ready 👍
It depends on the backend but usually we get 401 on both cases. We should still test these in real life once Gravatar OAUTH is ready. |
Okay, let's keep it this way for now 👍 |
Interesting inconsistency. Should be solved when I set the color explicitly. I just forgot to do that. |
Closes #
Description
Adds the subviews inside the borders to handle empty avatar state and the error state.
Testing Steps