From 0eda09fc309de6499b514defbcc190a75a8893c6 Mon Sep 17 00:00:00 2001 From: fran-ink <171171801+fran-ink@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:43:50 -0500 Subject: [PATCH] chore: remove many, many unused things --- package.json | 1 - pnpm-lock.yaml | 9 - src/app/[locale]/apps/_components/AppCard.tsx | 112 ---- .../[locale]/apps/_components/AppsGrid.tsx | 6 +- .../apps/_components/FeaturedAppPill.tsx | 11 - .../community/_components/LetsGetSocial.tsx | 2 +- .../_components/VerificationContent.tsx | 22 +- .../_components/SmartAccountAddress.tsx | 23 - .../verify/_components/VerifyInfoCard.tsx | 36 -- src/components/AnchorIntoView.tsx | 44 -- src/components/ArrowOnHover.tsx | 36 -- src/components/BridgeButton.tsx | 77 --- src/components/BulletCard.tsx | 41 -- src/components/Button/RoundedIconButton.tsx | 34 -- src/components/CollapsiblePopup.tsx | 32 - .../ConnectWallet/ConnectWallet.tsx | 168 ------ src/components/ConnectWallet/index.ts | 1 - src/components/Disappearing.tsx | 36 -- src/components/FaucetButton.tsx | 122 ---- .../FloatingSquares/FloatingSquares.scss | 21 - .../FloatingSquares/FloatingSquares.tsx | 76 --- src/components/FloatingSquares/index.tsx | 1 - src/components/Footer/Footer.tsx | 10 +- src/components/Header/Header.tsx | 34 -- src/components/Header/HeaderConnectWallet.tsx | 19 - src/components/Header/HeaderContent.tsx | 14 - src/components/Header/index.ts | 1 - src/components/HeroSection.tsx | 26 - .../HomeAppsToggle/HomeAppsToggle.tsx | 61 -- src/components/HorizontalLine.tsx | 5 - src/components/ImagePreloader.tsx | 18 - .../ButtonIntoInputOverlay.tsx | 104 ---- .../InputWithSubmit/InputWithSubmit.tsx | 168 ------ src/components/InputWithSubmit/index.tsx | 2 - src/components/LocaleSwitcher.tsx | 55 -- src/components/LogoLink.tsx | 63 -- src/components/MobileHeader/MobileHeader.tsx | 58 -- .../MobileHeader/MobileLogoLink.tsx | 68 --- src/components/MobileHeader/index.ts | 2 - .../MobileMenu/MobileMenuButton.tsx | 34 -- .../MobileMenu/MobileMenuContent.tsx | 44 -- .../MobileMenu/MobileMenuContext.tsx | 43 -- src/components/MobileMenu/index.ts | 1 - src/components/Modal.tsx | 41 -- src/components/NavLink.tsx | 83 --- .../NewsletterForm/NewsletterForm.tsx | 98 ---- .../NewsletterForm/NewsletterFormContext.tsx | 43 -- .../NewsletterForm/SuccessState.tsx | 43 -- src/components/Noisy/NoisyCard.tsx | 30 - src/components/Noisy/NoisyContainer.tsx | 40 -- src/components/Noisy/index.ts | 2 - src/components/PillContainer.tsx | 52 -- src/components/PillLink/PillLink.css | 9 - src/components/PillLink/PillLink.tsx | 34 -- src/components/PillLink/index.ts | 1 - src/components/Providers.tsx | 20 +- src/components/PurpleSpotlightSection.tsx | 30 - src/components/ResponsiveText.tsx | 18 - src/components/SearchBar/SearchBar.tsx | 112 ---- src/components/SpotlightSection.tsx | 82 --- .../TablePagination/TablePaginationBar.tsx | 84 --- src/components/TablePagination/index.ts | 2 - .../TablePagination/usePagination.ts | 57 -- src/components/ThemeToggle.tsx | 54 -- src/components/TwoOverlapingLayout.tsx | 41 -- src/components/WalletConnector.tsx | 7 - src/components/icons/ArrowRight.tsx | 19 - src/components/icons/ArrowTopRight.tsx | 19 - src/components/icons/Bell.tsx | 21 - src/components/icons/Burger.tsx | 16 - src/components/icons/Chain.tsx | 19 - src/components/icons/ChevronLeft.tsx | 19 - src/components/icons/ChevronRight.tsx | 19 - .../icons/CircleExclamationMark.tsx | 19 - src/components/icons/Collapse.tsx | 19 - src/components/icons/Dots.tsx | 21 - src/components/icons/DotsInCircle.tsx | 548 ------------------ src/components/icons/DoubleChevronLeft.tsx | 19 - src/components/icons/DoubleChevronRight.tsx | 19 - src/components/icons/Expand.tsx | 19 - src/components/icons/Farcaster.tsx | 27 - src/components/icons/History.tsx | 27 - src/components/icons/Icon.tsx | 18 - src/components/icons/InkIcon.tsx | 21 - src/components/icons/InkLogo.tsx | 39 -- src/components/icons/Language.tsx | 19 - src/components/icons/SquareDivider.tsx | 18 - src/components/icons/Testnet-Dark.tsx | 171 ------ src/components/icons/ThemedIcon.tsx | 31 - src/components/icons/bullets/About.tsx | 304 ---------- src/components/icons/bullets/Bridge.tsx | 114 ---- src/components/icons/bullets/Builders.tsx | 304 ---------- src/components/icons/bullets/Community.tsx | 186 ------ src/components/icons/bullets/Contact.tsx | 112 ---- src/components/icons/bullets/Docs.tsx | 122 ---- src/components/icons/bullets/Events.tsx | 146 ----- src/components/icons/bullets/Faucet.tsx | 114 ---- src/components/icons/bullets/GitHub.tsx | 124 ---- src/components/icons/bullets/Status.tsx | 124 ---- src/components/icons/bullets/Testnet.tsx | 370 ------------ src/components/icons/news/Decrypt.tsx | 43 -- src/components/styles/header.ts | 5 - src/contexts/wallet-context.ts | 31 - 103 files changed, 22 insertions(+), 5968 deletions(-) delete mode 100644 src/app/[locale]/apps/_components/AppCard.tsx delete mode 100644 src/app/[locale]/apps/_components/FeaturedAppPill.tsx delete mode 100644 src/app/[locale]/smart-wallet/_components/SmartAccountAddress.tsx delete mode 100644 src/app/[locale]/verify/_components/VerifyInfoCard.tsx delete mode 100644 src/components/AnchorIntoView.tsx delete mode 100644 src/components/ArrowOnHover.tsx delete mode 100644 src/components/BridgeButton.tsx delete mode 100644 src/components/BulletCard.tsx delete mode 100644 src/components/Button/RoundedIconButton.tsx delete mode 100644 src/components/CollapsiblePopup.tsx delete mode 100644 src/components/ConnectWallet/ConnectWallet.tsx delete mode 100644 src/components/ConnectWallet/index.ts delete mode 100644 src/components/Disappearing.tsx delete mode 100644 src/components/FaucetButton.tsx delete mode 100644 src/components/FloatingSquares/FloatingSquares.scss delete mode 100644 src/components/FloatingSquares/FloatingSquares.tsx delete mode 100644 src/components/FloatingSquares/index.tsx delete mode 100644 src/components/Header/Header.tsx delete mode 100644 src/components/Header/HeaderConnectWallet.tsx delete mode 100644 src/components/Header/HeaderContent.tsx delete mode 100644 src/components/Header/index.ts delete mode 100644 src/components/HeroSection.tsx delete mode 100644 src/components/HomeAppsToggle/HomeAppsToggle.tsx delete mode 100644 src/components/HorizontalLine.tsx delete mode 100644 src/components/ImagePreloader.tsx delete mode 100644 src/components/InputWithSubmit/ButtonIntoInputOverlay.tsx delete mode 100644 src/components/InputWithSubmit/InputWithSubmit.tsx delete mode 100644 src/components/InputWithSubmit/index.tsx delete mode 100644 src/components/LocaleSwitcher.tsx delete mode 100644 src/components/LogoLink.tsx delete mode 100644 src/components/MobileHeader/MobileHeader.tsx delete mode 100644 src/components/MobileHeader/MobileLogoLink.tsx delete mode 100644 src/components/MobileHeader/index.ts delete mode 100644 src/components/MobileMenu/MobileMenuButton.tsx delete mode 100644 src/components/MobileMenu/MobileMenuContent.tsx delete mode 100644 src/components/MobileMenu/MobileMenuContext.tsx delete mode 100644 src/components/MobileMenu/index.ts delete mode 100644 src/components/Modal.tsx delete mode 100644 src/components/NavLink.tsx delete mode 100644 src/components/NewsletterForm/NewsletterForm.tsx delete mode 100644 src/components/NewsletterForm/NewsletterFormContext.tsx delete mode 100644 src/components/NewsletterForm/SuccessState.tsx delete mode 100644 src/components/Noisy/NoisyCard.tsx delete mode 100644 src/components/Noisy/NoisyContainer.tsx delete mode 100644 src/components/Noisy/index.ts delete mode 100644 src/components/PillContainer.tsx delete mode 100644 src/components/PillLink/PillLink.css delete mode 100644 src/components/PillLink/PillLink.tsx delete mode 100644 src/components/PillLink/index.ts delete mode 100644 src/components/PurpleSpotlightSection.tsx delete mode 100644 src/components/ResponsiveText.tsx delete mode 100644 src/components/SearchBar/SearchBar.tsx delete mode 100644 src/components/SpotlightSection.tsx delete mode 100644 src/components/TablePagination/TablePaginationBar.tsx delete mode 100644 src/components/TablePagination/index.ts delete mode 100644 src/components/TablePagination/usePagination.ts delete mode 100644 src/components/ThemeToggle.tsx delete mode 100644 src/components/TwoOverlapingLayout.tsx delete mode 100644 src/components/WalletConnector.tsx delete mode 100644 src/components/icons/ArrowRight.tsx delete mode 100644 src/components/icons/ArrowTopRight.tsx delete mode 100644 src/components/icons/Bell.tsx delete mode 100644 src/components/icons/Burger.tsx delete mode 100644 src/components/icons/Chain.tsx delete mode 100644 src/components/icons/ChevronLeft.tsx delete mode 100644 src/components/icons/ChevronRight.tsx delete mode 100644 src/components/icons/CircleExclamationMark.tsx delete mode 100644 src/components/icons/Collapse.tsx delete mode 100644 src/components/icons/Dots.tsx delete mode 100644 src/components/icons/DotsInCircle.tsx delete mode 100644 src/components/icons/DoubleChevronLeft.tsx delete mode 100644 src/components/icons/DoubleChevronRight.tsx delete mode 100644 src/components/icons/Expand.tsx delete mode 100644 src/components/icons/Farcaster.tsx delete mode 100644 src/components/icons/History.tsx delete mode 100644 src/components/icons/Icon.tsx delete mode 100644 src/components/icons/InkIcon.tsx delete mode 100644 src/components/icons/InkLogo.tsx delete mode 100644 src/components/icons/Language.tsx delete mode 100644 src/components/icons/SquareDivider.tsx delete mode 100644 src/components/icons/Testnet-Dark.tsx delete mode 100644 src/components/icons/ThemedIcon.tsx delete mode 100644 src/components/icons/bullets/About.tsx delete mode 100644 src/components/icons/bullets/Bridge.tsx delete mode 100644 src/components/icons/bullets/Builders.tsx delete mode 100644 src/components/icons/bullets/Community.tsx delete mode 100644 src/components/icons/bullets/Contact.tsx delete mode 100644 src/components/icons/bullets/Docs.tsx delete mode 100644 src/components/icons/bullets/Events.tsx delete mode 100644 src/components/icons/bullets/Faucet.tsx delete mode 100644 src/components/icons/bullets/GitHub.tsx delete mode 100644 src/components/icons/bullets/Status.tsx delete mode 100644 src/components/icons/bullets/Testnet.tsx delete mode 100644 src/components/icons/news/Decrypt.tsx delete mode 100644 src/components/styles/header.ts delete mode 100644 src/contexts/wallet-context.ts diff --git a/package.json b/package.json index 3a8be3b..9ed5f4f 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "react-dom": "19.0.0", "react-focus-lock": "2.13.2", "react-hook-form": "7.54.1", - "react-multi-carousel": "2.8.5", "react-toastify": "10.0.5", "sass": "1.77.6", "sharp": "0.33.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8a7d7b..a57fe6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -140,9 +140,6 @@ importers: react-hook-form: specifier: 7.54.1 version: 7.54.1(react@19.0.0) - react-multi-carousel: - specifier: 2.8.5 - version: 2.8.5 react-toastify: specifier: 10.0.5 version: 10.0.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -5670,10 +5667,6 @@ packages: react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - react-multi-carousel@2.8.5: - resolution: {integrity: sha512-C5DAvJkfzR2JK9YixZ3oyF9x6R4LW6nzTpIXrl9Oujxi4uqP9SzVVCjl+JLM3tSdqdjAx/oWZK3dTVBSR73Q+w==} - engines: {node: '>=8'} - react-reconciler@0.31.0-rc.0: resolution: {integrity: sha512-hOHzEH+aXLQGJjEoFkz2fX5ZQCDu0VjZfhyhIqRyJrz3bwkdEloH3y+xx8/HVr8oqcm65o9/9yaK97dH+tRP2A==} engines: {node: '>=0.10.0'} @@ -13456,8 +13449,6 @@ snapshots: react-is@16.13.1: {} - react-multi-carousel@2.8.5: {} - react-reconciler@0.31.0-rc.0(react@19.0.0): dependencies: react: 19.0.0 diff --git a/src/app/[locale]/apps/_components/AppCard.tsx b/src/app/[locale]/apps/_components/AppCard.tsx deleted file mode 100644 index bd3f89e..0000000 --- a/src/app/[locale]/apps/_components/AppCard.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { useState } from "react"; -import Image from "next/image"; - -import { ParallaxedHoverImage } from "@/components/ParallaxedHoverImage"; -import featuredApps from "@/generated/featured-apps.json"; -import { classNames } from "@/util/classes"; - -import { AppLinks } from "./AppLinks"; -import { FeaturedAppPill } from "./FeaturedAppPill"; -import { InkApp, InkAppNetwork, mainUrl } from "./InkApp"; - -function matchAppImageFileName(name: string): string { - // No whitespace, colons seems to be replaced with underscores. - // Check the exported Figma file and adjust to match them if necessary. - return name.replaceAll(/:/g, "_").replaceAll(/ /g, ""); -} - -export function AppCard({ - app, - network, -}: { - app: InkApp; - network: InkAppNetwork; -}) { - const [originalClick, setOriginalClick] = useState<{ - x: number; - y: number; - } | null>(null); - - const featuredAppSpecificImage = featuredApps.find( - (f) => f.name === app.name || f.name === matchAppImageFileName(app.name) - ); - return ( -
-
- -
- -
-
{app.name}
-
- {app.description} -
- -
-
- ); -} diff --git a/src/app/[locale]/apps/_components/AppsGrid.tsx b/src/app/[locale]/apps/_components/AppsGrid.tsx index 4d6cdf5..d8bf6f7 100644 --- a/src/app/[locale]/apps/_components/AppsGrid.tsx +++ b/src/app/[locale]/apps/_components/AppsGrid.tsx @@ -3,8 +3,6 @@ import { Tag } from "@inkonchain/ink-kit"; import Image from "next/image"; import { useTranslations } from "next-intl"; -import { NoisyContainer } from "@/components/Noisy"; - import { AppLinks } from "./AppLinks"; import { InkApp, InkAppNetwork, mainUrl } from "./InkApp"; @@ -52,7 +50,7 @@ function AppCard({ }} >
- +
{"dapps - +
{featured && {t("featured")}}
diff --git a/src/app/[locale]/apps/_components/FeaturedAppPill.tsx b/src/app/[locale]/apps/_components/FeaturedAppPill.tsx deleted file mode 100644 index bf51c8a..0000000 --- a/src/app/[locale]/apps/_components/FeaturedAppPill.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { PropsWithChildren } from "react"; - -export const FeaturedAppPill: React.FC = ({ children }) => { - return ( -
- {children} -
- ); -}; - -FeaturedAppPill.displayName = "FeaturedAppPill"; diff --git a/src/app/[locale]/community/_components/LetsGetSocial.tsx b/src/app/[locale]/community/_components/LetsGetSocial.tsx index 14f7835..84dfa7b 100644 --- a/src/app/[locale]/community/_components/LetsGetSocial.tsx +++ b/src/app/[locale]/community/_components/LetsGetSocial.tsx @@ -82,6 +82,6 @@ export const LetsGetSocial = () => { ); }; -export const ExternalLinkArrow = () => { +const ExternalLinkArrow = () => { return ; }; diff --git a/src/app/[locale]/get-verified/_components/VerificationContent.tsx b/src/app/[locale]/get-verified/_components/VerificationContent.tsx index 2fdbcb0..3227182 100644 --- a/src/app/[locale]/get-verified/_components/VerificationContent.tsx +++ b/src/app/[locale]/get-verified/_components/VerificationContent.tsx @@ -6,7 +6,6 @@ import { Button } from "@/components/Button/Button"; import { ColoredText } from "@/components/ColoredText"; import { useFeatureRequestModalContext } from "@/components/FeatureRequestModal/FeatureRequestModalContext"; import { FlyWhenIntoView } from "@/components/FlyWhenIntoView"; -import { NoisyContainer } from "@/components/Noisy"; import { useVerificationModalContext } from "@/components/VerificationModal/VerificationModalContext"; export function VerificationContent() { @@ -19,10 +18,7 @@ export function VerificationContent() { {/* First section with two noisy containers */}
- +
{/* Add background noise div with matching rounded corners */}
-
+
- +
@@ -92,7 +85,7 @@ export function VerificationContent() {
- +
@@ -186,10 +179,7 @@ export function VerificationContent() { {/* Discord badge - 50% width */}
- +
- +
diff --git a/src/app/[locale]/smart-wallet/_components/SmartAccountAddress.tsx b/src/app/[locale]/smart-wallet/_components/SmartAccountAddress.tsx deleted file mode 100644 index 8bb9cfd..0000000 --- a/src/app/[locale]/smart-wallet/_components/SmartAccountAddress.tsx +++ /dev/null @@ -1,23 +0,0 @@ -"use client"; - -import { useZeroDev } from "../context/ZerodevContext"; - -export function SmartAccountAddress() { - const { accountAddress } = useZeroDev(); - - if (!accountAddress) return null; - - return ( -
- Account address:{" "} - - {accountAddress} - -
- ); -} diff --git a/src/app/[locale]/verify/_components/VerifyInfoCard.tsx b/src/app/[locale]/verify/_components/VerifyInfoCard.tsx deleted file mode 100644 index a2dfeaa..0000000 --- a/src/app/[locale]/verify/_components/VerifyInfoCard.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from "react"; - -import { classNames } from "@/util/classes"; - -interface VerifyInfoCardProps { - className?: string; - icon: React.ReactNode; - title: React.ReactNode; - description: React.ReactNode; -} - -export const VerifyInfoCard = ({ - className, - icon, - title, - description, -}: VerifyInfoCardProps) => { - return ( -
-
-
{icon}
-

- {title} -

-
- {description} -
-
-
- ); -}; diff --git a/src/components/AnchorIntoView.tsx b/src/components/AnchorIntoView.tsx deleted file mode 100644 index 5ad5d23..0000000 --- a/src/components/AnchorIntoView.tsx +++ /dev/null @@ -1,44 +0,0 @@ -"use client"; -import React, { PropsWithChildren } from "react"; -import { useSearchParams } from "next/navigation"; - -import { useCallbackWhenVisible } from "@/hooks/useCallbackWhenVisible"; -import { Anchors, useRouter } from "@/routing"; -import { classNames } from "@/util/classes"; -import { getAnchorWithParams } from "@/util/urls"; - -export interface AnchorIntoViewProps extends PropsWithChildren { - anchor: Anchors; -} - -export const AnchorIntoView: React.FC = ({ - anchor, - children, -}) => { - const anchorWithoutHashAndSlash = anchor.substring(2); - const router = useRouter(); - const searchParams = useSearchParams(); - - const { ref } = useCallbackWhenVisible({ - callback: () => { - if (typeof window !== undefined && window.location.hash !== anchor) { - const params = searchParams.toString(); - router.replace(getAnchorWithParams(anchor, params), { - scroll: false, - }); - } - }, - }); - - return ( -
-
-   -
- {children} -
- ); -}; diff --git a/src/components/ArrowOnHover.tsx b/src/components/ArrowOnHover.tsx deleted file mode 100644 index 8730f9b..0000000 --- a/src/components/ArrowOnHover.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { classNames } from "@/util/classes"; - -import { ArrowRightIcon } from "./icons/ArrowRight"; -import { ArrowTopRightIcon } from "./icons/ArrowTopRight"; -import { type IconProps } from "./icons/types"; - -export const ArrowOnHover: React.FC<{ - iconClassName?: string; - size?: IconProps["size"]; - enforce?: "white" | "black" | "inherit"; - external?: boolean; -}> = ({ size = "icon-sm", enforce, external, iconClassName }) => ( - - {external ? ( - - ) : ( - - )} - -); diff --git a/src/components/BridgeButton.tsx b/src/components/BridgeButton.tsx deleted file mode 100644 index 67eee02..0000000 --- a/src/components/BridgeButton.tsx +++ /dev/null @@ -1,77 +0,0 @@ -"use client"; - -import { useState } from "react"; -import { motion } from "framer-motion"; - -import { clientEnv } from "@/env-client"; - -export const BridgeButton: React.FC = () => { - const [isHovered, setIsHovered] = useState(false); - - const handleClick = () => { - window.open( - clientEnv.NEXT_PUBLIC_GELATO_BRIDGE_URL, - "_blank", - "noopener,noreferrer" - ); - }; - - return ( - setIsHovered(true)} - onHoverEnd={() => setIsHovered(false)} - onClick={handleClick} - className="relative overflow-hidden bg-gradient-to-r from-blue-500 via-purple-500 - to-pink-500 - text-white font-extrabold py-4 px-8 rounded-full shadow-lg text-2xl - cursor-pointer" - animate={{ - boxShadow: isHovered - ? [ - "0 0 0 0 rgba(0, 0, 255, 0)", - "0 0 0 20px rgba(0, 0, 255, 0.1)", - "0 0 0 40px rgba(0, 0, 255, 0)", - ] - : "0 0 0 0 rgba(0, 0, 255, 0)", - }} - transition={{ - duration: 1, - repeat: isHovered ? Infinity : 0, - repeatType: "loop", - }} - > - 🌉 Bridge to Testnet Now! 🌉 - - - - - ); -}; diff --git a/src/components/BulletCard.tsx b/src/components/BulletCard.tsx deleted file mode 100644 index f2668e0..0000000 --- a/src/components/BulletCard.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -import { ColoredText } from "./ColoredText"; -import { NoisyContainer } from "./Noisy"; - -export interface BulletCardProps extends PropsWithChildren { - className?: string; - icon: React.ReactNode; - title: React.ReactNode; -} - -export const BulletCard: React.FC = ({ - title, - className, - icon, - children, -}) => { - return ( - -
-
- {icon} -
-
- -

{title}

-
-
{children}
-
-
-
- ); -}; diff --git a/src/components/Button/RoundedIconButton.tsx b/src/components/Button/RoundedIconButton.tsx deleted file mode 100644 index ec2a495..0000000 --- a/src/components/Button/RoundedIconButton.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -import { MagneticHoverEffect } from "../MagneticHoverEffect"; - -interface RoundedIconButtonProps - extends React.ButtonHTMLAttributes { - variant?: "blur"; -} - -export const RoundedIconButton: React.FC< - PropsWithChildren -> = ({ children, className, variant, ...rest }) => { - return ( - - - - ); -}; diff --git a/src/components/CollapsiblePopup.tsx b/src/components/CollapsiblePopup.tsx deleted file mode 100644 index 4d0d8ff..0000000 --- a/src/components/CollapsiblePopup.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { classNames } from "@/util/classes"; - -export interface CollapsiblePopupProps { - isOpen: boolean; - children: React.ReactNode; - className?: string; - forceHover?: boolean; -} - -export const CollapsiblePopup: React.FC = ({ - className, - isOpen, - children, - forceHover, -}) => { - return ( -
- {children} -
- ); -}; diff --git a/src/components/ConnectWallet/ConnectWallet.tsx b/src/components/ConnectWallet/ConnectWallet.tsx deleted file mode 100644 index 78b8a48..0000000 --- a/src/components/ConnectWallet/ConnectWallet.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import React, { useEffect, useState } from "react"; -import { EthereumProvider } from "@walletconnect/ethereum-provider"; -import { ethers } from "ethers"; -import Image from "next/image"; - -import { useWalletContext } from "@/contexts/wallet-context"; - -interface SwitchError extends Error { - code?: number; -} - -export const ConnectWallet = () => { - const { provider, walletAddress, setProvider, setSigner, setWalletAddress } = - useWalletContext(); - - // const [walletAddress, setWalletAddress] = useState(); - const [isVisible, setIsVisible] = useState(false); - - const showModal = () => setIsVisible(true); - const hideModal = () => setIsVisible(false); - - const connectMetaMask = async () => { - hideModal(); - if (!window.ethereum) { - throw new Error("MetaMask is not installed"); - } - const provider = new ethers.BrowserProvider(window.ethereum); - await provider.send("eth_requestAccounts", []); - const signer = await provider.getSigner(); - const walletAddress = await signer.getAddress(); - // These setters could be in their own function to set - setProvider(provider); - setSigner(signer); - setWalletAddress(walletAddress); - }; - - const connectWalletConnect = async () => { - hideModal(); - const provider = await EthereumProvider.init({ - projectId: "87d16ae694b7ff58f759237ec11c294a", - metadata: { - name: "My Website", - description: "My Website Description", - url: "inkonchain.com", - icons: ["randomicon.com"], - }, - showQrModal: true, - optionalChains: [1, 137, 2020], - - /*Optional - Add custom RPCs for each supported chain*/ - rpcMap: { - 1: "mainnet.rpc...", - 137: "polygon.rpc...", - }, - }); - provider.signer; - - await provider.enable(); - const web3Provider = new ethers.BrowserProvider(provider); - const signer = await web3Provider.getSigner(); - const address = await signer.getAddress(); - - setProvider(web3Provider); - setSigner(signer); - setWalletAddress(walletAddress); - setWalletAddress(address); - hideModal(); - }; - - // switch these provider.send - // TODO: how do you know which chain you are connected to? https://docs.metamask.io/wallet/reference/eth_chainid/ - async function switchNetwork() { - if (!window.ethereum) { - throw new Error("MetaMask is not installed"); - } - let hexChainId = "0xBA5ED"; - try { - await window.ethereum.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: hexChainId }], - }); - } catch (error) { - const switchError = error as SwitchError; - // This error code indicates that the chain has not been added to MetaMask. - if (switchError.code === 4902) { - try { - // Attempt to add a new network (e.g., Binance Smart Chain) - await window.ethereum.request({ - method: "wallet_addEthereumChain", - params: [ - { - chainId: hexChainId, // Example: Binance Smart Chain Mainnet - rpcUrl: "https://rpc.op-one-testnet.gelato.digital", - }, - ], - }); - } catch (addError) { - console.error("Failed to add the network:", addError); - } - } else { - console.error("Error switching networks:", switchError); - } - } - } - - useEffect(() => { - // TODO: initialize the provider autmoatically if they have connected before - const initializeProvider = async () => { - // need to check how to do it with wallet connect if it will be the same - // probably not. something like window.ethereum.isMetamask or .isWalletConnect - if (window.ethereum && !provider) { - // then set it - const provider = new ethers.BrowserProvider(window.ethereum); - // this line is an issue - await provider.send("eth_requestAccounts", []); - const signer = await provider.getSigner(); - const walletAddress = await signer.getAddress(); - // These setters could be in their own function to set - setProvider(provider); - setSigner(signer); - setWalletAddress(walletAddress); - switchNetwork(); - } - }; - initializeProvider(); - }, [provider, setProvider, setSigner, setWalletAddress]); - - return ( - <> - {!walletAddress ? ( - - ) : ( -

{walletAddress}

- )} - {isVisible && ( -
-
- {/* */} - -

Connect Wallet

- × -
- - - - -
-
- )} - - ); -}; diff --git a/src/components/ConnectWallet/index.ts b/src/components/ConnectWallet/index.ts deleted file mode 100644 index e79cc62..0000000 --- a/src/components/ConnectWallet/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ConnectWallet"; diff --git a/src/components/Disappearing.tsx b/src/components/Disappearing.tsx deleted file mode 100644 index 19e381c..0000000 --- a/src/components/Disappearing.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; -import React, { PropsWithChildren } from "react"; -import { motion, useScroll, useTransform } from "framer-motion"; - -export interface DisappearingProps extends PropsWithChildren { - className?: string; - scrollMin: number; - scrollMax: number; - disabled?: boolean | undefined; -} - -export const Disappearing: React.FC = ({ - scrollMin, - scrollMax, - className, - disabled, - children, -}) => { - const { scrollY } = useScroll(); - const opacity = useTransform(scrollY, [scrollMin, scrollMax], [1, 0]); - const pointerEvents = useTransform( - scrollY, - [scrollMin, scrollMax], - ["auto", "none"] - ); - - const wrappedChildren =
{children}
; - - if (disabled) return wrappedChildren; - - return ( - - {children} - - ); -}; diff --git a/src/components/FaucetButton.tsx b/src/components/FaucetButton.tsx deleted file mode 100644 index 11e7225..0000000 --- a/src/components/FaucetButton.tsx +++ /dev/null @@ -1,122 +0,0 @@ -"use client"; - -import { PropsWithChildren, useState } from "react"; -import { toast } from "react-toastify"; -import { motion } from "framer-motion"; - -import { useWallet } from "@/contexts/WalletProvider"; -import { clientEnv } from "@/env-client"; -import { useFaucetInfoAndCaptcha } from "@/hooks/useFaucetInfoAndHCaptcha"; - -export interface FaucetButtonProps extends PropsWithChildren { - onChange: (value: boolean | null) => void; -} - -export const FaucetButton: React.FC = ({ onChange }) => { - const { address, chainId, isConnected } = useWallet(); - const [loading, setLoading] = useState(false); - - const { hcaptchaLoaded, executeHCaptcha } = useFaucetInfoAndCaptcha(chainId); - - if (!isConnected || !address) return null; - - const handleRequest = async () => { - setLoading(true); - await onChange(null); - - try { - // Check rate limit first - const rateLimitRes = await fetch( - `${clientEnv.NEXT_PUBLIC_FAUCET_API_URL}/api/check-rate-limit`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ address, chainId }), - } - ); - - if (!rateLimitRes.ok) { - const errorData = await rateLimitRes.json(); - throw new Error(errorData.message || "Rate limit check failed"); - } - - const rateLimitData = await rateLimitRes.json(); - - if (!rateLimitData.allowed) { - toast.error(`${rateLimitData.message}`); - return; - } - - // If not rate limited, proceed with captcha verification - let hcaptchaToken = undefined; - if (hcaptchaLoaded) { - try { - hcaptchaToken = await executeHCaptcha(); - } catch (error) { - console.error("hCaptcha execution error:", error); - toast.error("Failed to verify captcha"); - return; - } - } else { - console.warn("hCaptcha not loaded or not ready"); - toast.warning("hCaptcha not ready. Please try again."); - return; - } - - // If captcha is solved, proceed with the claim - const res = await fetch( - `${clientEnv.NEXT_PUBLIC_FAUCET_API_URL}/api/claim`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ address, chainId, hcaptchaToken }), - } - ); - - const responseData = await res.json(); - - await onChange(true); - res.ok - ? toast.success(`🎉 Testnet ETH successfully claimed! Enjoy!`) - : toast.error(`${responseData.message}`); - } catch (error) { - console.error("Request error:", error); - if (error instanceof Error) { - console.error("Error message:", error.message); - console.error("Error stack:", error.stack); - } - - await onChange(false); - toast.error( - `${error instanceof Error ? error.message : "❌ Failed to claim testnet ETH. Please try again."}` - ); - } finally { - setLoading(false); - } - }; - - return ( - <> - - {loading ? `Requesting...` : `🚀 Get Testnet ETH Now! 🚀`} - -
- - ); -}; diff --git a/src/components/FloatingSquares/FloatingSquares.scss b/src/components/FloatingSquares/FloatingSquares.scss deleted file mode 100644 index 3b8c80d..0000000 --- a/src/components/FloatingSquares/FloatingSquares.scss +++ /dev/null @@ -1,21 +0,0 @@ -.animated-square { - transform: scale(0) rotateY(0); - animation: square-pop var(--animation-duration) var(--animation-delay) - infinite; -} - -@keyframes square-pop { - 0%, - 5%, - 100% { - transform: scale(0) rotateY(0); - } - 15%, - 25% { - transform: scale(1); - } - 40%, - 99% { - transform: rotateY(90deg); - } -} diff --git a/src/components/FloatingSquares/FloatingSquares.tsx b/src/components/FloatingSquares/FloatingSquares.tsx deleted file mode 100644 index fa01d8c..0000000 --- a/src/components/FloatingSquares/FloatingSquares.tsx +++ /dev/null @@ -1,76 +0,0 @@ -"use client"; - -import { CSSProperties, useEffect, useState } from "react"; - -import { classNames } from "@/util/classes"; - -import "./FloatingSquares.scss"; - -interface PropsWithClass { - className?: string; -} - -interface AnimationProps { - delayMs: number; - durationMs: number; -} - -function randomInteger(min: number, max: number) { - return Math.floor(Math.random() * (max - min + 1)) + min; -} - -export const FloatingSquares: React.FC = ({ className }) => { - const [random, setRandom] = useState(); - - useEffect(() => { - setRandom(randomInteger(1000, 4000)); - }, [setRandom]); - - if (!random) { - return null; - } - - return ( -
-
- - - -
-
- ); -}; - -const randomNumberToRender = () => Array.from(new Array(randomInteger(1, 3))); -const randomPosition = () => randomInteger(50, 500); - -const GroupOfSquares: React.FC = ({ delayMs, durationMs }) => { - const [numberToRender, setNumberToRender] = useState(randomNumberToRender()); - const [positionY, setPositionY] = useState(randomPosition()); - - useEffect(() => { - const interval = setTimeout(() => { - setNumberToRender(randomNumberToRender()); - setPositionY(randomPosition()); - }, delayMs + durationMs); - - return () => clearInterval(interval); - }, [delayMs, durationMs]); - - return ( -
- {numberToRender.map((_, i) => ( -
- ))} -
- ); -}; diff --git a/src/components/FloatingSquares/index.tsx b/src/components/FloatingSquares/index.tsx deleted file mode 100644 index 79f60b5..0000000 --- a/src/components/FloatingSquares/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export * from "./FloatingSquares"; diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 6d9fdb4..cd0aaab 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,12 +1,14 @@ "use client"; +import Image from "next/image"; + +import { Link } from "@/routing"; +import { EXTERNAL_LINKS } from "@/routing"; import { classNames } from "@/util/classes"; + import { CookieSettingsButton } from "../CookieSettingsButton"; -import { EXTERNAL_LINKS } from "@/routing"; -import Link from "next/link"; -import { TextUnderline } from "../TextUnderline"; -import Image from "next/image"; import { SocialLinksRow } from "../SocialLinksRow"; +import { TextUnderline } from "../TextUnderline"; export const Footer = () => { return ( diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx deleted file mode 100644 index 0acc793..0000000 --- a/src/components/Header/Header.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { MobileMenuContent } from "@/components/MobileMenu/MobileMenuContent"; - -import { LogoLink } from "../LogoLink"; -import { MobileHeader } from "../MobileHeader"; - -import { HeaderConnectWallet } from "./HeaderConnectWallet"; - -export interface HeaderProps { - children?: React.ReactNode; - mobileChildren?: React.ReactNode; -} - -// Keep the main Header component as a Server Component -export const Header = ({ children, mobileChildren }: HeaderProps) => { - return ( - <> -
-
-
- -
-
{children}
-
- -
-
-
- - - {mobileChildren} - - - ); -}; diff --git a/src/components/Header/HeaderConnectWallet.tsx b/src/components/Header/HeaderConnectWallet.tsx deleted file mode 100644 index 45963fb..0000000 --- a/src/components/Header/HeaderConnectWallet.tsx +++ /dev/null @@ -1,19 +0,0 @@ -"use client"; - -import { Suspense } from "react"; - -import { ConnectWalletButton } from "@/components/ConnectWalletButton"; - -import { OnlyWithFeatureFlag } from "../OnlyWithFeatureFlag"; - -import { HeaderContent } from "./HeaderContent"; - -export const HeaderConnectWallet = () => { - return ( - }> - }> - - - - ); -}; diff --git a/src/components/Header/HeaderContent.tsx b/src/components/Header/HeaderContent.tsx deleted file mode 100644 index d67226a..0000000 --- a/src/components/Header/HeaderContent.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react"; - -import { ConnectWalletButton } from "@/components/ConnectWalletButton"; - -import { HomeAppsToggle } from "../HomeAppsToggle/HomeAppsToggle"; - -export const HeaderContent: React.FC = () => { - return ( -
- - -
- ); -}; diff --git a/src/components/Header/index.ts b/src/components/Header/index.ts deleted file mode 100644 index 9e08a64..0000000 --- a/src/components/Header/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Header"; diff --git a/src/components/HeroSection.tsx b/src/components/HeroSection.tsx deleted file mode 100644 index 43ded01..0000000 --- a/src/components/HeroSection.tsx +++ /dev/null @@ -1,26 +0,0 @@ -"use client"; -import React, { PropsWithChildren } from "react"; -import { MotionValue, useScroll, useTransform } from "framer-motion"; -import { motion } from "framer-motion"; - -export interface HeroSectionProps extends PropsWithChildren {} - -function useParallax(value: MotionValue, distance: number) { - return useTransform(value, [0, 500], [0, distance]); -} - -export const HeroSection: React.FC = ({ children }) => { - const { scrollY } = useScroll(); - const y = useParallax(scrollY, 100); - const opacity = useTransform(scrollY, [0, 500], [1, 0]); - return ( - -
- {children} -
-
- ); -}; diff --git a/src/components/HomeAppsToggle/HomeAppsToggle.tsx b/src/components/HomeAppsToggle/HomeAppsToggle.tsx deleted file mode 100644 index c67ab33..0000000 --- a/src/components/HomeAppsToggle/HomeAppsToggle.tsx +++ /dev/null @@ -1,61 +0,0 @@ -"use client"; - -import { useState } from "react"; -import { SegmentedControl, SegmentedControlOption } from "@inkonchain/ink-kit"; - -import { useRouterQuery } from "@/hooks/useRouterQuery"; -import { Link, usePathname } from "@/routing"; -import { classNames } from "@/util/classes"; - -import { DotsIcon } from "../icons/Dots"; -import { InkIcon } from "../icons/InkIcon"; - -type ControlOption = "home" | "apps"; - -export const HomeAppsToggle: React.FC<{}> = () => { - const query = useRouterQuery(); - const pathname = usePathname(); - const [selected, setSelected] = useState( - pathname === "/" ? "home" : "apps" - ); - - return ( - - - - ), - selectedByDefault: pathname !== "/apps", - value: "home", - }, - { - asChild: true, - children: ( - - - - ), - selectedByDefault: pathname === "/apps", - value: "apps", - }, - ]} - onOptionChange={function ( - option: SegmentedControlOption - ): void { - setSelected(option.value); - }} - /> - ); -}; diff --git a/src/components/HorizontalLine.tsx b/src/components/HorizontalLine.tsx deleted file mode 100644 index c467f53..0000000 --- a/src/components/HorizontalLine.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export const HorizontalLine = () => ( -
-
-
-); diff --git a/src/components/ImagePreloader.tsx b/src/components/ImagePreloader.tsx deleted file mode 100644 index e22035b..0000000 --- a/src/components/ImagePreloader.tsx +++ /dev/null @@ -1,18 +0,0 @@ -"use client"; - -import { useEffect } from "react"; - -export const ImagePreloader = () => { - useEffect(() => { - const preloadImage = (src: string) => { - const img = new Image(); - img.src = src; - }; - - // Preload all required images - preloadImage("/icons/nav-bullet.svg"); - preloadImage("/nav-chad.png"); - }, []); - - return null; -}; diff --git a/src/components/InputWithSubmit/ButtonIntoInputOverlay.tsx b/src/components/InputWithSubmit/ButtonIntoInputOverlay.tsx deleted file mode 100644 index 833c424..0000000 --- a/src/components/InputWithSubmit/ButtonIntoInputOverlay.tsx +++ /dev/null @@ -1,104 +0,0 @@ -"use client"; -import React, { useEffect } from "react"; -import { AnimatePresence, useAnimate, usePresence } from "framer-motion"; - -import { classNames } from "@/util/classes"; - -import { buttonClassName } from "../Button/styles"; - -export interface ButtonIntoInputOverlayProps { - className?: string; - children: React.ReactNode; - isClosed: boolean; - setIsClosed: (isClosed: boolean) => void; -} - -export const ButtonIntoInputOverlay: React.FC = ({ - className, - children, - isClosed, - setIsClosed, -}) => { - return ( -
- - {!isClosed && ( - setIsClosed(true)}> - {children} - - )} - -
- ); -}; - -const ButtonWithExit: React.FC<{ - children: React.ReactNode; - onClick: Function; -}> = ({ children, onClick }) => { - const [isPresent, safeToRemove] = usePresence(); - const [scope, animate] = useAnimate(); - - useEffect(() => { - if (!isPresent) { - const exitAnimation = async () => { - await Promise.all([ - animate("div", { opacity: 0 }, { duration: 0.3, ease: "easeInOut" }), - animate( - scope.current, - // In this animation, we use `borderWidth with a white border to "hide" the actual real button for a little while` - { width: 60, height: 60, margin: 4, borderWidth: 20 }, - { duration: 0.3, ease: "easeInOut" } - ), - ]); - - await animate( - scope.current, - { - width: 60, - height: 60, - margin: 4, - opacity: 0, - borderWidth: 0, - }, - { - duration: 0.3, - ease: "easeInOut", - } - ); - safeToRemove(); - }; - - exitAnimation(); - } - }, [animate, safeToRemove, scope, isPresent]); - - return ( - - ); -}; diff --git a/src/components/InputWithSubmit/InputWithSubmit.tsx b/src/components/InputWithSubmit/InputWithSubmit.tsx deleted file mode 100644 index 4cce3a1..0000000 --- a/src/components/InputWithSubmit/InputWithSubmit.tsx +++ /dev/null @@ -1,168 +0,0 @@ -import { InputHTMLAttributes, useEffect, useRef, useState } from "react"; -import { useFormStatus } from "react-dom"; -import { motion } from "framer-motion"; - -import { Loader } from "@/components/Loader"; -import { usePrevious } from "@/hooks/usePrevious"; -import { classNames } from "@/util/classes"; -import { isValidEmail } from "@/util/validation"; - -import { ArrowRightIcon } from "../icons/ArrowRight"; -import { CircleExclamationMarkIcon } from "../icons/CircleExclamationMark"; - -import { - inputClassNames, - inputContainerClassNames, - inputIconClassNames, - InputVariants, -} from "./styles"; - -export interface InputWithSubmitProps - extends InputHTMLAttributes { - variant: InputVariants; - sizeVariant?: "default" | "large"; - inputClassName?: string; - icon?: React.ReactNode; - autoFocusOnEnable?: boolean; - children?: React.ReactNode; -} - -const transition = { - duration: 0.6, - stiffness: 50, - type: "spring", -}; - -export const InputWithSubmit: React.FC = ({ - variant, - sizeVariant, - icon, - children, - className, - inputClassName = "", - disabled, - autoFocusOnEnable, - ...inputProps -}) => { - const { pending } = useFormStatus(); - const [showValidationError, setShowValidationError] = useState(false); - const displayError = showValidationError && !pending; - - const inputRef = useRef(null); - - const previousDisable = usePrevious(disabled); - useEffect(() => { - if ( - inputRef && - autoFocusOnEnable && - previousDisable === true && - !disabled - ) { - inputRef.current?.focus(); - } - }, [inputRef, autoFocusOnEnable, disabled, previousDisable]); - - useEffect(() => { - const input = inputRef.current; - if (!input) return; - - const handleInvalidInput = (e: Event) => { - e.preventDefault(); - setShowValidationError(true); - }; - - const handleInputChange = (e: Event) => { - if (!e.target) return; - - if (isValidEmail((e.target as HTMLInputElement).value)) { - setShowValidationError(false); - } - }; - - input.addEventListener("invalid", handleInvalidInput); - input.addEventListener("input", handleInputChange); - - return () => { - input.removeEventListener("invalid", handleInvalidInput); - input.removeEventListener("input", handleInputChange); - }; - }, [inputRef, setShowValidationError]); - - return ( -
-
- - - - {icon &&
{icon}
} -
- - {displayError && ( -
- - Enter a valid email address -
- )} - - {children} -
- ); -}; diff --git a/src/components/InputWithSubmit/index.tsx b/src/components/InputWithSubmit/index.tsx deleted file mode 100644 index c2dbe6e..0000000 --- a/src/components/InputWithSubmit/index.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./ButtonIntoInputOverlay"; -export * from "./InputWithSubmit"; diff --git a/src/components/LocaleSwitcher.tsx b/src/components/LocaleSwitcher.tsx deleted file mode 100644 index 5f96860..0000000 --- a/src/components/LocaleSwitcher.tsx +++ /dev/null @@ -1,55 +0,0 @@ -"use client"; - -import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; -import { useParams } from "next/navigation"; -import { useLocale, useTranslations } from "next-intl"; - -import { compactLanguage, Link, routing, usePathname } from "@/routing"; -import { classNames } from "@/util/classes"; - -import { RoundedIconButton } from "./Button/RoundedIconButton"; -import { LanguageIcon } from "./icons/Language"; - -export const LanguageSwitcher: React.FC = () => { - const params = useParams(); - const pathname = usePathname(); - const locale = useLocale(); - const t = useTranslations("LocaleSwitcher"); - - return ( - - - - - - - - - {routing.locales.map((cur) => ( - - {t("locale", { locale: compactLanguage(cur) })} - - ))} - - - ); -}; diff --git a/src/components/LogoLink.tsx b/src/components/LogoLink.tsx deleted file mode 100644 index 080a9aa..0000000 --- a/src/components/LogoLink.tsx +++ /dev/null @@ -1,63 +0,0 @@ -"use client"; - -import { AnimatedInkLogoIcon } from "@/components/icons/InkLogo"; -import { useRouterQuery } from "@/hooks/useRouterQuery"; -import { Link, usePathname, useRouter } from "@/routing"; -import { getAnchorWithParams } from "@/util/urls"; - -export const LogoLink = () => { - const router = useRouter(); - const pathname = usePathname(); - const isHomePage = pathname === "/"; - const query = useRouterQuery(); - - const scrollToHash = (hash: string) => { - if (typeof window === "undefined") return false; - - if (!isHomePage) { - return false; - } - - const element = - hash === "#" ? document.documentElement : document.querySelector(hash); - - if (!element) return false; - - // If we're already at this hash, just scroll - if (window.location.hash === hash) { - element.scrollIntoView({ behavior: "smooth" }); - return true; - } - - // Update URL first without scrolling - router.push(getAnchorWithParams(hash, query.toString()), { scroll: false }); - - // Wait for next frame to ensure DOM update - requestAnimationFrame(() => { - // And then wait one more frame for safety - requestAnimationFrame(() => { - element.scrollIntoView({ behavior: "smooth" }); - }); - }); - - return true; - }; - - return ( - { - if (scrollToHash("#")) { - e.preventDefault(); - } - }} - > - - - ); -}; diff --git a/src/components/MobileHeader/MobileHeader.tsx b/src/components/MobileHeader/MobileHeader.tsx deleted file mode 100644 index fb09a65..0000000 --- a/src/components/MobileHeader/MobileHeader.tsx +++ /dev/null @@ -1,58 +0,0 @@ -"use client"; - -import React, { PropsWithChildren } from "react"; -import FocusLock from "react-focus-lock"; - -import { ConnectWalletButton } from "@/components/ConnectWalletButton"; -import { MobileMenuButton } from "@/components/MobileMenu"; -import { useMobileMenuContext } from "@/components/MobileMenu/MobileMenuContext"; -import { usePathname } from "@/routing"; - -import { HeaderContent } from "../Header/HeaderContent"; -import { OnlyWithFeatureFlag } from "../OnlyWithFeatureFlag"; - -import { MobileLogoLink } from "./MobileLogoLink"; - -export interface MobileHeaderProps extends PropsWithChildren {} - -export const MobileHeader: React.FC = ({ children }) => { - const { isOpen, setIsOpen } = useMobileMenuContext(); - const pathname = usePathname(); - - // Define routes where header should not be sticky - const nonStickyRoutes = ["/testnet-bridge", "/faucet"]; - const isNonStickyRoute = nonStickyRoutes.includes(pathname); - - const scrollProps = { - scrollMin: 0, - scrollMax: 200, - }; - - return ( - -
-
- - -
- } - > - - - -
-
-
- - {isOpen ? children : null} -
- ); -}; diff --git a/src/components/MobileHeader/MobileLogoLink.tsx b/src/components/MobileHeader/MobileLogoLink.tsx deleted file mode 100644 index 874d9ec..0000000 --- a/src/components/MobileHeader/MobileLogoLink.tsx +++ /dev/null @@ -1,68 +0,0 @@ -"use client"; - -import { Disappearing } from "@/components/Disappearing"; -import { AnimatedInkLogoIcon } from "@/components/icons/InkLogo"; -import { useRouterQuery } from "@/hooks/useRouterQuery"; -import { Link, usePathname, useRouter } from "@/routing"; -import { getAnchorWithParams } from "@/util/urls"; - -interface MobileLogoLinkProps { - isOpen: boolean; - setIsOpen: (isOpen: boolean) => void; - scrollProps: { - scrollMin: number; - scrollMax: number; - }; -} - -export const MobileLogoLink = ({ - isOpen, - setIsOpen, - scrollProps, -}: MobileLogoLinkProps) => { - const router = useRouter(); - const query = useRouterQuery(); - const pathname = usePathname(); - const isHomePage = pathname === "/"; - - const handleClick = (e: React.MouseEvent) => { - setIsOpen(false); - - if (!isHomePage) { - return false; - } - - e.preventDefault(); - - // Update URL first without scrolling - router.push(getAnchorWithParams("#", query.toString()), { scroll: false }); - - // Wait for next frame to ensure DOM update - requestAnimationFrame(() => { - // And then wait one more frame for safety - requestAnimationFrame(() => { - window.scrollTo({ top: 0, behavior: "smooth" }); - }); - }); - }; - - return ( - - - - - - ); -}; diff --git a/src/components/MobileHeader/index.ts b/src/components/MobileHeader/index.ts deleted file mode 100644 index 63fc231..0000000 --- a/src/components/MobileHeader/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./MobileHeader"; -export * from "./MobileLogoLink"; diff --git a/src/components/MobileMenu/MobileMenuButton.tsx b/src/components/MobileMenu/MobileMenuButton.tsx deleted file mode 100644 index d88f39b..0000000 --- a/src/components/MobileMenu/MobileMenuButton.tsx +++ /dev/null @@ -1,34 +0,0 @@ -"use client"; -import React from "react"; -import { Button } from "@inkonchain/ink-kit"; - -import { BurgerIcon } from "../icons/Burger"; -import { CloseIcon } from "../icons/Close"; - -import { useMobileMenuContext } from "./MobileMenuContext"; - -export interface MobileMenuButtonProps {} - -export const MobileMenuButton: React.FC = () => { - const { isOpen, setIsOpen } = useMobileMenuContext(); - - return ( - <> - - - ); -}; diff --git a/src/components/MobileMenu/MobileMenuContent.tsx b/src/components/MobileMenu/MobileMenuContent.tsx deleted file mode 100644 index f69b851..0000000 --- a/src/components/MobileMenu/MobileMenuContent.tsx +++ /dev/null @@ -1,44 +0,0 @@ -"use client"; -import React, { PropsWithChildren } from "react"; - -import { useModal } from "@/hooks/useModal"; -import { classNames } from "@/util/classes"; - -import { Backdrop } from "../Backdrop"; - -import { useMobileMenuContext } from "./MobileMenuContext"; - -export interface MobileMenuContentProps extends PropsWithChildren {} - -export const MobileMenuContent: React.FC = ({ - children, -}) => { - const { isOpen, setIsOpen } = useMobileMenuContext(); - useModal({ - isOpen, - closeModal: () => setIsOpen(false), - modalKey: "mobile-menu", - }); - - return ( -
- setIsOpen(!isOpen)} - closeOnDragUp - /> -
-
- {children} -
-
-
- ); -}; diff --git a/src/components/MobileMenu/MobileMenuContext.tsx b/src/components/MobileMenu/MobileMenuContext.tsx deleted file mode 100644 index 2a95ec6..0000000 --- a/src/components/MobileMenu/MobileMenuContext.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; -import { - createContext, - Dispatch, - PropsWithChildren, - SetStateAction, - useContext, - useMemo, - useState, -} from "react"; - -interface MobileMenuContextProps { - isOpen: boolean; - setIsOpen: Dispatch>; -} - -const MobileMenuContext = createContext({ - isOpen: false, - setIsOpen: () => { - throw new Error( - "Not yet implemented, make sure component is wrapped by MobileMenuContextProvider." - ); - }, -}); - -export const useMobileMenuContext = () => useContext(MobileMenuContext); - -export const MobileMenuContextProvider: React.FC = ({ - children, -}) => { - const [isOpen, setIsOpen] = useState(false); - - const context: MobileMenuContextProps = useMemo( - () => ({ isOpen, setIsOpen }), - [isOpen, setIsOpen] - ); - - return ( - - {children} - - ); -}; diff --git a/src/components/MobileMenu/index.ts b/src/components/MobileMenu/index.ts deleted file mode 100644 index bd598ef..0000000 --- a/src/components/MobileMenu/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./MobileMenuButton"; diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx deleted file mode 100644 index 0c75449..0000000 --- a/src/components/Modal.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -export interface ModalContainerProps - extends React.HTMLAttributes {} - -export const ModalContainer: React.FC< - PropsWithChildren -> = (props) => { - const { children, className, ...rest } = props; - return ( -
- {children} -
- ); -}; - -export interface ModalProps extends React.HTMLAttributes { - isOpen: boolean; -} - -export const Modal: React.FC> = (props) => { - const { isOpen, children, className, ...rest } = props; - return ( -
- {children} -
- ); -}; diff --git a/src/components/NavLink.tsx b/src/components/NavLink.tsx deleted file mode 100644 index 3886c6e..0000000 --- a/src/components/NavLink.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { HrefProp, isExternalPath, Link, pathFromHrefProp } from "@/routing"; -import { classNames } from "@/util/classes"; - -import { ArrowRightIcon } from "./icons/ArrowRight"; -import { ArrowTopRightIcon } from "./icons/ArrowTopRight"; -import { IconProps } from "./icons/types"; -import { KeyboardShortcut } from "./KeyboardShortcut"; -import { TextUnderline } from "./TextUnderline"; - -export type NavLinkVariants = "lg" | "xl"; - -export interface NavLinkProps { - href: HrefProp; - variant: NavLinkVariants; - children: React.ReactNode; - disabled?: boolean; - icon?: React.ReactNode; - enforce?: "black" | "white"; - shortcutLetter?: string; - className?: string; -} - -const variantToIconSize = { - lg: "icon-md", - xl: "icon-xl", -} satisfies Record; - -export const NavLink: React.FC = ({ - href, - variant, - disabled, - children, - icon, - enforce, - shortcutLetter, - className, -}) => { - const isExternalLink = isExternalPath(pathFromHrefProp(href)); - - const underlineArrow = !icon; - const iconSize = variantToIconSize[variant]; - - return ( -
- -
- {children} - {!underlineArrow && } -
- - - {icon ? ( - icon - ) : isExternalLink ? ( - - ) : ( - - )} - - - {underlineArrow && } - - - {shortcutLetter && } -
- ); -}; diff --git a/src/components/NewsletterForm/NewsletterForm.tsx b/src/components/NewsletterForm/NewsletterForm.tsx deleted file mode 100644 index 31bc8e9..0000000 --- a/src/components/NewsletterForm/NewsletterForm.tsx +++ /dev/null @@ -1,98 +0,0 @@ -"use client"; - -import { useActionState } from "react"; -import { AnimatePresence, motion } from "framer-motion"; - -import { subscribeToGeneralWaitlist } from "@/actions/subscribe-to-braze"; -import { FormStatus } from "@/components/FormStatus"; -import { MailIcon } from "@/components/icons/Mail"; -import { ButtonIntoInputOverlay } from "@/components/InputWithSubmit"; -import { InputWithSubmit } from "@/components/InputWithSubmit/InputWithSubmit"; -import { KeyboardShortcut } from "@/components/KeyboardShortcut"; -import { classNames } from "@/util/classes"; -import { largeMovementTransition } from "@/util/transitions"; - -import { SuccessState } from "./SuccessState"; - -export interface NewsletterFormProps { - isOpen: boolean; - setIsOpen: (isOpen: boolean) => void; - hasShortcut?: boolean; - copy: { - ctaLabel: string; - }; -} - -/** Probably deprecated for now since we won't use the inline email any more */ -export const NewsletterForm: React.FC = ({ - isOpen, - setIsOpen, - hasShortcut, - copy, -}) => { - const [state, formAction] = useActionState(subscribeToGeneralWaitlist, { - success: false, - error: undefined, - }); - - return ( -
- - {!state.success ? ( - -
- } - > - setIsOpen(isClosed)} - > - {copy.ctaLabel} - {hasShortcut && } - - -
- - {state.error?.form && ( -
- -
- )} -
- ) : ( - - - - )} -
-
- ); -}; diff --git a/src/components/NewsletterForm/NewsletterFormContext.tsx b/src/components/NewsletterForm/NewsletterFormContext.tsx deleted file mode 100644 index 2c09a18..0000000 --- a/src/components/NewsletterForm/NewsletterFormContext.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; -import { - createContext, - Dispatch, - PropsWithChildren, - SetStateAction, - useContext, - useMemo, - useState, -} from "react"; - -interface NewsletterFormContextProps { - isFormOpen: boolean; - setIsFormOpen: Dispatch>; -} - -const NewsletterFormContext = createContext({ - isFormOpen: false, - setIsFormOpen: () => { - throw new Error( - "Not yet implemented, make sure component is wrapped by NewsletterFormContextProvider." - ); - }, -}); - -export const useNewsletterFormContext = () => useContext(NewsletterFormContext); - -export const NewsletterFormContextProvider: React.FC = ({ - children, -}) => { - const [isFormOpen, setIsFormOpen] = useState(false); - - const context: NewsletterFormContextProps = useMemo( - () => ({ isFormOpen, setIsFormOpen }), - [isFormOpen, setIsFormOpen] - ); - - return ( - - {children} - - ); -}; diff --git a/src/components/NewsletterForm/SuccessState.tsx b/src/components/NewsletterForm/SuccessState.tsx deleted file mode 100644 index 7bebc16..0000000 --- a/src/components/NewsletterForm/SuccessState.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; - -import Image from "next/image"; - -import { ButtonLink } from "@/components/Button/ButtonLink"; -import { TwitterIcon } from "@/components/icons/Twitter"; -import { MagneticHoverEffect } from "@/components/MagneticHoverEffect"; -import { EXTERNAL_LINKS } from "@/routing"; - -interface SuccessStateProps {} - -export const SuccessState: React.FC = () => { - return ( -
- wallet sign check - -

Welcome, thanks for joining Ink

- - - Share the announcement of Ink with your community - - - - } - > - SHARE ON X - - -
- ); -}; diff --git a/src/components/Noisy/NoisyCard.tsx b/src/components/Noisy/NoisyCard.tsx deleted file mode 100644 index 0df517f..0000000 --- a/src/components/Noisy/NoisyCard.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -import { NoisyContainer } from "./NoisyContainer"; - -interface NoisyCardProps extends PropsWithChildren { - className?: string; - url: string; -} - -export const NoisyCard: React.FC = ({ - className, - children, - url, -}) => { - return ( - - - {children} - - - ); -}; diff --git a/src/components/Noisy/NoisyContainer.tsx b/src/components/Noisy/NoisyContainer.tsx deleted file mode 100644 index e79326b..0000000 --- a/src/components/Noisy/NoisyContainer.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -export interface NoisyContainerProps extends PropsWithChildren { - className?: string; - rounded?: "2xl" | "3xl" | "spotlight" | "events" | "card"; -} - -export const NoisyContainer: React.FC = ({ - className, - rounded, - children, -}) => { - const rounding = { - "rounded-2xl": rounded === "2xl", - "rounded-3xl": rounded === "3xl", - "rounded-events": rounded === "events", - "rounded-spotlight-mobile-content lg:rounded-spotlight-content": - rounded === "spotlight", - "rounded-card": rounded === "card", - }; - return ( -
- {children} -
-
- ); -}; diff --git a/src/components/Noisy/index.ts b/src/components/Noisy/index.ts deleted file mode 100644 index be82c9d..0000000 --- a/src/components/Noisy/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./NoisyCard"; -export * from "./NoisyContainer"; diff --git a/src/components/PillContainer.tsx b/src/components/PillContainer.tsx deleted file mode 100644 index 652d3b4..0000000 --- a/src/components/PillContainer.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { PropsWithChildren } from "react"; -import { cva, type VariantProps } from "class-variance-authority"; - -import { cn } from "@/lib/utils"; - -const pillContainerVariants = cva( - "rounded-full backdrop-blur-xl px-6 py-2 transition-colors duration-200", - { - variants: { - variant: { - transparent: "bg-white/25 dark:bg-black/25", - purple: "bg-purple-pill-gradient text-blackMagic", - "ink-kit": - "ink:bg-background-container ink:text-text-primary px-3 py-1", - }, - withHover: { - true: "hover:text-blackMagic/50 dark:hover:text-whiteMagic/50", - }, - }, - defaultVariants: { - variant: "transparent", - }, - } -); - -export interface PillContainerProps - extends PropsWithChildren, - VariantProps { - className?: string; -} - -export const PillContainer: React.FC = ({ - className, - withHover, - variant, - ...props -}) => { - return ( -
- ); -}; - -PillContainer.displayName = "PillContainer"; diff --git a/src/components/PillLink/PillLink.css b/src/components/PillLink/PillLink.css deleted file mode 100644 index 198acea..0000000 --- a/src/components/PillLink/PillLink.css +++ /dev/null @@ -1,9 +0,0 @@ -.pill-gradient { - /** I don't know why, but I needed to switch the two colors copied over from Figma to get the right gradient */ - background: radial-gradient( - 367.31% 2457.04% at 354.39% 128.21%, - #8049f2 0%, - rgba(109, 78, 174, 0) 100% - ), - radial-gradient(100.63% 100.63% at 50% -0.32%, #2e2e2e 0%, #080808 100%); -} diff --git a/src/components/PillLink/PillLink.tsx b/src/components/PillLink/PillLink.tsx deleted file mode 100644 index dfdc119..0000000 --- a/src/components/PillLink/PillLink.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from "react"; - -import { HrefProp, Link } from "@/routing"; -import { classNames } from "@/util/classes"; - -import { NoisyContainer } from "../Noisy"; - -import "./PillLink.css"; - -export interface PillLinkProps { - href: HrefProp; - className?: string; - children: React.ReactNode; -} - -export const PillLink: React.FC = ({ - href, - className, - children, -}) => { - return ( - - - {children} - - - ); -}; diff --git a/src/components/PillLink/index.ts b/src/components/PillLink/index.ts deleted file mode 100644 index f50ecc6..0000000 --- a/src/components/PillLink/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./PillLink"; diff --git a/src/components/Providers.tsx b/src/components/Providers.tsx index 2d01420..19b6a5b 100644 --- a/src/components/Providers.tsx +++ b/src/components/Providers.tsx @@ -2,7 +2,6 @@ import { PropsWithChildren } from "react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { NewsletterFormContextProvider } from "@/components/NewsletterForm/NewsletterFormContext"; import { AnalyticsProvider } from "@/contexts/AnalyticsProvider"; import { RelayProvider } from "@/contexts/RelayProvider"; import { ThemeProvider } from "@/contexts/ThemeProvider"; @@ -12,7 +11,6 @@ import { useGlobalKeyCallback } from "@/hooks/useGlobalKey"; import { AppSubmissionModalProvider } from "./AppSubmissionModal/AppSubmissionModalContext"; import { ContactUsModalContextProvider } from "./ContactUsModal/ContactUsModalContext"; -import { MobileMenuContextProvider } from "./MobileMenu/MobileMenuContext"; import { NewsletterModalContextProvider } from "./NewsletterModal/NewsletterModalContext"; const queryClient = new QueryClient(); @@ -26,17 +24,13 @@ export const Providers: React.FC = ({ children }) => { - - - - - - {children} - - - - - + + + + {children} + + + diff --git a/src/components/PurpleSpotlightSection.tsx b/src/components/PurpleSpotlightSection.tsx deleted file mode 100644 index de8ee21..0000000 --- a/src/components/PurpleSpotlightSection.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { ColoredText } from "./ColoredText"; - -export interface PurpleSpotlightSectionProps { - title: React.ReactNode; - callToAction: React.ReactNode; - className?: string; -} - -export const PurpleSpotlightSection: React.FC = ({ - title, - callToAction, - className = "", -}) => { - return ( -
- - {title} - - -
{callToAction}
-
- ); -}; diff --git a/src/components/ResponsiveText.tsx b/src/components/ResponsiveText.tsx deleted file mode 100644 index b053767..0000000 --- a/src/components/ResponsiveText.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from "react"; - -export interface ResponsiveTextProps { - mobile: React.ReactNode; - desktop: React.ReactNode; -} - -export const ResponsiveText: React.FC = ({ - desktop, - mobile, -}) => { - return ( - <> - {desktop} - {mobile} - - ); -}; diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx deleted file mode 100644 index 00408ee..0000000 --- a/src/components/SearchBar/SearchBar.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { useMemo, useRef, useState } from "react"; -import Image from "next/image"; - -import { useOutsideClickListener } from "@/hooks/useOnOutsideClick"; -import { classNames } from "@/util/classes"; - -import { ArrowOnHover } from "../ArrowOnHover"; -import { PillContainer } from "../PillContainer"; - -import { SearchInput } from "./SearchInput"; - -export interface SearchBarItem { - id: string; - name: string; - imageUrl: string; - badges?: React.ReactNode[]; - href: string; - searchTerms: string; -} - -export interface SearchBarProps { - className?: string; - items: SearchBarItem[]; - placeholder: string; -} - -export const SearchBar: React.FC = ({ - className, - items, - ...inputProps -}) => { - const inputRef = useRef(null); - const popoverRef = useRef(null); - const [searchTerm, setSearchTerm] = useState(""); - const [isInputFocused, setIsInputFocused] = useState(false); - const filteredItems = useMemo( - () => - items - .filter((item) => - item.searchTerms.toLowerCase().includes(searchTerm.toLowerCase()) - ) - .sort((a, b) => a.name.localeCompare(b.name)) - .slice(0, 5), - [searchTerm, items] - ); - - function closeAll() { - setIsInputFocused(false); - } - - useOutsideClickListener({ - ref: popoverRef, - handler: closeAll, - }); - - return ( -
- setIsInputFocused(true)} - onFocus={() => setIsInputFocused(true)} - {...inputProps} - /> - -
- {isInputFocused && ( -
- {filteredItems.length === 0 && ( -
No results found
- )} - {filteredItems.map((item) => ( - -
- {item.name} - {item.name} -
-
- {item.badges?.map((badge, index) => ( - -
{badge}
-
- ))} - -
-
- ))} -
- )} -
-
- ); -}; diff --git a/src/components/SpotlightSection.tsx b/src/components/SpotlightSection.tsx deleted file mode 100644 index 5b145be..0000000 --- a/src/components/SpotlightSection.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import React, { PropsWithChildren } from "react"; - -import { classNames } from "@/util/classes"; - -import { ColoredText } from "./ColoredText"; -import { MagneticHoverEffect } from "./MagneticHoverEffect"; -import { NoisyContainer } from "./Noisy"; - -export interface SpotlightSectionProps { - title: React.ReactNode; - description: React.ReactNode; - image: React.ReactNode; - imagePosition: "left" | "right"; - pill: React.ReactNode; - newLayout?: boolean; -} - -export const SpotlightSection: React.FC = ({ - title, - description, - image, - imagePosition, - pill, - newLayout = false, -}) => { - return ( -
- {image} -
-
- {pill &&
{pill}
} - -
- - {title} - -
- {description} -
-
-
-
-
- ); -}; - -const ImageContainer: React.FC = ({ children }) => ( - - -
{children}
-
-
-); diff --git a/src/components/TablePagination/TablePaginationBar.tsx b/src/components/TablePagination/TablePaginationBar.tsx deleted file mode 100644 index 8d45cbb..0000000 --- a/src/components/TablePagination/TablePaginationBar.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { classNames } from "@/util/classes"; - -import { ChevronLeftIcon } from "../icons/ChevronLeft"; -import { ChevronRightIcon } from "../icons/ChevronRight"; -import { DoubleChevronLeftIcon } from "../icons/DoubleChevronLeft"; -import { DoubleChevronRightIcon } from "../icons/DoubleChevronRight"; - -interface TablePaginationBarProps { - currentPage: number; - totalItems: number; - perPage: number; - onPageChange: (page: number) => void; - className?: string; -} - -export const TablePaginationBar: React.FC = ({ - currentPage, - totalItems, - perPage, - onPageChange, - className, -}) => { - const totalPages = Math.ceil(totalItems / perPage); - const pages = Array.from({ length: totalPages }, (_, i) => i); - const lastPage = totalPages - 1; - const buttonClassName = - "size-6 rounded-md text-blackMagic/75 dark:text-whiteMagic/75 hover:bg-blackMagic/10 dark:hover:bg-whiteMagic/10 disabled:opacity-50 disabled:cursor-not-allowed text-body-2 font-bold flex items-center justify-center justify-center"; - - if (totalItems === 0) return null; - - return ( -
- - - -
- {pages.map((page) => ( - - ))} -
- - - - -
- ); -}; diff --git a/src/components/TablePagination/index.ts b/src/components/TablePagination/index.ts deleted file mode 100644 index f840c49..0000000 --- a/src/components/TablePagination/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./TablePaginationBar"; -export * from "./usePagination"; diff --git a/src/components/TablePagination/usePagination.ts b/src/components/TablePagination/usePagination.ts deleted file mode 100644 index 4db4d80..0000000 --- a/src/components/TablePagination/usePagination.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { useMemo, useState } from "react"; - -import { useCallbackOnKey } from "@/hooks/useGlobalKey"; - -interface UsePaginationProps { - items: T[]; - perPage: number; - /** First page is 0. */ - initialPage?: number; -} - -function getCurrentlyDisplayed(page: number, perPage: number, items: T[]) { - return items.slice(page * perPage, (page + 1) * perPage); -} - -export function usePagination({ - items, - perPage, - initialPage = 0, -}: UsePaginationProps) { - const [currentPage, setCurrentPage] = useState(initialPage); - const totalPages = Math.ceil(items.length / perPage); - - const currentItems = useMemo(() => { - return getCurrentlyDisplayed(currentPage, perPage, items); - }, [currentPage, perPage, items]); - - const isOnFirstPage = currentPage === 0; - const isOnLastPage = currentPage === totalPages - 1; - const previousPage = () => setCurrentPage(Math.max(currentPage - 1, 0)); - const nextPage = () => - setCurrentPage(Math.min(currentPage + 1, totalPages - 1)); - - useCallbackOnKey({ - isDisabled: isOnFirstPage, - key: "ArrowLeft", - handler: () => { - previousPage(); - return true; - }, - }); - useCallbackOnKey({ - isDisabled: isOnLastPage, - key: "ArrowRight", - handler: () => { - nextPage(); - return true; - }, - }); - - return { - currentPage, - setCurrentPage, - currentItems, - totalPages, - }; -} diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx deleted file mode 100644 index 85c8b57..0000000 --- a/src/components/ThemeToggle.tsx +++ /dev/null @@ -1,54 +0,0 @@ -"use client"; - -import React, { useEffect, useState } from "react"; -import { sendGTMEvent } from "@next/third-parties/google"; -import { useTheme } from "next-themes"; - -import { MoonIcon } from "@/components/icons/Moon"; -import { SunIcon } from "@/components/icons/Sun"; -import { pushToDataLayer } from "@/util/dataLayer"; - -import { RoundedIconButton } from "./Button/RoundedIconButton"; - -export const ThemeToggle = () => { - const { resolvedTheme, setTheme } = useTheme(); - const [isMounted, setIsMounted] = useState(false); - - const onToggleTheme = () => { - const newTheme = resolvedTheme == "dark" ? "light" : "dark"; - setTheme(newTheme); - sendGTMEvent({ event: "theme_change", theme: newTheme }); - }; - - /** - * This is not ideal, but it's best solution we have to avoid rendering the button - * with the wrong color/icon - */ - useEffect(() => { - setIsMounted(true); - }, [setIsMounted]); - - useEffect(() => { - if (resolvedTheme) { - pushToDataLayer({ theme: resolvedTheme }); - } - }, [resolvedTheme]); - - if (!isMounted) { - return null; - } - - return ( - - {resolvedTheme === "light" ? ( - - ) : ( - - )} - - ); -}; diff --git a/src/components/TwoOverlapingLayout.tsx b/src/components/TwoOverlapingLayout.tsx deleted file mode 100644 index 3bf5a94..0000000 --- a/src/components/TwoOverlapingLayout.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { classNames } from "@/util/classes"; - -export interface TwoOverlappingLayoutProps { - className?: string; - first: React.ReactNode; - second: React.ReactNode; - shown: "first" | "second"; -} - -/** Use this component if you want to switch between two sides within the same space, with a fade-in-out animation */ -export const TwoOverlappingLayout: React.FC = ({ - className, - first, - second, - shown, -}) => ( -
-
- {first} -
-
- {second} -
-
-); diff --git a/src/components/WalletConnector.tsx b/src/components/WalletConnector.tsx deleted file mode 100644 index e62ae6f..0000000 --- a/src/components/WalletConnector.tsx +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; - -import { ConnectButton } from "@rainbow-me/rainbowkit"; - -export const WalletConnector = () => { - return ; -}; diff --git a/src/components/icons/ArrowRight.tsx b/src/components/icons/ArrowRight.tsx deleted file mode 100644 index 874bc31..0000000 --- a/src/components/icons/ArrowRight.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ArrowRightIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/ArrowTopRight.tsx b/src/components/icons/ArrowTopRight.tsx deleted file mode 100644 index 99fc174..0000000 --- a/src/components/icons/ArrowTopRight.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ArrowTopRightIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Bell.tsx b/src/components/icons/Bell.tsx deleted file mode 100644 index 4d052bc..0000000 --- a/src/components/icons/Bell.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const BellIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Burger.tsx b/src/components/icons/Burger.tsx deleted file mode 100644 index 68c872b..0000000 --- a/src/components/icons/Burger.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const BurgerIcon: React.FC = (props) => { - return ( - - - - - - ); -}; diff --git a/src/components/icons/Chain.tsx b/src/components/icons/Chain.tsx deleted file mode 100644 index fe4538d..0000000 --- a/src/components/icons/Chain.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ChainIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/ChevronLeft.tsx b/src/components/icons/ChevronLeft.tsx deleted file mode 100644 index bd231b2..0000000 --- a/src/components/icons/ChevronLeft.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ChevronLeftIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/ChevronRight.tsx b/src/components/icons/ChevronRight.tsx deleted file mode 100644 index 8585840..0000000 --- a/src/components/icons/ChevronRight.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ChevronRightIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/CircleExclamationMark.tsx b/src/components/icons/CircleExclamationMark.tsx deleted file mode 100644 index 8a615a9..0000000 --- a/src/components/icons/CircleExclamationMark.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const CircleExclamationMarkIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Collapse.tsx b/src/components/icons/Collapse.tsx deleted file mode 100644 index d512dd5..0000000 --- a/src/components/icons/Collapse.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const CollapseIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Dots.tsx b/src/components/icons/Dots.tsx deleted file mode 100644 index 5dd5583..0000000 --- a/src/components/icons/Dots.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const DotsIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/DotsInCircle.tsx b/src/components/icons/DotsInCircle.tsx deleted file mode 100644 index 8e73f7b..0000000 --- a/src/components/icons/DotsInCircle.tsx +++ /dev/null @@ -1,548 +0,0 @@ -import { ThemedIcon } from "./ThemedIcon"; -import { type IconProps, iconProps } from "./types"; - -export const DotsInCircleIcon: React.FC = (props) => { - return ( - - ); -}; - -const DotsInCircleLight: React.FC> = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -const DotsInCircleDark: React.FC> = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/DoubleChevronLeft.tsx b/src/components/icons/DoubleChevronLeft.tsx deleted file mode 100644 index b70c8f3..0000000 --- a/src/components/icons/DoubleChevronLeft.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const DoubleChevronLeftIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/DoubleChevronRight.tsx b/src/components/icons/DoubleChevronRight.tsx deleted file mode 100644 index eed3e53..0000000 --- a/src/components/icons/DoubleChevronRight.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const DoubleChevronRightIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Expand.tsx b/src/components/icons/Expand.tsx deleted file mode 100644 index 1346405..0000000 --- a/src/components/icons/Expand.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const ExpandIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/Farcaster.tsx b/src/components/icons/Farcaster.tsx deleted file mode 100644 index 8be47b4..0000000 --- a/src/components/icons/Farcaster.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const FarcasterIcon: React.FC = (props) => { - return ( - - - - - - ); -}; diff --git a/src/components/icons/History.tsx b/src/components/icons/History.tsx deleted file mode 100644 index c4ac5af..0000000 --- a/src/components/icons/History.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const History: React.FC = (props) => { - return ( - - - - - ); -}; diff --git a/src/components/icons/Icon.tsx b/src/components/icons/Icon.tsx deleted file mode 100644 index 7fe8b3c..0000000 --- a/src/components/icons/Icon.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Image, { ImageProps } from "next/image"; - -const icons = { - mail: { - src: "/icons/mail.svg", - width: 20, - height: 20, - alt: "mail", - }, -} as const satisfies Record; - -export interface IconProps { - name: keyof typeof icons; -} - -export const Icon: React.FC = ({ name }) => { - return {icons[name].alt}; -}; diff --git a/src/components/icons/InkIcon.tsx b/src/components/icons/InkIcon.tsx deleted file mode 100644 index ede7153..0000000 --- a/src/components/icons/InkIcon.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const InkIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/InkLogo.tsx b/src/components/icons/InkLogo.tsx deleted file mode 100644 index 9f6b0b9..0000000 --- a/src/components/icons/InkLogo.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const AnimatedInkLogoIcon: React.FC = () => { - return ( - - ); -}; - -export const InkLogoIcon: React.FC = ({ - animated, - ...props -}) => { - return ( - - - - - - - - - ); -}; diff --git a/src/components/icons/Language.tsx b/src/components/icons/Language.tsx deleted file mode 100644 index df19cf7..0000000 --- a/src/components/icons/Language.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const LanguageIcon: React.FC = (props) => { - return ( - - - - ); -}; diff --git a/src/components/icons/SquareDivider.tsx b/src/components/icons/SquareDivider.tsx deleted file mode 100644 index 7d12d5a..0000000 --- a/src/components/icons/SquareDivider.tsx +++ /dev/null @@ -1,18 +0,0 @@ -export const SquareDividerIcon: React.FC<{ className?: string }> = ({ - className, -}) => ( - - - -); diff --git a/src/components/icons/Testnet-Dark.tsx b/src/components/icons/Testnet-Dark.tsx deleted file mode 100644 index 9c03770..0000000 --- a/src/components/icons/Testnet-Dark.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { type IconProps, iconProps } from "./types"; - -export const TestnetDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/ThemedIcon.tsx b/src/components/icons/ThemedIcon.tsx deleted file mode 100644 index 6a52d31..0000000 --- a/src/components/icons/ThemedIcon.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { classNames } from "@/util/classes"; - -import { IconProps } from "./types"; - -export const ThemedIcon = ({ - Light: Light, - Dark: Dark, - ...props -}: IconProps & { - Light: React.FC; - Dark: React.FC; -}) => { - if (props.enforce === "black") { - return ; - } - if (props.enforce === "white") { - return ; - } - return ( - <> - - - - ); -}; diff --git a/src/components/icons/bullets/About.tsx b/src/components/icons/bullets/About.tsx deleted file mode 100644 index 4b0243a..0000000 --- a/src/components/icons/bullets/About.tsx +++ /dev/null @@ -1,304 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const AboutBulletIcon: React.FC = (props) => { - return ; -}; - -const AboutLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -const AboutDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Bridge.tsx b/src/components/icons/bullets/Bridge.tsx deleted file mode 100644 index c47d12a..0000000 --- a/src/components/icons/bullets/Bridge.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const BridgeBulletIcon: React.FC = (props) => { - return ( - - ); -}; - -const BridgeBulletLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - ); -}; - -const BridgeBulletDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Builders.tsx b/src/components/icons/bullets/Builders.tsx deleted file mode 100644 index 3cea3e1..0000000 --- a/src/components/icons/bullets/Builders.tsx +++ /dev/null @@ -1,304 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const BuildersBulletIcon: React.FC = (props) => { - return ; -}; - -const BuildersLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -const BuildersDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Community.tsx b/src/components/icons/bullets/Community.tsx deleted file mode 100644 index 8f27471..0000000 --- a/src/components/icons/bullets/Community.tsx +++ /dev/null @@ -1,186 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const CommunityBulletIcon: React.FC = (props) => { - return ; -}; - -const CommunityLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -const CommunityDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Contact.tsx b/src/components/icons/bullets/Contact.tsx deleted file mode 100644 index fd844bd..0000000 --- a/src/components/icons/bullets/Contact.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const ContactBulletIcon: React.FC = (props) => { - return ; -}; - -const ContactLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - ); -}; - -const ContactDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Docs.tsx b/src/components/icons/bullets/Docs.tsx deleted file mode 100644 index 0613e43..0000000 --- a/src/components/icons/bullets/Docs.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const DocsBulletIcon: React.FC = (props) => { - return ; -}; - -const DocsIconLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - ); -}; - -const DocsIconDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Events.tsx b/src/components/icons/bullets/Events.tsx deleted file mode 100644 index 93bcbf5..0000000 --- a/src/components/icons/bullets/Events.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const EventsBulletIcon: React.FC = (props) => { - return ; -}; - -const EventsLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - ); -}; - -const EventsDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Faucet.tsx b/src/components/icons/bullets/Faucet.tsx deleted file mode 100644 index f202c81..0000000 --- a/src/components/icons/bullets/Faucet.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const FaucetBulletIcon: React.FC = (props) => { - return ( - - ); -}; - -const FaucetIconLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - ); -}; - -const FaucetIconDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/GitHub.tsx b/src/components/icons/bullets/GitHub.tsx deleted file mode 100644 index 5053819..0000000 --- a/src/components/icons/bullets/GitHub.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const GitHubBulletIcon: React.FC = (props) => { - return ( - - ); -}; - -const GitHubIconLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - ); -}; - -const GitHubIconDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Status.tsx b/src/components/icons/bullets/Status.tsx deleted file mode 100644 index 53b907f..0000000 --- a/src/components/icons/bullets/Status.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const StatusBulletIcon: React.FC = (props) => { - return ( - - ); -}; - -const StatusIconLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - ); -}; - -const StatusIconDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/bullets/Testnet.tsx b/src/components/icons/bullets/Testnet.tsx deleted file mode 100644 index bd22070..0000000 --- a/src/components/icons/bullets/Testnet.tsx +++ /dev/null @@ -1,370 +0,0 @@ -import { ThemedIcon } from "../ThemedIcon"; -import { type IconProps, iconProps } from "../types"; - -export const TestnetBulletIcon: React.FC = (props) => { - return ( - - ); -}; - -const TestnetIconLight: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -const TestnetIconDark: React.FC = (props) => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; diff --git a/src/components/icons/news/Decrypt.tsx b/src/components/icons/news/Decrypt.tsx deleted file mode 100644 index 04347c3..0000000 --- a/src/components/icons/news/Decrypt.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { type IconProps, iconProps } from "../types"; - -// A quick and easy way to test the Decrypt icon. -// TODO: Think about how it could be provided easily when a News article has a new icon (from the CMS?) -export const DecryptIcon: React.FC = (props) => { - return ( - - - - - - - - - - - ); -}; diff --git a/src/components/styles/header.ts b/src/components/styles/header.ts deleted file mode 100644 index f57b8c8..0000000 --- a/src/components/styles/header.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const popupHeader = () => - "uppercase text-left text-header h-14 p-4 pl-10 w-full border-b flex justify-between items-center border-gray-300 font-medium"; - -export const popupContent = () => - "h-full overflow-y-scroll overflow-x-hidden px-4 py-2 pb-8"; diff --git a/src/contexts/wallet-context.ts b/src/contexts/wallet-context.ts deleted file mode 100644 index 327aef3..0000000 --- a/src/contexts/wallet-context.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { createContext, Dispatch, SetStateAction, useContext } from "react"; -import { ethers } from "ethers"; - -interface WalletContextType { - address?: `0x${string}`; - chainId?: number; - isConnected?: boolean; - provider: ethers.BrowserProvider | undefined; - signer: ethers.Signer | undefined; - walletAddress: string | undefined; - setProvider: Dispatch>; - setSigner: Dispatch>; - setWalletAddress: Dispatch>; -} - -const defaultProviderState: WalletContextType = { - address: undefined, - chainId: undefined, - isConnected: undefined, - provider: undefined, - signer: undefined, - walletAddress: undefined, - setProvider: () => {}, - setSigner: () => {}, - setWalletAddress: () => {}, -}; - -export const WalletContext = - createContext(defaultProviderState); - -export const useWalletContext = () => useContext(WalletContext);