Skip to content

Commit

Permalink
Feature/ik/smart wallet integration (#188)
Browse files Browse the repository at this point in the history
* update deps for smartwallet

* add base sepolia config

* add smart wallet connect button raw

* update deps for smartwallet

* fix smartwallet button visibility & text color, fix curryncy symbol at user profile

* show blockExplorer links depending on chosen network

* add base sepolia faucets & update faucets show depending on chain id
  • Loading branch information
mezger75 authored Jun 29, 2024
1 parent 9c0e3b7 commit da92a24
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 96 deletions.
226 changes: 132 additions & 94 deletions frontend/src/app/components/dropdown/dropdownFaucetMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ import {
DropdownMenuLabel,
DropdownMenuSeparator,
} from "@/app/components/ui/dropdown-menu";
import { Button } from "../ui/button";
import { Button } from "@/app/components/ui/button";
import { useAccount } from "wagmi";

function DropdownFaucetMenu() {
const { chainId } = useAccount();
console.log("ChainID:", chainId);
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
Expand All @@ -24,108 +27,143 @@ function DropdownFaucetMenu() {

<DropdownMenuPortal>
<DropdownMenuContent sideOffset={5}>
{/* <DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
ETH Scroll Sepolia
</DropdownMenuLabel>
<Link href="https://scroll.faucetme.pro/" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Faucetme
</DropdownMenuItem>
</Link>
{chainId === 84532 && (
<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
ETH Base Sepolia
</DropdownMenuLabel>
<Link href="https://app.optimism.io/faucet" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Superchain Faucet
</DropdownMenuItem>
</Link>

<Link
href="https://bwarelabs.com/faucets/scroll-testnet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
BWARE Labs
</DropdownMenuItem>
</Link>
<Link
href="https://www.alchemy.com/faucets/base-sepolia"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Alchemy Faucet
</DropdownMenuItem>
</Link>

<Link href="htthttps://www.l2faucet.com/scroll" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
L2faucet
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
<Link
href="https://learnweb3.io/faucets/base_sepolia/"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
LearnWeb3 Faucet
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
)}

<DropdownMenuSeparator className="h-[1px] bg-gray-300 m-[4px]" /> */}
{chainId === 534351 && (
<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
ETH Scroll Sepolia
</DropdownMenuLabel>
<Link href="https://scroll.faucetme.pro/" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Faucetme
</DropdownMenuItem>
</Link>

<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
BNB Faucet & Bridge
</DropdownMenuLabel>
<Link
href="https://www.bnbchain.org/en/testnet-faucet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
BNB Faucet
</DropdownMenuItem>
</Link>
<Link
href="https://opbnb-bridge.bnbchain.org/deposit"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Bridge to opBNB
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
<Link
href="https://bwarelabs.com/faucets/scroll-testnet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
BWARE Labs
</DropdownMenuItem>
</Link>

<Link href="https://www.l2faucet.com/scroll" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
L2faucet
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
)}

{/* <DropdownMenuSeparator className="h-[1px] bg-gray-300 m-[4px]" /> */}

{/* <DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
Matic Polygon Amoy
</DropdownMenuLabel>
<Link
href="https://www.alchemy.com/faucets/polygon-amoy"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Alchemy faucet
</DropdownMenuItem>
</Link>
<Link href="https://faucet.polygon.technology/" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Polygon faucet
</DropdownMenuItem>
</Link>
<Link
href="https://faucet.trade/polygon-amoy-matic-faucet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Faucet trade
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
{chainId === 5611 && (
<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
BNB Faucet & Bridge
</DropdownMenuLabel>
<Link
href="https://www.bnbchain.org/en/testnet-faucet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
BNB Faucet
</DropdownMenuItem>
</Link>
<Link
href="https://opbnb-bridge.bnbchain.org/deposit"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Bridge to opBNB
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
)}

<DropdownMenuSeparator className="h-[1px] bg-gray-300 m-[4px]" /> */}
{chainId === 80002 && (
<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
Matic Polygon Amoy
</DropdownMenuLabel>
<Link
href="https://www.alchemy.com/faucets/polygon-amoy"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Alchemy faucet
</DropdownMenuItem>
</Link>
<Link href="https://faucet.polygon.technology/" target="_blank">
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Polygon faucet
</DropdownMenuItem>
</Link>
<Link
href="https://faucet.trade/polygon-amoy-matic-faucet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Faucet trade
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
)}

<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
ETH Blast Sepolia
</DropdownMenuLabel>
<Link
href="https://blastapi.io/faucets/blastl2-testnet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Blastapi faucet
</DropdownMenuItem>
</Link>
<Link
href="https://faucet.quicknode.com/blast/sepolia"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
QuickNode faucet
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
{chainId === 168587773 && (
<DropdownMenuGroup>
<DropdownMenuLabel className="text-sm px-3 py-1">
ETH Blast Sepolia
</DropdownMenuLabel>
<Link
href="https://blastapi.io/faucets/blastl2-testnet"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
Blastapi faucet
</DropdownMenuItem>
</Link>
<Link
href="https://faucet.quicknode.com/blast/sepolia"
target="_blank"
>
<DropdownMenuItem className="flex items-center cursor-pointer pl-[25px]">
QuickNode faucet
</DropdownMenuItem>
</Link>
</DropdownMenuGroup>
)}
</DropdownMenuContent>
</DropdownMenuPortal>
</DropdownMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export function LeaderboardCard() {
const [leaderboard, setLeaderboard] = useState<LeaderboardEntry[]>([]);
const { chainId } = useAccount();
const chainBlockExplorerLinks: Record<number, string> = {
// 5611: "https://opbnb-testnet.bscscan.com/address/",
// 168587773: "https://testnet.blastscan.io/address/",
5611: "https://opbnb-testnet.bscscan.com/address/",
168587773: "https://testnet.blastscan.io/address/",
84532: "https://sepolia.basescan.org/address/",
};

Expand Down

0 comments on commit da92a24

Please sign in to comment.