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

feat: updated backstop pool ui #206

Merged
merged 1 commit into from
Jul 6, 2023
Merged
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
40 changes: 17 additions & 23 deletions src/components/Pools/Backstop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Button, Card } from 'react-daisyui';
import { cacheKeys } from '../../../constants/cache';
import { BackstopPool as IBackstopPool } from '../../../models/BackstopPool';
import { assetsApi } from '../../../services/api/assets';
import AssetBadge from '../../Asset/Badge';
import { Skeleton } from '../../Skeleton';
import BackstopPoolModal from './Modal';

Expand All @@ -17,32 +16,27 @@ const BackstopPools = (): JSX.Element | null => {
);

if (isLoading) return <Skeleton className="bg-gray-200 h-48 w-full" />;
const pool = data?.[0];
if (!pool) return null;
return (
<>
<div className="center gap-4 w-full">
{data?.map((pool, i) => (
<Card key={i} bordered className="w-full max-w-xl bg-base-100 shadow-md">
<div className="card-body p-4 md:p-6 text-gray-800">
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2 flex-wrap">
{pool.assets.map((asset, i) => (
<AssetBadge size="lg" key={i}>
{asset.symbol}
</AssetBadge>
))}
</div>
<div className="flex items-center flex-wrap gap-2">
<Button variant="outline" size="sm" onClick={() => setSelected([pool, 'deposit'])}>
Deposit
</Button>
<Button variant="outline" size="sm" onClick={() => setSelected([pool, 'withdraw'])}>
Withdraw
</Button>
</div>
</div>
<Card bordered className="w-full max-w-xl bg-base-200">
<div className="card-body p-4 md:p-6 text-gray-800">
<div className="flex items-center justify-between gap-2 text-3xl">
<h2>My pool balance</h2>
<div>$0.78</div>
</div>
</Card>
))}
<div className="flex flex-col items-center gap-2 mt-4">
<Button className="w-full" color="primary" onClick={() => setSelected([pool, 'deposit'])}>
Add Liquidity
</Button>
<Button className="w-full" onClick={() => setSelected([pool, 'withdraw'])}>
Withdraw
</Button>
</div>
</div>
</Card>
</div>
<BackstopPoolModal pool={selected?.[0]} type={selected?.[1]} onClose={() => setSelected(undefined)} />
</>
Expand Down