Skip to content

Commit

Permalink
🌺 Lens and Hey v3: v38 (#lens-v3)
Browse files Browse the repository at this point in the history
Summary: Removed Lens v3 integration and related components.

Highlights:

• Deleted `WrapWmatic.tsx` and removed WMATIC token from `seedTokens.ts`.
• Removed `Signup` components and routes from the `Staff` section.
• Simplified `Delete.tsx` by removing contract interactions and error handling.

Read more: https://pierre.co/hey/hey/lens-v3
  • Loading branch information
Yoginth authored and Pierre committed Dec 6, 2024
1 parent 772ed18 commit 93dd7c3
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 378 deletions.
42 changes: 5 additions & 37 deletions apps/web/src/components/Settings/Danger/Delete.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import SingleAccount from "@components/Shared/SingleAccount";
import errorToast from "@helpers/errorToast";
import { TrashIcon } from "@heroicons/react/24/outline";
import { LensHub } from "@hey/abis";
import { APP_NAME, LENS_HUB } from "@hey/data/constants";
import { APP_NAME } from "@hey/data/constants";
import { Errors } from "@hey/data/errors";
import type { Account } from "@hey/indexer";
import {
Expand All @@ -19,52 +17,22 @@ import { useState } from "react";
import toast from "react-hot-toast";
import useHandleWrongNetwork from "src/hooks/useHandleWrongNetwork";
import { useAccountStore } from "src/store/persisted/useAccountStore";
import { signOut } from "src/store/persisted/useAuthStore";
import { useDisconnect, useWriteContract } from "wagmi";

const DeleteSettings: FC = () => {
const { currentAccount } = useAccountStore();
const [showWarningModal, setShowWarningModal] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const { disconnect } = useDisconnect();
const handleWrongNetwork = useHandleWrongNetwork();

const onCompleted = () => {
signOut();
disconnect?.();
location.href = "/";
};

const onError = (error: any) => {
setIsLoading(false);
errorToast(error);
};

const { writeContractAsync } = useWriteContract({
mutation: { onSuccess: onCompleted }
});

const write = async ({ args }: { args: any[] }) => {
return await writeContractAsync({
abi: LensHub,
address: LENS_HUB,
args,
functionName: "burn"
});
};

const handleDelete = async () => {
if (!currentAccount) {
return toast.error(Errors.SignWallet);
}

try {
setIsLoading(true);
await handleWrongNetwork();
return await write({ args: [currentAccount?.address] });
} catch (error) {
onError(error);
}
setIsLoading(true);
await handleWrongNetwork();
setIsLoading(false);
return toast.success("Feature not implemented yet");
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import getUniswapURL from "@hey/helpers/getUniswapURL";
import type { Amount } from "@hey/indexer";
import Link from "next/link";
import type { FC, ReactNode } from "react";
import WrapWmatic from "./WrapWmatic";

interface NoBalanceErrorProps {
errorMessage?: ReactNode;
Expand All @@ -18,12 +17,6 @@ const NoBalanceError: FC<NoBalanceErrorProps> = ({
const currency = moduleAmount?.asset?.symbol;
const assetAddress = moduleAmount?.asset?.contract.address;

if (currency === "WMATIC") {
return (
<WrapWmatic errorMessage={errorMessage} moduleAmount={moduleAmount} />
);
}

return (
<div className="space-y-1">
<div className="text-sm">
Expand Down
97 changes: 0 additions & 97 deletions apps/web/src/components/Shared/NoBalanceError/WrapWmatic.tsx

This file was deleted.

8 changes: 1 addition & 7 deletions apps/web/src/components/Staff/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
ChartBarIcon,
ClipboardIcon,
CurrencyDollarIcon,
UserIcon,
UserPlusIcon
UserIcon
} from "@heroicons/react/24/outline";
import type { FC } from "react";

Expand Down Expand Up @@ -39,11 +38,6 @@ const sidebarItems = [
icon: <AdjustmentsHorizontalIcon className="size-4" />,
title: "Permissions",
url: "/staff/permissions"
},
{
icon: <UserPlusIcon className="size-4" />,
title: "Signup",
url: "/staff/signup"
}
];

Expand Down
8 changes: 0 additions & 8 deletions apps/web/src/components/Staff/Signup/AccountsCreated.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions apps/web/src/components/Staff/Signup/LensCredits.tsx

This file was deleted.

83 changes: 0 additions & 83 deletions apps/web/src/components/Staff/Signup/Mint.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions apps/web/src/components/Staff/Signup/NftsMinted.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions apps/web/src/components/Staff/Signup/SignupPrice.tsx

This file was deleted.

Loading

0 comments on commit 93dd7c3

Please sign in to comment.