mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-22 14:05:43 -05:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
import style from "./styles/footer.scss"
|
|
|
|
interface Options {
|
|
links: Record<string, string>
|
|
}
|
|
|
|
export default ((opts?: Options) => {
|
|
const LinksList: QuartzComponent = ({ displayClass }: QuartzComponentProps) => {
|
|
const links = opts?.links ?? []
|
|
return (
|
|
<>
|
|
<style>
|
|
{`
|
|
@media (max-width: 800px) {
|
|
.contact-header {
|
|
text-align: center;
|
|
}
|
|
.contact-list {
|
|
text-align: center;
|
|
}
|
|
}
|
|
`}
|
|
</style>
|
|
<div class={`${displayClass ?? ""}`}>
|
|
<h3 class="contact-header" style={{ margin: "0.5rem 0 0 0", fontSize: "1rem" }}>Social</h3>
|
|
<ul class="contact-list" style={{ listStyleType: "none", padding: 0, margin: "1rem 0 0 0" }}>
|
|
{Object.entries(links).map(([text, link]) => (
|
|
<li><a href={link}>{text}</a></li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
LinksList.css = style
|
|
return LinksList
|
|
}) satisfies QuartzComponentConstructor
|