Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/CopyPageButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
PiCheckCircleLight,
PiXCircleLight,
} from "react-icons/pi";
import { track } from "~/util/zaraz";

type CopyState = "idle" | "success" | "error";

Expand All @@ -40,6 +41,9 @@ export default function CopyPageButton() {

const handleViewMarkdown = () => {
const markdownUrl = new URL("index.md", window.location.href).toString();
track("clicked copy page button", {
value: "view markdown",
});
window.open(markdownUrl, "_blank");
};

Expand All @@ -54,6 +58,9 @@ export default function CopyPageButton() {

const markdown = await response.text();
await navigator.clipboard.writeText(markdown);
track("clicked copy page button", {
value: "copy markdown",
});

setCopyState("success");
setTimeout(() => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/SubtractIPCalculator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useState } from "react";
import { excludeCidr, parseCidr } from "cidr-tools";
import { track } from "~/util/zaraz";

export default function SubtractIPCalculator({
defaults,
Expand All @@ -16,6 +17,7 @@ export default function SubtractIPCalculator({

function calculate() {
setResult(excludeCidr(base, exclude));
track("clicked calculator submit");
}

function disableButton() {
Expand Down