Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/socialnetwork/logo/src/ |
Upload File : |
import { Tag } from 'main.core'; import 'socialnetwork.common'; export type LogoData = { type: string, id: string, } import './css/logo.css'; export class Logo { #logo: LogoData; constructor(logo: LogoData) { this.#logo = logo; } render(): HTMLElement { const iconClass = this.#getIconClass(); const iconStyle = this.#getIconStyle(); return Tag.render`<i class="${iconClass}" style="${iconStyle}"></i>`; } getClass(): string { let result = ''; if (this.#logo.type === 'icon') { if (this.#logo.id.length > 0) { result = `sonet-common-workgroup-avatar --${this.#logo.id}`; } else { result = 'ui-icon-common-user-group ui-icon'; } } return result; } #getIconStyle(): string { let result = ''; if (this.#logo.type === 'image') { result = `background-image: url('${this.#logo.id}'); background-size: cover`; } return result; } #getIconClass(): string { return this.#logo.type === 'image' ? 'sn-spaces__space-logo_img' : ''; } }