Skip to content

Commit

Permalink
feat: Use track colors in session item (#4847)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Aug 23, 2020
1 parent 3cd3ad6 commit 57fdbcc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<UiAccordion>
<div class="title" {{action 'hideSpeakerImage'}} role="button">
<UiAccordion class="segment p-0" style={{css background-color=@session.track.color border-color='lightgray'}}>
<div class="title p-4" {{action 'hideSpeakerImage'}} role="button" style={{css color=(text-color @session.track.color)}}>
<div class="ui">
<h3 class="ui header" id="session-id-{{@session.id}}">
<h3 class="ui header" id="session-id-{{@session.id}}" style={{css color=(text-color @session.track.color)}}>
{{@session.title}}
<div class="sub header">
<div class="sub header" style={{css color=(text-color @session.track.color) opacity=0.6}}>
{{@session.sessionType.name}}
</div>
</h3>
Expand Down Expand Up @@ -41,7 +41,7 @@
</div>
</div>
</div>
<div class="content">
<div class="content pt-0 p-4 rounded-t-none" style={{css background-color='white' border-radius='0.2rem'}}>
{{#each @session.speakers as |speaker|}}
<div class="ui divider"></div>
<img alt="speaker" class="ui tiny avatar image" src="{{if speaker.thumbnailImageUrl speaker.thumbnailImageUrl (if speaker.photoUrl speaker.photoUrl '/images/placeholders/avatar.png')}}">
Expand Down
12 changes: 4 additions & 8 deletions app/components/public/session-item.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import classic from 'ember-classic-decorator';
import { action } from '@ember/object';
import { classNames } from '@ember-decorators/component';
import Component from '@ember/component';
import Component from '@glimmer/component';

@classic
@classNames('ui', 'segment')
export default class SessionItem extends Component {
hideImage = false;

@action
hideSpeakerImage() {
this.toggleProperty('hideImage');
if (!this.session.speakers.length) {
this.set('hideImage', false);
this.hideImage = !this.hideImage;
if (!this.args.session.speakers.length) {
this.hideImage = false;
}
}
}
15 changes: 14 additions & 1 deletion app/styles/partials/utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
}

.rounded-default {
border-radius: .3rem;
border-radius: .28571429rem;
}

.rounded-none {
border-radius: 0 !important;
}

.rounded-t-none {
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
}

.rounded-r-none {
border-bottom-right-radius: 0 !important;
border-top-right-radius: 0 !important;
Expand All @@ -36,10 +41,18 @@
border-top-left-radius: 0 !important;
}

.p-0 {
padding: 0 !important;
}

.p-4 {
padding: 1rem !important;
}

.pt-0 {
padding-top: 0 !important;
}

.mt-8 {
margin-top: 2rem;
}
Expand Down

1 comment on commit 57fdbcc

@vercel
Copy link

@vercel vercel bot commented on 57fdbcc Aug 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.