-
Notifications
You must be signed in to change notification settings - Fork 2k
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
OFFLINE: Gravatar fallback for offline #2858
Conversation
let avatarURL = this._getResizedImageURL( safeImageURL( this.props.user.avatar_URL ) ); | ||
|
||
if ( this.state.failedToLoad ) { | ||
avatarURL = 'calypso/images/me/gravatar.png'; |
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.
need a leading slash here.
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.
done
I was mostly targeting app and broken whole gravatar infrastructure. |
@mattmiklic should we take this chance to revisit the default avatar we show in Calypso if we are serving an image ourselves? At least maybe we could adjust the neutral grey? |
Yes! I just put together a new default gravatar image for the iOS app, using the user Gridicon. I'll export a version for Calypso. |
Here's a direct export in SVG format. If it needs to be resized or in a different format or anything, let me know. (Zipped because GitHub doesn't allow SVGs in comments) |
I'd note that offline we can just drop the avatar and leave just the icon, since that's already a normal behaviour on native apps (showing only the icon). I feel would be a better choice for the masterbar. :) In other instances of the gravatar tho, we can use a custom offline gravatar alternative. :) In terms of masterbar specific behaviour it should show the Me icon until an images is loaded, and show it only once it gets loaded. :) |
Currently we are showing blinking placeholder unil icon is loaded. |
Definitely, if the gravatar in the Me link in the masterbar fell back to gridicons-user-circle when the user doesn't have a gravatar, that'd be the best-looking option. |
@mtias , @adambbecker , do you agree? You were unhappy with the design of this icon |
@artpi: 👍 |
Now offline gravatar looks like this: I think this is the cleanest approach, addresses @rralian , @mattmiklic , @folletto 's and @mtias 's concerns ( I hope ) |
For me that's ideal. 👍 |
Is it because a border is being drawn around the gravatar image in CSS, maybe? |
@artpi I don't remember this :)
Indeed. We should remove it. |
My bad :) |
👍 |
OFFLINE: Gravatar fallback for offline OFFLINE: gravatar fallback: add leading slash OFFLINE gravatar: ternary fallback OFFLINE gravatar fallback: change to default icon
72bea9a
to
6b1f1a3
Compare
OFFLINE: Gravatar fallback for offline
We always load gravatars from CDN and they are not cached for some reason
Also, gravatar does not support CORS so any caching attempts with serviceWorkers have failed.
This is the most straightforward approach to add a gravatar fallback for both APP and WEB.
I'm just hooking into onError event.
@rralian @mtias @johngodley @gziolo