Skip to content

Instantly share code, notes, and snippets.

@longfellowone
Last active May 6, 2022 17:12
Show Gist options
  • Save longfellowone/123ecc6dd50cd76549c6c34c1265890e to your computer and use it in GitHub Desktop.
Save longfellowone/123ecc6dd50cd76549c6c34c1265890e to your computer and use it in GitHub Desktop.
// _app.tsx
import "../styles/globals.css";
import type { AppProps } from "next/app";
import { useEffect } from "react";
import * as Fathom from "fathom-client";
import { useRouter } from "next/router";
function MyApp({ Component, pageProps }: AppProps) {
const router = useRouter();
useEffect(() => {
Fathom.load("GVNCBXVU", {
url: "https://type-beach.grandwallelectric.ca/script.js",
includedDomains: ["www.grandwallelectric.ca"],
});
function onRouteChangeComplete() {
Fathom.trackPageview();
}
router.events.on("routeChangeComplete", onRouteChangeComplete);
return () => {
router.events.off("routeChangeComplete", onRouteChangeComplete);
};
}, []); // eslint-disable-line
return <Component {...pageProps} />;
}
export default MyApp;
// _document.tsx
import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en" className="h-full scroll-smooth">
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
rel="stylesheet"
/>
<meta name="theme-color" content="#e5e5e5" />
</Head>
<body className="h-full bg-gray-50">
<Main />
<NextScript />
</body>
</Html>
);
}
// index.tsx
import type { NextPage } from "next";
import Head from "next/head";
import ContactUs from "../components/contact";
import Faq from "../components/faq";
import Features from "../components/features";
import Footer from "../components/footer";
import Hero from "../components/hero";
import favicon from "../public/favicon.ico";
const Home: NextPage = () => {
return (
<>
<Head>
<title>Grand Wall Electric: Squamish Electrician &#9889; Get A Free Quote</title>
<meta
name="description"
content="Experienced Squamish Electrician, Call or text for a FREE Quote at 604-389-8552 when in need of a Licensed Electrician in Squamish or Whistler."
/>
<link rel="icon" href={favicon.src} />
</Head>
<Hero />
<main>
<Features />
<Faq />
<ContactUs />
</main>
<Footer />
</>
);
};
export default Home;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment