Skip to content

fix: show globe icon for general web links #4809

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

Merged
merged 4 commits into from
Aug 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/models/social-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ export default ModelBase.extend({
// and non-null name is being sent from API, for some reason, for certain events,
// this throws an error, so we check first if name exists
// https://github.com/fossasia/open-event-frontend/issues/4777
return this.name && this.name.trim().toLowerCase();

const normalizedName = this.name?.trim().toLowerCase();
const socialPlatforms = ['facebook', 'twitter', 'github', 'youtube', 'linkedin', 'google'];
if (!socialPlatforms.includes(normalizedName)) {
return 'globe';
}
return normalizedName;
}),

isTwitter: equal('normalizedName', 'twitter'),
Expand Down