diff --git a/.changeset/tough-insects-breathe.md b/.changeset/tough-insects-breathe.md new file mode 100644 index 000000000..65e09c5b9 --- /dev/null +++ b/.changeset/tough-insects-breathe.md @@ -0,0 +1,5 @@ +--- +"@carrot-kpi/host-frontend": minor +--- + +Add connect wallet button to wallet disconnected modal diff --git a/packages/frontend/src/components/authenticate/index.tsx b/packages/frontend/src/components/authenticate/index.tsx index 5d0190202..176401b21 100644 --- a/packages/frontend/src/components/authenticate/index.tsx +++ b/packages/frontend/src/components/authenticate/index.tsx @@ -3,9 +3,9 @@ import React, { useCallback, useEffect, useState } from "react"; import LogoIcon from "../../icons/logo-icon"; import { t } from "i18next"; import { useAccount, useSignMessage } from "wagmi"; -import WalletDisconnected from "../../icons/wallet-disconnected"; import { useSetPinningProxyJWT } from "../../hooks/useSetPinningProxyJWT"; import { PINNING_PROXY_URL } from "../../constants"; +import { WalletDisconnected } from "../wallet-disconnected"; interface AuthenticateProps { onCancel: () => void; @@ -112,17 +112,7 @@ export const Authenticate = ({ onCancel }: AuthenticateProps) => { ) : ( - <> - -
- - {t("wallet.disconnected.title")} - - - {t("wallet.disconnected.description")} - -
- + )} diff --git a/packages/frontend/src/components/connect-wallet/index.tsx b/packages/frontend/src/components/connect-wallet/index.tsx index eb4feb54f..bf526cebf 100644 --- a/packages/frontend/src/components/connect-wallet/index.tsx +++ b/packages/frontend/src/components/connect-wallet/index.tsx @@ -16,12 +16,17 @@ import { cva } from "class-variance-authority"; const rootStyles = cva(["flex", "gap-4"]); interface ConnectWalletProps { + chainList?: boolean; className?: { root?: string; + connectButton?: string; }; } -export const ConnectWallet = ({ className }: ConnectWalletProps) => { +export const ConnectWallet = ({ + chainList = true, + className, +}: ConnectWalletProps) => { const { t } = useTranslation(); const { chain } = useNetwork(); const { address, connector: activeConnector } = useAccount(); @@ -127,42 +132,45 @@ export const ConnectWallet = ({ className }: ConnectWalletProps) => { /> )}
-
- } - /> -
- - {t("connect.wallet.network")} - - - {supportedChain ? chainName : "Unsupported"} - + ref={setNetworksPopoverAnchor} + > + } + /> +
+ + {t("connect.wallet.network")} + + + {supportedChain ? chainName : "Unsupported"} + +
+ {!__LIBRARY_MODE__ && multipleEnabledChains && ( + + )}
- {!__LIBRARY_MODE__ && multipleEnabledChains && ( - - )} -
+ )} {address ? ( ) : (
) : ( - <> - -
- - {t("wallet.disconnected.title")} - - - {t("wallet.disconnected.description")} - -
- + )} diff --git a/packages/frontend/src/components/ui/navbar/index.tsx b/packages/frontend/src/components/ui/navbar/index.tsx index aacb44164..23542a4ed 100644 --- a/packages/frontend/src/components/ui/navbar/index.tsx +++ b/packages/frontend/src/components/ui/navbar/index.tsx @@ -131,7 +131,11 @@ export const Navbar = ({
- +