Extract non-data and update description
This commit is contained in:
parent
0c8abbabbd
commit
d8686dbfa8
3 changed files with 33 additions and 24 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { createElement } from '../../helper/create-element';
|
||||
import { html } from '../../types/html';
|
||||
import { ResponsiveImage } from '../../types/responsive-image';
|
||||
import { Image } from '../basics/image/image.html';
|
||||
import { PageElement } from '../page-element';
|
||||
import { generate } from './header.html';
|
||||
import { PageThemeSwitcher } from './theme-switcher/theme-switcher';
|
||||
|
|
@ -7,14 +8,28 @@ import { PageThemeSwitcher } from './theme-switcher/theme-switcher';
|
|||
export class PageHeader extends PageElement {
|
||||
public constructor({
|
||||
name,
|
||||
photo,
|
||||
imageWebP,
|
||||
imageAltText,
|
||||
about,
|
||||
}: {
|
||||
name: string;
|
||||
photo: html;
|
||||
imageWebP: ResponsiveImage;
|
||||
imageAltText: string;
|
||||
about: Array<string>;
|
||||
}) {
|
||||
super(createElement(generate({ name, about, photo })));
|
||||
super(
|
||||
createElement(
|
||||
generate({
|
||||
name,
|
||||
about,
|
||||
photo: Image({
|
||||
imageWebP,
|
||||
alt: imageAltText,
|
||||
imageScreenRatio: 0.2,
|
||||
}),
|
||||
})
|
||||
)
|
||||
);
|
||||
this.attachElement(new PageThemeSwitcher());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue