add analytics + notice

This commit is contained in:
MapleLeaf
2022-01-12 13:15:09 -06:00
parent 50961e888e
commit 785384286b
5 changed files with 53 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
import { HeartIcon } from "@heroicons/react/solid"
import clsx from "clsx"
import { ExternalLink } from "~/modules/dom/external-link"
import { linkClass, maxWidthContainer } from "~/modules/ui/components"
export function AppFooter() {
return (
<footer className={clsx(maxWidthContainer, "text-xs opacity-75")}>
<address className="not-italic">
&copy; {new Date().getFullYear()} itsMapleLeaf
</address>
<p>
Coded with <HeartIcon className="inline w-4 align-sub" /> using{" "}
<ExternalLink className={linkClass} href="https://remix.run">
Remix
</ExternalLink>
</p>
<p>
Uses{" "}
<ExternalLink className={linkClass} href="https://umami.is/">
umami
</ExternalLink>{" "}
for simple, non-identifying analytics.
</p>
</footer>
)
}

View File

@@ -0,0 +1,12 @@
import type { ComponentPropsWithoutRef } from "react"
export function ExternalLink({
children,
...props
}: ComponentPropsWithoutRef<"a">) {
return (
<a target="_blank" rel="noopener noreferrer" {...props}>
{children}
</a>
)
}

View File

@@ -1,5 +1,6 @@
import type { ComponentPropsWithoutRef } from "react"
import { Link } from "remix"
import { ExternalLink } from "~/modules/dom/external-link"
export type AppLinkProps = ComponentPropsWithoutRef<"a"> & {
type: "internal" | "external" | "router"
@@ -17,9 +18,9 @@ export function AppLink({ type, to, children, ...props }: AppLinkProps) {
if (type === "external") {
return (
<a href={to} target="_blank" rel="noopener noreferrer" {...props}>
<ExternalLink href={to} {...props}>
{children}
</a>
</ExternalLink>
)
}

View File

@@ -56,6 +56,14 @@ export default function App() {
<Meta />
<Links />
<script defer src="https://unpkg.com/alpinejs@3.7.1/dist/cdn.min.js" />
{process.env.NODE_ENV === "production" && (
<script
async
defer
data-website-id="49c69ade-5593-4853-9686-c9ca9d519a18"
src="https://maple-umami.fly.dev/umami.js"
/>
)}
</head>
<body>
<GuideLinksProvider value={data.guideLinks}>

View File

@@ -1,11 +1,12 @@
import packageJson from "reacord/package.json"
import { AppFooter } from "~/modules/app/app-footer"
import LandingExample from "~/modules/landing/landing-example.mdx"
import { MainNavigation } from "~/modules/navigation/main-navigation"
import { maxWidthContainer } from "~/modules/ui/components"
export default function Landing() {
return (
<div className="flex flex-col min-w-0 min-h-screen text-center">
<div className="flex flex-col min-w-0 min-h-screen text-center pb-4">
<header className={maxWidthContainer}>
<MainNavigation />
</header>
@@ -24,6 +25,7 @@ export default function Landing() {
</a>
</main>
</div>
<AppFooter />
</div>
)
}