Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tong/453 connect wallet panel #472

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions src/app/components/Staking/Form/States/WalletNotConnected.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
import { Button, Heading, Text } from "@babylonlabs-io/bbn-core-ui";
import Image from "next/image";

import { useBTCWallet } from "@/app/context/wallet/BTCWalletProvider";
import { getNetworkConfig } from "@/config/network.config";

import connectIcon from "./connect-icon.svg";
import walletIcon from "./wallet-icon.svg";

export const WalletNotConnected = () => {
const { open } = useBTCWallet();
const { coinName } = getNetworkConfig();

return (
<div className="flex flex-1 flex-col">
<div className="flex flex-1 flex-col items-center justify-center gap-2 py-12">
<div className="rounded-full bg-base-200 p-4">
<Image src={walletIcon} alt="Wallet" width={32} height={32} />
<div className="flex flex-1 flex-col items-center justify-center gap-8">
<div className="rotate-12">
<Image src={walletIcon} alt="Wallet" width={120} height={122} />
</div>
<h3 className="font-bold">Connect wallet</h3>
<p className="text-center text-sm font-light dark:text-neutral-content">
Please connect wallet to start staking
</p>
<div className="flex flex-col gap-2 justify-center items-center self-stretch">
<Heading variant="h5" className="text-primary-dark text-2xl">
Connect wallet to start staking
</Heading>
<Text
variant="body1"
className="text-center text-base text-primary-light p-0"
>
To start staking your {coinName} first connect wallets then select a
Finality Provider
</Text>
</div>
<Button variant="outlined" onClick={open} className="text-primary-dark">
Connect wallet
</Button>
</div>
<button className="btn-primary btn" onClick={open}>
<Image src={connectIcon} alt="Connect wallet" />
Connect wallet
</button>
</div>
);
};
116 changes: 105 additions & 11 deletions src/app/components/Staking/Form/States/wallet-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/app/components/Staking/Staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,16 +563,15 @@ export const Staking = () => {
<Heading variant="h4" className="text-primary-dark md:text-4xl">
Bitcoin Staking
</Heading>
<div className="flex flex-col gap-4 lg:flex-row">
<div className="flex flex-1 flex-col gap-4 lg:basis-3/5 xl:basis-2/3 p-6 rounded border bg-secondary-contrast border-primary-light/20">
<div className="flex flex-col gap-6 lg:flex-row">
<div className="flex flex-col gap-4 lg:basis-3/5 xl:basis-2/3 p-6 rounded border bg-secondary-contrast border-primary-light/20">
<FinalityProviders
onFinalityProvidersLoad={setFinalityProviders}
selectedFinalityProvider={finalityProvider}
onFinalityProviderChange={handleChooseFinalityProvider}
/>
</div>
<div className="divider m-0 lg:divider-horizontal lg:m-0" />
<div className="flex flex-1 flex-col gap-4 lg:basis-2/5 xl:basis-1/3 p-6 rounded border bg-secondary-contrast border-primary-light/20">
<div className="flex flex-col gap-4 lg:basis-2/5 xl:basis-1/3 p-6 rounded border bg-secondary-contrast border-primary-light/20">
{renderStakingForm()}
</div>
</div>
Expand Down