From 537e00fdf84bea47e304f5933ddb52f331611cce Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 29 Sep 2025 15:48:35 -0400 Subject: [PATCH] Update footer and add tracking --- docusaurus.config.js | 144 +++++++++++----------------- src/constants/ga-events.ts | 2 + src/theme/Footer/LinkItem/index.tsx | 36 +++++++ 3 files changed, 92 insertions(+), 90 deletions(-) create mode 100644 src/theme/Footer/LinkItem/index.tsx diff --git a/docusaurus.config.js b/docusaurus.config.js index 1926343f95..a732537b4e 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -314,164 +314,128 @@ const config = { style: 'dark', links: [ { - title: 'Documentation', + title: 'Flow', items: [ { - label: 'Getting Started', - to: '/blockchain-development-tutorials/cadence/getting-started/smart-contract-interaction', + label: 'Build with AI', + to: '/blockchain-development-tutorials/use-AI-to-build-on-flow', }, { - label: "Tools & SDKs", - to: '/build/tools', - }, - { - to: 'https://cadence-lang.org/docs/', - label: 'Cadence', - }, - { - to: '/blockchain-development-tutorials/cadence/mobile', - label: 'Mobile', - }, - { - to: '/build/tools/clients/fcl-js/', - label: 'FCL', - }, - { - to: '/build/cadence/smart-contracts/testing', - label: 'Testing', - }, - { - to: '/build/tools/flow-cli/', - label: 'CLI', + label: 'Why Flow', + to: '/blockchain-development-tutorials/flow-101', }, { - to: '/build/tools/emulator/', - label: 'Emulator', + label: 'Tools', + to: '/build/tools', }, { - href: 'https://github.com/onflow/fcl-dev-wallet', - label: 'Dev Wallet', + label: 'Faucet', + to: '/ecosystem/faucets', }, { - to: '/build/tools/vscode-extension/', - label: 'VS Code Extension', + label: 'Builder Toolkit', + to: '/ecosystem/developer-support-hub', }, ], }, { - title: 'Community', + title: 'Cadence', items: [ { - to: '/ecosystem', - label: 'Ecosystem', - }, - { - href: 'https://port.flow.com/', - label: 'Flow Port', - }, - { - href: 'https://github.com/onflow/developer-grants', - label: 'Developer Grants', + label: 'Quickstart', + to: '/blockchain-development-tutorials/cadence/getting-started', }, { - href: 'https://flow.com/flow-responsible-disclosure', - label: 'Responsible Disclosure', + label: 'Build with Forte', + to: '/blockchain-development-tutorials/forte', }, { - href: 'https://www.flowverse.co/', - label: 'Flowverse', + label: 'Cadence Advantages', + to: '/blockchain-development-tutorials/cadence/cadence-advantages', }, { - href: 'https://academy.ecdao.org/', - label: 'Emerald Academy', + label: 'React SDK', + to: '/build/tools/react-sdk', }, { - href: 'https://floats.city/', - label: 'FLOATs (Attendance NFTs)', - }, + label: 'Language Reference', + href: 'https://cadence-lang.org/', + } ], }, { - title: 'Start Building', + title: 'Solidity (EVM)', items: [ { - href: 'https://play.flow.com/', - label: 'Flow Playground', - }, - { - to: 'https://cadence-lang.org/docs/tutorial/first-steps', - label: 'Cadence Tutorials', + label: 'Quickstart', + to: '/build/evm/quickstart', }, { - href: 'https://cookbook.flow.com', - label: 'Cadence Cookbook', + label: 'Native VRF', + to: '/blockchain-development-tutorials/native-vrf', }, { - to: '/build/cadence/core-contracts/', - label: 'Core Contracts & Standards', + label: 'Batched Transactions', + to: '/blockchain-development-tutorials/cross-vm-apps', }, { - href: '/build/evm/quickstart', - label: 'EVM', - }, + label: 'Network Information', + href: '/build/evm/networks', + } ], }, { - title: 'Network', + title: 'Community & Support', items: [ { - href: 'https://status.flow.com/', - label: 'Network Status', + label: 'Dev Office Hours', + href: 'https://calendar.google.com/calendar/u/0/embed?src=c_47978f5cd9da636cadc6b8473102b5092c1a865dd010558393ecb7f9fd0c9ad0@group.calendar.google.com', }, { - href: 'https://flowscan.io/', - label: 'Flowscan Mainnet', + label: 'Hackathons and Events', + to: '/ecosystem/Hackathons%20and%20Events', }, { - href: 'https://testnet.flowscan.io/', - label: 'Flowscan Testnet', - }, - { - to: '/protocol/node-ops/node-operation/past-upgrades', - label: 'Past Sporks', + href: 'https://discord.gg/flow', + label: 'Discord', }, { - to: '/protocol/node-ops', - label: 'Node Operation', + href: 'https://github.com/onflow', + label: 'GitHub', }, { - to: '/protocol/node-ops/node-operation/network-upgrade', - label: 'Spork Information', + href: 'https://flow.com/careers', + label: 'Careers', }, ], }, { - title: 'More', + title: 'Network & Resources', items: [ { - href: 'https://github.com/onflow', - label: 'GitHub', + href: 'https://status.flow.com/', + label: 'Network Status', }, { - href: 'https://discord.gg/flow', - label: 'Discord', + href: 'https://flowscan.io/', + label: 'Block Explorer', }, { - href: 'https://forum.flow.com/', - label: 'Forum', + href: 'https://port.flow.com/', + label: 'Flow Port', }, { href: 'https://flow.com/', - label: 'Flow', + label: 'Flow Website', }, { href: 'https://flow.com/blog', - label: 'Blog', + label: 'Flow Blog', }, ], }, ], - copyright: `Copyright © ${new Date().getFullYear()} Flow, Inc. Built with Docusaurus.`, + copyright: `Copyright © ${new Date().getFullYear()} Flow Foundation. All Rights Reserved.`, }, prism: { theme: lightCodeTheme, diff --git a/src/constants/ga-events.ts b/src/constants/ga-events.ts index 385823e464..7e3addef04 100644 --- a/src/constants/ga-events.ts +++ b/src/constants/ga-events.ts @@ -6,6 +6,7 @@ export const GA_EVENTS = { SEARCH_CLICK: 'search_click', FEEDBACK_CLICK: 'feedback_click', AUTH_LOGIN: 'login', + FOOTER_CLICK: 'footer_click', } as const; // Event categories for consistent tracking - Using existing categories @@ -15,6 +16,7 @@ export const GA_CATEGORIES = { SEARCH: 'search', FEEDBACK: 'feedback', AUTH: 'auth', + FOOTER: 'footer', } as const; // Event actions for consistent tracking - Using existing actions diff --git a/src/theme/Footer/LinkItem/index.tsx b/src/theme/Footer/LinkItem/index.tsx new file mode 100644 index 0000000000..e39b93a38c --- /dev/null +++ b/src/theme/Footer/LinkItem/index.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import LinkItem from '@theme-original/Footer/LinkItem'; +import type {WrapperProps} from '@docusaurus/types'; +import { event } from '@site/src/utils/gtags.client'; +import { GA_EVENTS, GA_CATEGORIES } from '@site/src/constants/ga-events'; + +type Props = WrapperProps; + +export default function LinkItemWrapper(props: Props): JSX.Element { + const handleClick = (e: React.MouseEvent) => { + // Extract meaningful label from props + const label = props.label || props.href || 'unknown-footer-item'; + + // Check if we're on the homepage + const isHomepage = typeof window !== 'undefined' && window.location.pathname === '/'; + + // Track the footer link click with appropriate event based on page + event({ + action: isHomepage ? GA_EVENTS.ACTION_CARD_CLICK : GA_EVENTS.FOOTER_CLICK, + category: GA_CATEGORIES.FOOTER, + label: label, + location: true, + }); + + // Call original onClick if it exists + if (props.onClick) { + props.onClick(e); + } + }; + + return ( + <> + + + ); +}