diff --git a/src/app/glossary/page.js b/src/app/glossary/page.js index 76a32aab..a56f02cb 100644 --- a/src/app/glossary/page.js +++ b/src/app/glossary/page.js @@ -4,5 +4,5 @@ import seo from "@/data/glossary/seo"; export const metadata = meta(seo); export default async function Glossary({ children }) { - return children; + return children; } diff --git a/src/components/Accordion/GlossaryAccordion.js b/src/components/Accordion/GlossaryAccordion.js index b9a7f663..defb7bf8 100644 --- a/src/components/Accordion/GlossaryAccordion.js +++ b/src/components/Accordion/GlossaryAccordion.js @@ -12,6 +12,7 @@ import PrimaryButton from "@/macros/Buttons/PrimaryButton"; import { usePathname } from "next/navigation"; import Markdown from "markdown-to-jsx"; import RichText from "@/macros/Copy/RichText"; +import CopyButton from "@/macros/Buttons/CopyButton"; const GlossaryDirectory = ({ glossaryData }) => { const router = useRouter(); @@ -69,6 +70,11 @@ const GlossaryDirectory = ({ glossaryData }) => { } }, [pathname]); + const getTermUrl = (slug) => { + if (typeof window === "undefined") return ""; + return `${window.location.origin}/glossary/${slug}`; + }; + return ( @@ -129,9 +135,16 @@ const GlossaryDirectory = ({ glossaryData }) => { {groupedTerms[letter].map((term) => (
- - {term.title} - +
+ + {term.title} + + +
{term.content || term.description} diff --git a/src/macros/Buttons/CopyButton.js b/src/macros/Buttons/CopyButton.js index 503eb927..854f142a 100644 --- a/src/macros/Buttons/CopyButton.js +++ b/src/macros/Buttons/CopyButton.js @@ -4,48 +4,38 @@ import Icon from "@/macros/Icons/Icon"; import CopySVG from "@/macros/SVGs/CopySVG"; import { motion, AnimatePresence } from "framer-motion"; -const CopyButton = ({ copy, hover = true }) => { - const [copied, setCopied] = useState(false); +const CopyButton = ({ copy, hover = true, className }) => { + const [copied, setCopied] = useState(false); - const handleCopy = () => { - navigator.clipboard.writeText(copy).then(() => { - setCopied(true); - setTimeout(() => { - setCopied(false); - }, 1500); // Tooltip disappears after 2 seconds - }); - }; + const handleCopy = () => { + navigator.clipboard.writeText(copy).then(() => { + setCopied(true); + setTimeout(() => { + setCopied(false); + }, 1500); // Tooltip disappears after 2 seconds + }); + }; - return ( -
- - - {copied && ( - - Copied - - )} - -
- ); + return ( +
+ + + {copied && ( + + Copied + + )} + +
+ ); }; export default CopyButton; diff --git a/src/macros/Copy/Heading.js b/src/macros/Copy/Heading.js index 053b4825..50a58371 100644 --- a/src/macros/Copy/Heading.js +++ b/src/macros/Copy/Heading.js @@ -1,23 +1,17 @@ -const Heading = ({ - children, - className, - tag = "h1", - size = "lg", - ...props -}) => { - const Tag = tag; - const sizeClasses = { - xs: "", - sm: "text-xl leading-[1.4] lg:text-2xl lg:leading-[1.333333333333333]", - md: "text-[1.75rem] leading-[1.2] lg:text-[2rem] lg:leading-tight", - lg: "text-4xl leading-[1.2] lg:text-[2.5rem] lg:leading-tight", - }; +const Heading = ({ children, className, tag = "h1", size = "lg", ...props }) => { + const Tag = tag; + const sizeClasses = { + xs: "", + sm: "text-xl leading-[1.4] lg:text-2xl lg:leading-[1.333333333333333]", + md: "text-[1.75rem] leading-[1.2] lg:text-[2rem] lg:leading-tight", + lg: "text-4xl leading-[1.2] lg:text-[2.5rem] lg:leading-tight", + }; - return ( - - {children} - - ); + return ( + + {children} + + ); }; export default Heading;