From 2539932e16129992a2c0889b4ff527c265a8e2c7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 27 May 2021 15:59:55 +0200 Subject: Instance homepage support (#4007) * Prepare homepage parsers * Add ability to update instance hompage * Add ability to set homepage as landing page * Add homepage preview in admin * Dynamically update left menu for homepage * Inject home content in homepage * Add videos list and channel miniature custom markup * Remove unused elements in markup service --- client/src/app/+home/home.component.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 client/src/app/+home/home.component.ts (limited to 'client/src/app/+home/home.component.ts') diff --git a/client/src/app/+home/home.component.ts b/client/src/app/+home/home.component.ts new file mode 100644 index 000000000..16d3a6df7 --- /dev/null +++ b/client/src/app/+home/home.component.ts @@ -0,0 +1,26 @@ + +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' +import { CustomMarkupService } from '@app/shared/shared-custom-markup' +import { CustomPageService } from '@app/shared/shared-main/custom-page' + +@Component({ + templateUrl: './home.component.html', + styleUrls: [ './home.component.scss' ] +}) + +export class HomeComponent implements OnInit { + @ViewChild('contentWrapper') contentWrapper: ElementRef + + constructor ( + private customMarkupService: CustomMarkupService, + private customPageService: CustomPageService + ) { } + + async ngOnInit () { + this.customPageService.getInstanceHomepage() + .subscribe(async ({ content }) => { + const element = await this.customMarkupService.buildElement(content) + this.contentWrapper.nativeElement.appendChild(element) + }) + } +} -- cgit v1.2.3