switch back to fontawesome to fix SSR

This commit is contained in:
2023-04-22 03:03:34 +00:00
parent b7a6971174
commit b2ff9535c9
6 changed files with 113 additions and 28 deletions

View File

@ -1,18 +1,18 @@
import { PropsWithChildren, StrictMode } from "react";
import { IconContext } from "react-icons";
import { FaHome, FaUser } from "react-icons/fa";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faHome, faUser } from "@fortawesome/free-solid-svg-icons";
import "./style.css";
const Navbar: React.FC = () => (
<span className="navbar">
<a href="/">
<FaHome />
<FontAwesomeIcon icon={faHome} className="icon" />
Home
</a>
<span>/</span>
<a href="/about">
<FaUser />
<FontAwesomeIcon icon={faUser} className="icon" />
About
</a>
</span>
@ -20,13 +20,11 @@ const Navbar: React.FC = () => (
const Layout: React.FC<PropsWithChildren> = ({ children }) => (
<StrictMode>
<IconContext.Provider value={{ className: "icon" }}>
<div className="gridOffset">
<Navbar />
<hr style={{ marginTop: "0" }} />
{children}
</div>
</IconContext.Provider>
<div className="gridOffset">
<Navbar />
<hr style={{ marginTop: "0" }} />
{children}
</div>
</StrictMode>
);

View File

@ -4,7 +4,9 @@ export default function () {
return (
<Layout>
<p>Is this thing on?</p>
<a href="/2019/02/the-whole-world">Code</a>
<p>
<a href="/2019/02/the-whole-world">Code</a>
</p>
</Layout>
);
}