Skip to content
Snippets Groups Projects
menu-language-item.tsx 818 B
Newer Older
  • Learn to ignore specific revisions
  • import {Component, h, Prop, Host} from '@stencil/core';
    
    @Component({
      tag: 'hy-menu-language-item',
      styleUrl: 'menu-language-item.scss',
    
    })
    export class SiteLanguage {
      @Prop() abbr: string;
      @Prop() isActive: boolean = false;
      @Prop() isMobile: boolean = false;
    
      @Prop() label: string;
      @Prop() langCode: string;
      @Prop() url: string;
    
    
      render() {
        return (
          <Host
            class={{
              'is-active': this.isActive,
    
              'hy-menu-language-item': true,
    
            }}
          >
            <a
              href={this.url}
              class={{
                'is-active': this.isActive,
    
              }}
            >
              <span class={'hy-menu-language-item__label'}>{this.isMobile ? this.abbr : this.label}</span>
            </a>
          </Host>
        );
      }
    }