Refactor body into multiple files
This commit is contained in:
parent
36db4c2c0c
commit
a513e3786c
10 changed files with 168 additions and 151 deletions
32
src/Body/Links.tsx
Normal file
32
src/Body/Links.tsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
import CV from "../assets/cv.svg?react";
|
||||
import Git from "../assets/git.svg?react";
|
||||
import LinkedIn from "../assets/linkedin.svg?react";
|
||||
import Mastodon from "../assets/mastodon.svg?react";
|
||||
import DarkModeToggleIcon from "../assets/darkmodetoggle.svg?react";
|
||||
|
||||
type ImageLinkProps = {
|
||||
href: string;
|
||||
title: string;
|
||||
Image: typeof Git; // Not ideal, but I can't figure out how to import the type directly from the declared wildcard module
|
||||
};
|
||||
|
||||
const ImageLink = ({ href, title, Image }: ImageLinkProps) => (
|
||||
<a rel="me" href={href} title={title}>
|
||||
<Image width="100%" />
|
||||
</a>
|
||||
);
|
||||
|
||||
const Links = () => (
|
||||
<div className="links">
|
||||
<ImageLink href="https://git.mmbradley.ca/MichaelBradley/" title="Forgejo instance" Image={Git} />
|
||||
<ImageLink href="https://www.linkedin.com/in/michaelmbradley/" title="LinkedIn account" Image={LinkedIn} />
|
||||
<ImageLink href="https://mmbradley.ca/resume.pdf" title="My Résumé" Image={CV} />
|
||||
<ImageLink href="https://mstdn.ca/@michaelbradley/" title="Mastodon account" Image={Mastodon} />
|
||||
<input id="dark-mode-toggle" type="checkbox" aria-label="Toggle dark mode" />
|
||||
<label htmlFor="dark-mode-toggle" id="dark-mode-toggle-label" title="Toggle dark mode">
|
||||
<DarkModeToggleIcon width="100%" />
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Links;
|
Loading…
Add table
Add a link
Reference in a new issue