different icons package

This commit is contained in:
Bradlee Speice 2023-04-22 02:23:19 +00:00
parent 2d3b9c0c3a
commit b7a6971174
5 changed files with 55 additions and 986 deletions

972
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,27 +12,22 @@
"dependencies": { "dependencies": {
"@fontsource/jetbrains-mono": "^4.5.12", "@fontsource/jetbrains-mono": "^4.5.12",
"@fontsource/lato": "^4.5.10", "@fontsource/lato": "^4.5.10",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"highlight.js": "^11.7.0", "highlight.js": "^11.7.0",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"prism-themes": "^1.9.0", "prism-themes": "^1.9.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-icons": "^4.8.0",
"rehype-highlight": "^6.0.0" "rehype-highlight": "^6.0.0"
}, },
"devDependencies": { "devDependencies": {
"@bspeice/vite-plugin-blog": "^1.1.0", "@bspeice/vite-plugin-blog": "^1.1.0",
"@mapbox/rehype-highlight-code-block": "^1.0.0",
"@mdx-js/rollup": "^2.3.0", "@mdx-js/rollup": "^2.3.0",
"@types/react": "^18.0.28", "@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11", "@types/react-dom": "^18.0.11",
"@types/remark-prism": "^1.3.4",
"@vitejs/plugin-react-swc": "^3.0.0", "@vitejs/plugin-react-swc": "^3.0.0",
"husky": "^8.0.0", "husky": "^8.0.0",
"pretty-quick": "^3.1.3", "pretty-quick": "^3.1.3",
"remark-prism": "^1.3.6",
"typescript": "^4.9.3", "typescript": "^4.9.3",
"vite": "^4.2.0" "vite": "^4.2.0"
} }

View File

@ -1,19 +1,33 @@
import { PropsWithChildren } from "react"; import { PropsWithChildren, StrictMode } from "react";
import { IconContext } from "react-icons";
import { FaHome, FaUser } from "react-icons/fa";
import "./style.css"; import "./style.css";
const Navbar: React.FC = () => ( const Navbar: React.FC = () => (
<span className="navbar"> <span className="navbar">
<a href="/">Home</a>/<a href="/about">About</a> <a href="/">
<FaHome />
Home
</a>
<span>/</span>
<a href="/about">
<FaUser />
About
</a>
</span> </span>
); );
const Layout: React.FC<PropsWithChildren> = ({ children }) => ( const Layout: React.FC<PropsWithChildren> = ({ children }) => (
<StrictMode>
<IconContext.Provider value={{ className: "icon" }}>
<div className="gridOffset"> <div className="gridOffset">
<Navbar /> <Navbar />
<hr /> <hr style={{ marginTop: "0" }} />
{children} {children}
</div> </div>
</IconContext.Provider>
</StrictMode>
); );
export default Layout; export default Layout;

View File

@ -113,16 +113,22 @@ a > code:hover {
.navbar { .navbar {
text-align: right; text-align: right;
margin: 0.5em; margin-top: 0.5em;
margin-bottom: 0.5em;
} }
.navbar * { .navbar :not(.icon) {
margin-left: 0.5em; padding-left: 0.25em;
margin-right: 0.5em; padding-right: 0.25em;
text-decoration: none; text-decoration: none;
border-bottom-style: none; border-bottom-style: none;
} }
[class*="fa-"] { .icon {
margin-right: 0.5em; vertical-align: middle;
margin-right: 0.3em;
}
.icon-post {
vertical-align: text-top;
} }

View File

@ -1,6 +1,6 @@
import { PropsWithChildren } from "react"; import { PropsWithChildren } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { IconContext } from "react-icons";
import { faCalendar } from "@fortawesome/free-regular-svg-icons"; import { FaCalendar } from "react-icons/fa";
import Base from "../pages/LayoutBase"; import Base from "../pages/LayoutBase";
@ -22,7 +22,7 @@ export default function Layout({
<h1>{title}</h1> <h1>{title}</h1>
<h3>{description}</h3> <h3>{description}</h3>
<h4> <h4>
<FontAwesomeIcon icon={faCalendar} /> <FaCalendar />
{published} {published}
</h4> </h4>
{updated && <p>Last updated: {updated}</p>} {updated && <p>Last updated: {updated}</p>}
@ -31,9 +31,13 @@ export default function Layout({
const withChildren: React.FC<PropsWithChildren> = ({ children }) => ( const withChildren: React.FC<PropsWithChildren> = ({ children }) => (
<Base> <Base>
<IconContext.Provider
value={{ className: "icon icon-post", size: "1.2em" }}
>
{header} {header}
<div style={{ paddingTop: "2em" }} /> <div style={{ paddingTop: "2em" }} />
{children} {children}
</IconContext.Provider>
</Base> </Base>
); );
return withChildren; return withChildren;