Refactor and minor fixes

This commit is contained in:
Andras Schmelczer 2022-09-21 21:57:58 +02:00
parent 2dc9c45642
commit fe75f9af88
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
31 changed files with 187 additions and 193 deletions

View file

@ -2,17 +2,27 @@ import cvIcon from '../../../static/icons/cv.svg';
import emailIcon from '../../../static/icons/email.svg';
import linkedinIcon from '../../../static/icons/linkedin.svg';
import { html } from '../../types/html';
import { FooterParameters } from './footer';
import { url } from '../../types/url';
import './footer.scss';
export const generate = ({
export const Footer = ({
title,
email,
curriculaVitae,
linkedin,
lastEditText,
lastEdit,
}: FooterParameters): html => `
}: {
title: string;
email: url;
linkedin: url;
curriculaVitae: Array<{
name: string;
url: url;
}>;
lastEditText: string;
lastEdit: Date;
}): html => `
<footer id="footer">
<h2>${title}</h2>
<ul>
@ -25,7 +35,7 @@ export const generate = ({
</li>
`
)
.join('\n')}
.join('')}
<li>
${linkedinIcon}
<a id="linkedin" target="_blank" href="${linkedin}">Find me on LinkedIn</a>

View file

@ -1,10 +1,8 @@
@use '../../style/mixins' as *;
#footer {
footer#footer {
text-align: center;
margin-top: var(--large-margin);
width: 100%;
a {
@include link;

View file

@ -1,22 +0,0 @@
import { createElement } from '../../helper/create-element';
import { url } from '../../types/url';
import { PageElement } from '../page-element';
import { generate } from './footer.html';
export interface FooterParameters {
title: string;
email: url;
linkedin: url;
curriculaVitae: Array<{
name: string;
url: url;
}>;
lastEditText: string;
lastEdit: Date;
}
export class PageFooter extends PageElement {
constructor(footer: FooterParameters) {
super(createElement(generate(footer)));
}
}