Skip to content

Commit

Permalink
Revert "captilaze the scoial icons"
Browse files Browse the repository at this point in the history
This reverts commit 0ef0786.
  • Loading branch information
Raunaksingh100 committed Oct 3, 2020
1 parent 0ef0786 commit b640134
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions app/models/social-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ export default ModelBase.extend({

event: belongsTo('event'),

capitalizeName: computed('name', function() {
normalizedName: computed('name', function() {
// Even though name is required for social links and is non-nullable
// 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

const capitalizeName = (s) => {
if (typeof s !== 'string') return ''
return s.charAt(0).toUpperCase() + s.slice(1)
const normalizedName = this.name?.trim().toLowerCase();
if (!socialPlatforms.includes(normalizedName)) {
return 'globe';
}
return normalizedName;
}),

isTwitter : equal('capitalizeName', 'twitter'),
isCustom : computed('capitalizeName', function() {
return !socialPlatforms.includes(this.capitalizeName);
isTwitter : equal('normalizedName', 'twitter'),
isCustom : computed('normalizedName', function() {
return !socialPlatforms.includes(this.normalizedName);
}),

segmentedLink: computedSegmentedLink.bind(this)('link')
Expand Down
4 changes: 4 additions & 0 deletions app/styles/pages/public-event.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@
.event-map > iframe.g-map {
height: 300px;
}

div#ember284 a {
text-transform: capitalize;
}
2 changes: 1 addition & 1 deletion app/templates/components/public/social-links.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{/if}}
{{#each this.socialLinks as |socialLink|}}
<div class="item">
<i class="fitted {{socialLink.capitalizeName}} disabled icon"></i>
<i class="fitted {{socialLink.normalizedName}} disabled icon"></i>
<div class="content">
<a href="{{socialLink.link}}" target="_blank" rel="noopener nofollow">{{socialLink.name}}</a>
</div>
Expand Down

0 comments on commit b640134

Please sign in to comment.