1 import { Component, OnInit, ViewChild } from '@angular/core'
2 import { Notifier, ServerService } from '@app/core'
3 import { I18n } from '@ngx-translate/i18n-polyfill'
4 import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component'
5 import { InstanceService } from '@app/shared/instance/instance.service'
6 import { MarkdownService } from '@app/shared/renderer'
9 selector: 'my-about-instance',
10 templateUrl: './about-instance.component.html',
11 styleUrls: [ './about-instance.component.scss' ]
13 export class AboutInstanceComponent implements OnInit {
14 @ViewChild('contactAdminModal') contactAdminModal: ContactAdminModalComponent
21 private notifier: Notifier,
22 private serverService: ServerService,
23 private instanceService: InstanceService,
24 private markdownService: MarkdownService,
29 return this.serverService.getConfig().instance.name
32 get isContactFormEnabled () {
33 return this.serverService.getConfig().email.enabled && this.serverService.getConfig().contactForm.enabled
37 return this.serverService.getConfig().instance.isNSFW
41 this.instanceService.getAbout()
44 this.shortDescription = res.instance.shortDescription
46 this.descriptionHTML = await this.markdownService.textMarkdownToHTML(res.instance.description)
47 this.termsHTML = await this.markdownService.textMarkdownToHTML(res.instance.terms)
50 () => this.notifier.error(this.i18n('Cannot get about information from server'))
55 return this.contactAdminModal.show()