Refactor and minor fixes
This commit is contained in:
parent
2dc9c45642
commit
fe75f9af88
31 changed files with 187 additions and 193 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
@use '../../style/mixins' as *;
|
||||
|
||||
#footer {
|
||||
footer#footer {
|
||||
text-align: center;
|
||||
|
||||
margin-top: var(--large-margin);
|
||||
width: 100%;
|
||||
|
||||
a {
|
||||
@include link;
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue