mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
added Footer
component
This commit is contained in:
parent
54242ada92
commit
f25a5a9541
29
packages/app/src/components/Footer/index.jsx
Normal file
29
packages/app/src/components/Footer/index.jsx
Normal 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>
|
||||||
|
}
|
9
packages/app/src/components/Footer/index.less
Normal file
9
packages/app/src/components/Footer/index.less
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
font-family: "DM Mono", monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 200;
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import * as Layout from "./Layout"
|
import * as Layout from "./Layout"
|
||||||
|
export { default as Footer } from "./Footer"
|
||||||
|
|
||||||
// COMPLEX COMPONENTS
|
// COMPLEX COMPONENTS
|
||||||
export { default as FormGenerator } from "./FormGenerator"
|
export { default as FormGenerator } from "./FormGenerator"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user