Skip to content

Commit

Permalink
Remove plausible analytics (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 authored Sep 2, 2024
1 parent a236aec commit eb2213a
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 29 deletions.
3 changes: 0 additions & 3 deletions apps/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
<meta property="twitter:title" content="HelixBridge Interface">
<meta property="twitter:image" content="https://helixbridge.app/preview.png">
<meta property="twitter:image:alt" content="HelixBridge Interface">

<script defer data-domain="helixbridge.app" src="https://plausible.io/js/script.hash.outbound-links.tagged-events.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
</head>
<body style="background-color: #00141d; color: white; line-height: 1.5rem; font-size: 1rem; font-weight: 400">
<div id="root"></div>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/chain-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function ChainSwitch({ placement }: { placement?: Placement }) {
return account.address ? (
<>
<button
className={`gap-small lg:bg-secondary plausible-event-name=Chain+Dropdown flex h-8 w-fit items-center justify-between rounded-xl bg-white/20 px-3 transition-colors hover:bg-white/20`}
className={`gap-small lg:bg-secondary flex h-8 w-fit items-center justify-between rounded-xl bg-white/20 px-3 transition-colors hover:bg-white/20`}
ref={refs.setReference}
{...getReferenceProps()}
>
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function ChainSwitch({ placement }: { placement?: Placement }) {
>
{chainOptions.map((option) => (
<button
className={`gap-medium px-large py-medium plausible-event-name=Chain+Switch flex items-center transition-colors hover:bg-white/5 disabled:bg-white/10 plausible-event-network=${option.network}`}
className={`gap-medium px-large py-medium flex items-center transition-colors hover:bg-white/5 disabled:bg-white/10`}
disabled={option.id === chain?.id}
key={option.id}
onClick={() => switchNetwork?.(option.id)}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/faucet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function Faucet({ sourceChain, sourceToken, onSuccess = () => und
return (
<>
<button
className="plausible-event-name=Faucet+Click rounded-full bg-white/20 px-2 py-[2px] text-xs font-semibold text-white opacity-60 transition-opacity hover:opacity-100 active:scale-95"
className="rounded-full bg-white/20 px-2 py-[2px] text-xs font-semibold text-white opacity-60 transition-opacity hover:opacity-100 active:scale-95"
onClick={() => setIsOpen(true)}
>
Faucet
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Links() {
<Link
key={item.label}
to={item.path}
className={`text-xs font-semibold text-white/50 transition hover:text-white hover:underline active:scale-95 ${item.pc ? "hidden lg:inline" : ""} plausible-event-name=Explorer+Click`}
className={`text-xs font-semibold text-white/50 transition hover:text-white hover:underline active:scale-95 ${item.pc ? "hidden lg:inline" : ""}`}
>
{item.label}
</Link>
Expand Down
11 changes: 5 additions & 6 deletions apps/web/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ interface NavigationConfig {
external?: boolean;
soon?: boolean;
disabled?: boolean;
plausibleEvent: string;
}

const navigationsConfig: NavigationConfig[] = [
{ href: "/", label: "Transfer", plausibleEvent: "Navigation+Transfer" },
{ href: "/relayer", label: "Relayer", plausibleEvent: "Navigation+Relayer" },
{ href: "/", label: "Transfer" },
{ href: "/relayer", label: "Relayer" },
];

export default function Header() {
Expand Down Expand Up @@ -48,14 +47,14 @@ export default function Header() {

{/* Navigations */}
<div className="gap-medium hidden items-center lg:flex">
{navigationsConfig.map(({ href, label, external, soon, disabled, plausibleEvent }) =>
{navigationsConfig.map(({ href, label, external, soon, disabled }) =>
external ? (
<a
rel="noopener noreferrer"
target="_blank"
href={href}
key={label}
className={`plausible-event-name=${plausibleEvent} py-small rounded-full px-3 text-sm font-bold transition-colors hover:bg-white/[0.15]`}
className={`py-small rounded-full px-3 text-sm font-bold transition-colors hover:bg-white/[0.15]`}
>
{label}
</a>
Expand All @@ -71,7 +70,7 @@ export default function Header() {
pathname === href
? "text-primary after:bg-primary after:absolute after:-bottom-[2px] after:left-1/4 after:block after:h-[3px] after:w-1/2 after:rounded-full"
: "text-white"
} plausible-event-name=${plausibleEvent}`}
}`}
>
{label}
</Link>
Expand Down
6 changes: 1 addition & 5 deletions apps/web/src/components/history/history-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Completed from "../icons/completed";
import Pending from "../icons/pending";
import { useHistoryDetails } from "../../hooks";
import ComponentLoading from "../../ui/component-loading";
import { useEffect, useMemo } from "react";
import { useMemo } from "react";

interface Props {
data: Partial<HistoryDetailsResData["historyRecordByTxHash"]>;
Expand All @@ -27,10 +27,6 @@ export default function HistoryDetails({ data: propsData }: Props) {
const targetChain = getChainConfig(data?.toChain);
const sourceToken = sourceChain?.tokens.find(({ symbol }) => symbol.toUpperCase() === data?.sendToken?.toUpperCase());

useEffect(() => {
window.plausible("History Details", { props: { status: propsData?.result } });
}, [propsData?.result]);

return (
<div className="relative overflow-x-auto pb-2">
<ComponentLoading loading={loading} color="white" className="backdrop-blur-[2px]" />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/history/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function History({ children, className }: PropsWithChildren<{ cla
return account.address ? (
<>
<button
className={`${className} plausible-event-name=History+Click`}
className={`${className}`}
onClick={(e) => {
e.stopPropagation();
setIsHistoryOpen(true);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/transfer-amount-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ export default function TransferAmountInput({
<button
className={`rounded-full bg-white/20 p-[3px] opacity-50 transition hover:opacity-100 active:scale-95 ${
loading ? "animate-spin" : ""
} plausible-event-name=Balance+Refresh`}
}`}
onClick={onRefresh}
>
<img alt="Refresh balance" width={14} height={14} src="images/refresh.svg" />
</button>
<button
className="plausible-event-name=Input+Max rounded-full bg-white/20 px-2 py-[2px] text-xs font-semibold text-white opacity-60 transition-[transform,opacity] hover:opacity-100 active:scale-95"
className="rounded-full bg-white/20 px-2 py-[2px] text-xs font-semibold text-white opacity-60 transition-[transform,opacity] hover:opacity-100 active:scale-95"
onClick={handleMaxInput}
>
Max
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/components/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ function Component() {
]);

const handleTransfer = useCallback(async () => {
window.plausible("Transfer", { props: { status: 1000 } });
const sourceChain = bridge?.getSourceChain();
const targetChain = bridge?.getTargetChain();

Expand All @@ -212,7 +211,6 @@ function Component() {
notifyTransaction(receipt, sourceChain, "Transfer");
setIsTransfering(false);
if (receipt?.status === "success") {
window.plausible("Transfer", { props: { status: 1001 } });
setAmount({ input: "", valid: true, value: 0n, alert: "" });
setHistoryDetails({
requestTxHash: receipt.transactionHash,
Expand All @@ -229,7 +227,6 @@ function Component() {
}
} catch (err) {
console.error(err);
window.plausible("Transfer", { props: { status: 1002 } });
notifyError(err);
setIsTransfering(false);
}
Expand Down Expand Up @@ -300,7 +297,7 @@ function Component() {
loadingFee={loadingFee}
/>
<Button
className={`plausible-event-name=Action+Click inline-flex h-12 items-center justify-center rounded-full plausible-event-action=${actionText.replace(/\s+/g, "")}`}
className={`inline-flex h-12 items-center justify-center rounded-full`}
kind="primary"
busy={isApproving}
disabled={disableAction || !sourceChainOptions.length}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function User({ placement, prefixLength = 10, suffixLength = 8 }:
return address ? (
<Dropdown
childClassName="bg-background py-large rounded-large border border-white/20 flex flex-col gap-large"
labelClassName={`flex items-center gap-2 rounded-xl bg-white/20 lg:bg-secondary px-large h-8 transition-colors hover:bg-white/20 plausible-event-name=User+Dropdown`}
labelClassName={`flex items-center gap-2 rounded-xl bg-white/20 lg:bg-secondary px-large h-8 transition-colors hover:bg-white/20`}
placement={placement}
label={
<div className="gap-small flex items-center">
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ export declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ethereum: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
plausible: any;
}
}
1 change: 0 additions & 1 deletion apps/web/src/routes/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default function NotFound() {
</Link>
</div>
</main>
<script>{`document.addEventListener('DOMContentLoaded', function () { plausible('404', { props: { path: document.location.pathname } }); });`}</script>
</>
);
}

0 comments on commit eb2213a

Please sign in to comment.