Convert to component based architecture

This commit is contained in:
Schmelczer András 2019-12-21 22:59:41 +01:00
parent eb2075aec5
commit cdaa423b8a
70 changed files with 1942 additions and 484 deletions

View file

@ -0,0 +1,21 @@
import { TimelineElement } from "../../model/portfolio";
import "./timeline.scss";
import { PageElement } from "../../framework/page-element";
import { createElement } from "../../framework/element-factory";
import { PageTimelineElement } from "./timeline-element/timeline-element";
export class PageTimeline extends PageElement {
public constructor(
timeline: Array<TimelineElement>,
showMore: string,
showLess: string
) {
const root = createElement(`<main id="timeline"></main>`);
const elements = timeline.map(
e => new PageTimelineElement(e, showMore, showLess)
);
root.append(...elements.map(e => e.getElement()));
super(elements);
this.setElement(root);
}
}