Skip to content

Commit

Permalink
tweak connect popup title #5285
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed Feb 19, 2025
1 parent 03b10fe commit 47d5f7b
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions packages/next-common/components/login/index.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
import { useState } from "react";
import LoginAccount from "./account";
import LoginWeb3 from "./web3";
import { useWeb3WalletView } from "next-common/hooks/connect/useWeb3WalletView";

function Title({ isWeb3 = true, isWalletConnectView = false }) {
let action;
let type;

if (isWeb3) {
action = "Connect";
type = "Address";

if (isWalletConnectView) {
type = "WalletConnect";
}
} else {
action = "Login";
type = "Account";
}

function Title({ isWeb3 = true }) {
return (
<h3 className="text20Bold text-textPrimary">
<span>{isWeb3 ? "Connect" : "Login"} with </span>
<span className="text-theme500">{isWeb3 ? "Address" : "Account"}</span>
<span>{action} with </span>
<span className="text-theme500">{type}</span>
</h3>
);
}

export default function Login() {
const [isWeb3, setIsWeb3] = useState(true);
const { isWalletConnectView } = useWeb3WalletView();

return (
<div className="space-y-6">
<Title isWeb3={isWeb3} />
<Title isWeb3={isWeb3} isWalletConnectView={isWalletConnectView} />

{isWeb3 ? (
<LoginWeb3 setIsWeb3={setIsWeb3} />
Expand Down

0 comments on commit 47d5f7b

Please sign in to comment.