diff --git a/README.md b/README.md index 43291fd..f45915b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ test change + + 🤖 + # 🐔 ParmiPicks: Chicken Parmi Review Website ParmiPicks is your ultimate guide to the best chicken parmi reviews, ratings, and recommendations. Explore and discover the finest chicken parmis in town. @@ -9,6 +12,8 @@ ParmiPicks is your ultimate guide to the best chicken parmi reviews, ratings, an These instructions will help you set up the project on your local machine for development and testing purposes. +The `_docs` folder contains further documentation on the project. + ### 📋 Prerequisites Make sure you have the following installed on your system: @@ -21,19 +26,25 @@ Make sure you have the following installed on your system: Follow these steps to set up the project on your local machine: 1. Install the required dependencies: + ```bash yarn ``` + 2. Run the development server: + ```bash yarn dev ``` + Now you can open your browser and navigate to http://localhost:3000 to see the project running. ### 📚 Built With + - Next.js - The React framework used for building the website - TinaCMS - The content management system used for editing content - OpenAI API - The API used for integrating ChatGPT/GPT-4 ### 📖 License + This project is licensed under the MIT License - see the LICENSE file for details. diff --git a/_docs/HelpfulLocations.md b/_docs/HelpfulLocations.md new file mode 100644 index 0000000..6e237b4 --- /dev/null +++ b/_docs/HelpfulLocations.md @@ -0,0 +1,4 @@ +# Helpful Locations + +Icon Library - Try stick to the FA5 icons, for consistency. +https://react-icons.github.io/react-icons/icons/fa/ diff --git a/components/blocks/content.tsx b/components/blocks/content.tsx index cdbecbb..fb7bbad 100644 --- a/components/blocks/content.tsx +++ b/components/blocks/content.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Container } from "../util/container"; import { Section } from "../util/section"; import { TinaMarkdown } from "tinacms/dist/rich-text"; -import type { TinaTemplate } from "tinacms"; +import type { Template } from "tinacms"; export const Content = ({ data, parentField = "" }) => { return ( @@ -21,7 +21,7 @@ export const Content = ({ data, parentField = "" }) => { ); }; -export const contentBlockSchema: TinaTemplate = { +export const contentBlockSchema: Template = { name: "content", label: "Content", ui: { diff --git a/components/blocks/hero.tsx b/components/blocks/hero.tsx index 5cf4d0b..8ca0741 100644 --- a/components/blocks/hero.tsx +++ b/components/blocks/hero.tsx @@ -3,7 +3,7 @@ import { Actions } from "../util/actions"; import { Container } from "../util/container"; import { Section } from "../util/section"; import { TinaMarkdown } from "tinacms/dist/rich-text"; -import type { TinaTemplate } from "tinacms"; +import type { Template } from "tinacms"; export const Hero = ({ data, parentField }) => { return ( @@ -70,7 +70,7 @@ export const Hero = ({ data, parentField }) => { ); }; -export const heroBlockSchema: TinaTemplate = { +export const heroBlockSchema: Template = { name: "hero", label: "Hero", ui: { diff --git a/components/blocks/testimonial.tsx b/components/blocks/testimonial.tsx index 8185441..84ebfc9 100644 --- a/components/blocks/testimonial.tsx +++ b/components/blocks/testimonial.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Container } from "../util/container"; import { Section } from "../util/section"; -import type { TinaTemplate } from "tinacms"; +import type { Template } from "tinacms"; export const Testimonial = ({ data, parentField = "" }) => { return ( @@ -59,7 +59,7 @@ export const Testimonial = ({ data, parentField = "" }) => { ); }; -export const testimonialBlockSchema: TinaTemplate = { +export const testimonialBlockSchema: Template = { name: "testimonial", label: "Testimonial", ui: { diff --git a/components/layout/breadcrumb.tsx b/components/layout/breadcrumb.tsx new file mode 100644 index 0000000..8ff3943 --- /dev/null +++ b/components/layout/breadcrumb.tsx @@ -0,0 +1,73 @@ +// /components/NextBreadcrumb.tsx +"use client"; + +import React, { ReactNode } from "react"; + +import { usePathname } from "next/navigation"; +import Link from "next/link"; +import { FaHome } from "react-icons/fa"; + +type TBreadCrumbProps = { + homeElement: ReactNode; +}; + +const replacements: Record = { + EmbassyBarKitchen: "Embassy Bar & Kitchen", + SBBG: "South Bank Beer Garden", +}; + +function cleanUpLink(link: string) { + if (replacements[link]) { + return replacements[link]; + } else { + return link + .split("-") + .map((word) => { + if (word === "and" || word === "or" || word === "the") { + return word; + } else { + return word.charAt(0).toUpperCase() + word.slice(1); + } + }) + .join(" "); + } +} + +const NextBreadcrumb = () => { + const paths = usePathname(); + const pathNames = paths.split("/").filter((path) => path); + const separator = /; + return ( + pathNames.length > 0 && ( +
+ +
+ ) + ); +}; + +export default NextBreadcrumb; diff --git a/components/layout/header.tsx b/components/layout/header.tsx index 609be0b..e9239b1 100644 --- a/components/layout/header.tsx +++ b/components/layout/header.tsx @@ -1,29 +1,30 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import { useRouter } from "next/router"; import { Container } from "../util/container"; -import { FaBars, FaSearchLocation, FaUtensils } from "react-icons/fa"; +import { FaBars, FaSearchLocation, FaTimes, FaUtensils } from "react-icons/fa"; import Link from "next/link"; export const Header = ({ data }) => { const router = useRouter(); - // If we're on an admin path, other links should also link to their admin paths // eslint-disable-next-line @typescript-eslint/no-unused-vars const [prefix, setPrefix] = useState(""); const [expanded, setExpanded] = useState(false); - React.useEffect(() => { + useEffect(() => { if (window && window.location.pathname.startsWith("/admin")) { setPrefix("/admin"); } - }, []); + console.log("Menu expanded state changed to:", expanded); + }, [expanded]); return (