terry-wallet-login #15

Merged
terry merged 95 commits from terry-wallet-login into terry-staging 2026-06-05 16:32:43 +00:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 05c2252b49 - Show all commits

View File

@@ -723,7 +723,7 @@ export function PublicLayout() {
{t("popular")} {t("popular")}
</Link> </Link>
<div className="mt-2 w-full max-w-xs"> <div className="mt-2 w-full max-w-xs">
<WalletButton compact /> <WalletButton compact onOpenLogin={() => setOpen(false)} />
</div> </div>
</div> </div>
) : null} ) : null}

View File

@@ -2,7 +2,13 @@ import { useEffect, useRef, useState } from "react";
import { useI18n } from "../i18n"; import { useI18n } from "../i18n";
import { shortenAddress, useWallet } from "./WalletProvider"; import { shortenAddress, useWallet } from "./WalletProvider";
export function WalletButton({ compact = false }: { compact?: boolean }) { export function WalletButton({
compact = false,
onOpenLogin,
}: {
compact?: boolean;
onOpenLogin?: () => void;
}) {
const { t } = useI18n(); const { t } = useI18n();
const wallet = useWallet(); const wallet = useWallet();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@@ -66,7 +72,10 @@ export function WalletButton({ compact = false }: { compact?: boolean }) {
return ( return (
<button <button
type="button" type="button"
onClick={wallet.openLoginModal} onClick={() => {
onOpenLogin?.();
wallet.openLoginModal();
}}
className={[ className={[
"inline-flex h-10 items-center justify-center rounded-full border border-ark-gold/50 bg-ark-gold px-4 text-sm font-bold text-black outline-none transition hover:bg-ark-gold2 focus-visible:ring-2 focus-visible:ring-ark-gold/80 focus-visible:ring-offset-2 focus-visible:ring-offset-ark-bg", "inline-flex h-10 items-center justify-center rounded-full border border-ark-gold/50 bg-ark-gold px-4 text-sm font-bold text-black outline-none transition hover:bg-ark-gold2 focus-visible:ring-2 focus-visible:ring-ark-gold/80 focus-visible:ring-offset-2 focus-visible:ring-offset-ark-bg",
compact ? "w-full" : "", compact ? "w-full" : "",