added Footer component

This commit is contained in:
srgooglo 2022-09-07 15:17:12 +02:00
parent 54242ada92
commit f25a5a9541
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import React from "react"
import config from "config"
import "./index.less"
export default (props) => {
const renderLinks = () => {
return config.footerLinks.map((link, index) => {
let linkProps = {
key: index,
}
if (link.url) {
linkProps.href = link.url
}
if (link.location) {
linkProps.onClick = () => {
app.setLocation(link.location)
}
}
return <>| <a {...linkProps}>{link.label}</a> {index === config.footerLinks.length - 1 ? "|" : ""} </>
})
}
return <div className="footer">
{config.app.siteName} - {config.author} {config.footerLinks ? renderLinks() : null}
</div>
}

View File

@ -0,0 +1,9 @@
.footer {
position: fixed;
bottom: 0;
padding: 10px;
font-family: "DM Mono", monospace;
font-size: 12px;
font-weight: 200;
}

View File

@ -1,4 +1,5 @@
import * as Layout from "./Layout"
export { default as Footer } from "./Footer"
// COMPLEX COMPONENTS
export { default as FormGenerator } from "./FormGenerator"