Skip to content

Commit fc9ca20

Browse files
author
sloth
committed
feat: redesign UI with modern swap interface
- Completely redesign Swap component with modern card-based layout - Add gradient backgrounds and smooth animations - Implement responsive design for mobile and desktop - Create beautiful wallet connection interface - Add enhanced wallet selection modal with improved styling - Remove outdated components (ApiKeyInput, CreatePools, Deposit) - Simplify app header with clean InSwap integration description UI Improvements: - Modern gradient card design for token input/output - Intuitive swap interface with visual arrow indicator - Real-time balance display with pending transaction info - Smooth hover effects and loading animations - Professional wallet connection flow - Mobile-responsive layout (max-width: 480px) - Enhanced button states and user feedback UX Enhancements: - Clear visual hierarchy and spacing - User-friendly error messages - Loading states with progress indicators - Accessible color scheme and typography - Simplified navigation and reduced cognitive load
1 parent 6b7ec64 commit fc9ca20

File tree

8 files changed

+785
-625
lines changed

8 files changed

+785
-625
lines changed

brc20-swap-demo/src/App.tsx

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
import React from 'react';
2-
import './styles/App.css';
3-
import {Card, Tabs} from "antd";
4-
import {Swap} from "./components/Swap";
5-
import {ApiKeyInput} from "./components/ApiKeyInput";
6-
import {Deposit} from "./components/Deposit";
1+
import React from "react";
2+
import "./styles/App.css";
3+
import { Card, Tabs } from "antd";
4+
import { Swap } from "./components/Swap";
75

86
function App() {
9-
return (
10-
<div className="app">
11-
<div className="main-container">
12-
<ApiKeyInput/>
13-
<Card size={'small'} className={'mt-16'}>
14-
<ol>
15-
<li>Input your Api Key and refresh page</li>
16-
<li>Connect UniSat wallet.</li>
17-
<li>Click 'Deposit' tab, click 'Mint sats' to mint some sats.(<a
18-
href="https://fractal-testnet.unisat.io/explorer/faucet">get tFB</a>)
19-
</li>
20-
<li>Choose 'sats' and click 'inscribe transfer' to create transfer-inscription</li>
21-
<li>Choose one transfer-inscription to deposit(it may need some confirmations).</li>
22-
<li>Click 'swap' tab, input your pay sats then click swap</li>
23-
</ol>
24-
</Card>
25-
<Card bordered={false} size={"small"} style={{marginTop: 16, paddingTop: 0}}>
26-
27-
<Tabs
28-
defaultActiveKey="1"
29-
tabPosition="top"
30-
items={[
31-
{key: "1", label: "Swap", children: <Swap/>},
32-
{key: "2", label: "Deposit", children: <Deposit/>},
33-
// {key: "3", label: "Pools", children: <CreatePools/>},
34-
]}
35-
/>
36-
</Card>
37-
</div>
38-
</div>
39-
);
7+
return (
8+
<div className="app">
9+
<div className="main-container">
10+
<Card size={"small"} className={"mt-16"}>
11+
<div style={{ textAlign: "center", padding: "8px 0" }}>
12+
<h3 style={{ margin: "0 0 8px 0", color: "#1890ff" }}>
13+
InSwap Demo
14+
</h3>
15+
<p style={{ margin: "0 0 8px 0", color: "#666" }}>
16+
This demo shows how to integrate with{" "}
17+
<a
18+
href="https://inswap.cc/"
19+
target="_blank"
20+
rel="noopener noreferrer"
21+
>
22+
InSwap
23+
</a>
24+
</p>
25+
<p style={{ margin: 0, fontSize: "14px", color: "#999" }}>
26+
API Documentation:{" "}
27+
<a
28+
href="https://github.com/unisat-wallet/unisat-dev-docs/blob/master/open-api/auto-generated/docs/brc20-swap.md"
29+
target="_blank"
30+
rel="noopener noreferrer"
31+
>
32+
BRC20 Swap API
33+
</a>
34+
</p>
35+
</div>
36+
</Card>
37+
<Card
38+
bordered={false}
39+
size={"small"}
40+
style={{ marginTop: 16, paddingTop: 0 }}
41+
>
42+
<Tabs
43+
defaultActiveKey="1"
44+
tabPosition="top"
45+
items={[{ key: "1", label: "Swap", children: <Swap /> }]}
46+
/>
47+
</Card>
48+
</div>
49+
</div>
50+
);
4051
}
4152

4253
export default App;

brc20-swap-demo/src/components/ApiKeyInput.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)