···11import { micromark } from "micromark";
22-import type Music from "@/types/Music";
33-import type { MusicType } from "@/types/Music";
22+import type Music from "@/types/MusicItem";
33+import type { MusicType } from "@/types/MusicItem";
4455interface MusicItemProps {
66 musicItem: Music;
+5-4
components/NavBar.tsx
···11+"use client";
12import Link from "next/link";
22-import { useRouter } from "next/compat/router";
33+import { usePathname } from "next/navigation";
3445// Unused. Found that I can just use "." as shorthand for going up one URL level... 🤦
56// function getUpURL() {
···5859}
59606061export default function NavBar({ className }: NavBarProps): React.ReactElement {
6161- const router = useRouter();
6262+ const pathname = usePathname();
62636363- if (router) {
6464- var breadcrumbs = router.asPath.split("/");
6464+ if (pathname) {
6565+ var breadcrumbs = pathname.split("/");
6566 breadcrumbs = breadcrumbs.slice(1, breadcrumbs.length - 1);
6667 }
6768
+2-2
components/ProjectContent.tsx
···11import { micromark } from "micromark";
22import Button from "./Button";
33-import type Project from "@/types/Project";
33+import type ProjectType from "@/types/ProjectType";
4455export default function ProjectContent({ project }): React.ReactElement {
66 const {
···1212 markdown,
1313 link,
1414 githubLink,
1515- } = project as Project;
1515+ } = project as ProjectType;
16161717 const formattedDate = new Date(date).toLocaleDateString("en-US", {
1818 month: "long",
+3-3
components/ProjectSectionItem.tsx
···11import Link from "next/link";
22-import type Project from "@/types/Project";
22+import type ProjectType from "@/types/ProjectType";
3344interface ProjectSectionItemProps {
55- project: Project;
55+ project: ProjectType;
66}
7788export default function ProjectSectionItem({
99 project,
1010}: ProjectSectionItemProps): React.ReactElement {
1111 const { title, description, previewImage, date, emoji, slug } =
1212- project as Project;
1212+ project as ProjectType;
13131414 const dateObj = new Date(date);
1515
+3-3
components/RecipeContent.tsx
···11import { micromark } from "micromark";
22-import type Recipe from "@/types/Recipe";
22+import type RecipeType from "@/types/RecipeType";
3344interface RecipeContentProps {
55- recipe: Recipe;
55+ recipe: RecipeType;
66}
7788export default function RecipeContent({
···1818 totalTime,
1919 ingredients,
2020 content,
2121- } = recipe as Recipe;
2121+ } = recipe as RecipeType;
22222323 const dateObj = new Date(date);
2424 return (
···11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
33-/// <reference types="next/navigation-types/compat/navigation" />
4354// NOTE: This file should not be edited
65// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
-46
pages/_app.tsx
···11-import "@/styles/globals.css";
22-import { useEffect } from "react";
33-import { useRouter } from "next/compat/router";
44-import posthog from "posthog-js";
55-import { PostHogProvider } from "posthog-js/react";
66-77-// if (typeof window !== "undefined") {
88-// // checks that we are client-side
99-// posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
1010-// api_host:
1111-// process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://us.i.posthog.com",
1212-// person_profiles: "identified_only", // or 'always' to create profiles for anonymous users as well
1313-// loaded: (posthog) => {
1414-// if (process.env.NODE_ENV === "development") posthog.debug(); // debug mode in development
1515-// },
1616-// });
1717-// }
1818-1919-export default function MyApp({ Component, pageProps }): React.ReactElement {
2020- useEffect(() => {
2121- posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY || "undefined", {
2222- api_host:
2323- process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://us.i.posthog.com",
2424- // person_profiles: "identified_only", // or 'always' to create profiles for anonymous users as well
2525- loaded: (posthog) => {
2626- if (process.env.NODE_ENV === "development") posthog.debug(); // debug mode in development
2727- },
2828- });
2929-3030- const router = useRouter();
3131-3232- const handleRouteChange = () => posthog?.capture("$pageview");
3333-3434- router.events.on("routeChangeComplete", handleRouteChange);
3535-3636- return () => {
3737- router.events.off("routeChangeComplete", handleRouteChange);
3838- };
3939- }, []);
4040-4141- return (
4242- <PostHogProvider client={posthog}>
4343- <Component {...pageProps} />
4444- </PostHogProvider>
4545- );
4646-}
···8383 <a href="mailto:bailey.orion.kane@gmail.com">please reach out</a>.
8484 I'd love to hear from you.
8585 </p>
8686- {/* <p>
8787- In 2023 I joined{" "}
8888- <a href="https://utilityapi.com/" target="_blank">
8989- UtilityAPI
9090- </a>{" "}
9191- to help energy services companies access energy usage data and
9292- combat the most important problem of our time, climate change.
9393- protecting our climate, educating everyone for a better future,
9494- and celebrating arts and music, some of the things that make
9595- life worth living. Reach out if you have a project in mind, want
9696- to connect over shared interests or history, or just want to say
9797- hi!
9898- </p> */}
9986 </div>
100100- {/* <div className="col-span-2 sm:col-span-1 place-self-center sm:justify-self-auto">
101101- <img
102102- className="rounded-lg border border-stone-800 dark:border-stone-200 object-cover h-72 w-72 sm:w-full"
103103- src={`/img/Headshot.jpg`}
104104- />
105105- <p className="mt-1 text-center">Me, he/him.</p>
106106- </div> */}
10787 </div>
10888 </BaseLayout>
10989 );
-32
pages/api/garden.ts
···11-// pages/api/party.js - PartyKit API Route for Next.js Pages Router
22-// import { NextApiRequest, NextApiResponse } from "next";
33-// import { Server } from "partykit/server";
44-55-// const flowers = [];
66-77-// export default function handler(req: NextApiRequest, res: NextApiResponse) {
88-// if (req.method === "GET") {
99-// // Clean up old flowers (older than 24 hours)
1010-// const now = Date.now();
1111-// while (flowers.length && now - flowers[0].createdAt > 86400000) {
1212-// flowers.shift();
1313-// }
1414-// res.status(200).json({ flowers });
1515-// } else if (req.method === "POST") {
1616-// const newFlower = {
1717-// id: Date.now(),
1818-// createdAt: Date.now(),
1919-// color: getRandomColor(),
2020-// };
2121-// flowers.push(newFlower);
2222-// res.status(201).json(newFlower);
2323-// } else {
2424-// res.setHeader("Allow", ["GET", "POST"]);
2525-// res.status(405).end(`Method ${req.method} Not Allowed`);
2626-// }
2727-// }
2828-2929-// function getRandomColor(): string {
3030-// const colors = ["#FF69B4", "#FFD700", "#8A2BE2", "#FF4500", "#00FF7F"];
3131-// return colors[Math.floor(Math.random() * colors.length)];
3232-// }