Skip to content

Commit

Permalink
refactor: use conditional classes in component
Browse files Browse the repository at this point in the history
  • Loading branch information
janivo committed Nov 1, 2024
1 parent ce629fc commit bd92249
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/elements/src/components/ino-meetup/ino-meetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export class MeetupAccordion {

render() {
return (
<div class={`ino-meetup-accordion ${this.expanded ? 'ino-meetup-accordion--expanded' : ''}`}>
<div class={{ 'ino-meetup-accordion': true, 'ino-meetup-accordion--expanded': this.expanded }}>
<div class="ino-meetup-accordion__header" onClick={() => this.toggleAccordion()}>
<button aria-expanded={this.expanded}>{this.accordionTitle}</button>
</div>
<div
class={`ino-meetup-accordion__content-wrapper ${
this.expanded ? 'ino-meetup-accordion__content-wrapper--expanded' : ''
}`}
class={{
'ino-meetup-accordion__content-wrapper': true,
'ino-meetup-accordion__content-wrapper--expanded': this.expanded,
}}
>
<div class="ino-meetup-accordion__content">
<slot />
Expand Down

0 comments on commit bd92249

Please sign in to comment.