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

Improve UI and code #577

Merged
merged 87 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
af2a06d
Update rainbowkit viem wagmi and webpack config
JayJay1024 Nov 13, 2023
c3968bf
Home page
JayJay1024 Nov 13, 2023
0b4fc83
User and header navigation
JayJay1024 Nov 13, 2023
a9f8be5
Chain and token select border radius
JayJay1024 Nov 13, 2023
5b018d2
Update footer
JayJay1024 Nov 13, 2023
a35f106
Update max button hover bg
JayJay1024 Nov 13, 2023
10f019d
Update header
JayJay1024 Nov 13, 2023
ee4a5c2
Update records
JayJay1024 Nov 13, 2023
fcf7bb8
Relayer overview
JayJay1024 Nov 13, 2023
4490988
Relayer dashboard
JayJay1024 Nov 13, 2023
98c359d
Update SegmentedTabs
JayJay1024 Nov 13, 2023
409aee0
Beta save
JayJay1024 Nov 14, 2023
8c66be9
Merge branch 'main' into jay/improve-ui
JayJay1024 Nov 14, 2023
d1590ec
Merge branch 'main' into jay/improve-ui
JayJay1024 Nov 17, 2023
cba8e82
Update tailwind.config.ts
JayJay1024 Nov 17, 2023
148fb5f
Update globals.css
JayJay1024 Nov 17, 2023
03ac083
Set appear props for Modal CSSTransition
JayJay1024 Nov 17, 2023
1174940
Update next package
JayJay1024 Nov 17, 2023
7b4646e
Merge branch 'main' into jay/improve-ui
JayJay1024 Nov 20, 2023
8d50d6a
Improve types
JayJay1024 Nov 20, 2023
bea1d38
Improve config
JayJay1024 Nov 20, 2023
257ac2b
New type BridgeConstructorArgs
JayJay1024 Nov 20, 2023
b4445e0
Improve utils
JayJay1024 Nov 20, 2023
7c7920f
Improve order of cross-chain utils
JayJay1024 Nov 20, 2023
b82cb04
Merge branch 'main' into jay/improve-ui-code
JayJay1024 Nov 23, 2023
2be96b6
Update graphql types
JayJay1024 Nov 23, 2023
82ed07d
Improve types
JayJay1024 Nov 23, 2023
cff0a37
Improve configs
JayJay1024 Nov 23, 2023
ca60a8c
Include jsx and tsx files under utils for tailwind
JayJay1024 Nov 23, 2023
e52414d
Improve utils
JayJay1024 Nov 23, 2023
78b8c8d
Location type
JayJay1024 Nov 23, 2023
08818b6
Improve types
JayJay1024 Nov 23, 2023
115fb83
Improve BaseBridge
JayJay1024 Nov 23, 2023
77d8593
Improve bridges
JayJay1024 Nov 24, 2023
bce71b3
Improve useToggle
JayJay1024 Nov 24, 2023
0eed28e
Improve rainbow provider
JayJay1024 Nov 24, 2023
bd47ddc
Fix InputValue type
JayJay1024 Nov 24, 2023
db4dbd3
Improve transfer provider
JayJay1024 Nov 25, 2023
65a440f
Improve relayer provider
JayJay1024 Nov 25, 2023
d593311
Improve ui components
JayJay1024 Nov 25, 2023
1a90628
Configure border radius tailwind.config.ts
JayJay1024 Nov 25, 2023
0ff7c51
Remove unused css globals.css
JayJay1024 Nov 25, 2023
ad3a20c
Update input css globals.css
JayJay1024 Nov 25, 2023
d745c6c
Improve AddressInput
JayJay1024 Nov 25, 2023
af85e8a
Improve BalanceInput
JayJay1024 Nov 25, 2023
aecd8c6
Improve cross-chain utils
JayJay1024 Nov 26, 2023
b4ccc24
Improve components
JayJay1024 Nov 26, 2023
96b7fc7
Export hooks from index file
JayJay1024 Nov 26, 2023
031a123
Improve cross-chain utils
JayJay1024 Nov 26, 2023
0c88750
Improve graphql types
JayJay1024 Nov 26, 2023
29850fa
Update return value of getWithdrawFee
JayJay1024 Nov 26, 2023
7571d8f
Update relayer provider
JayJay1024 Nov 26, 2023
f2c0e55
Improve pages
JayJay1024 Nov 26, 2023
c76c18e
Update site icon
JayJay1024 Nov 26, 2023
1db723a
Fix unit test
JayJay1024 Nov 26, 2023
4c6c248
Update README.md
JayJay1024 Nov 26, 2023
27d7ccb
Revert next package version
JayJay1024 Nov 26, 2023
7815817
Fix build
JayJay1024 Nov 27, 2023
dee7b24
Footer and Header
JayJay1024 Nov 27, 2023
a3ca70f
Transfer
JayJay1024 Nov 27, 2023
980e472
Faucet
JayJay1024 Nov 27, 2023
8887723
Update page component name
JayJay1024 Nov 27, 2023
b84a563
Records page
JayJay1024 Nov 27, 2023
c1e8b74
Fix header bg
JayJay1024 Nov 27, 2023
0d6b91f
Record detail
JayJay1024 Nov 27, 2023
ef0f38d
Relayer overview page
JayJay1024 Nov 27, 2023
ff26532
Update USDT logo
JayJay1024 Nov 28, 2023
2e413d7
Update token logo size of BalanceInput
JayJay1024 Nov 28, 2023
4399d58
Relayer manage
JayJay1024 Nov 28, 2023
4ceda9d
Relayer register
JayJay1024 Nov 28, 2023
9aca9b7
Transfer BalanceInput refresh balance
JayJay1024 Nov 28, 2023
1cb24a6
Balance max
JayJay1024 Nov 28, 2023
34cceee
Improve notification utils
JayJay1024 Nov 28, 2023
b9e48ed
No-cache fetchPolicy for online status query
JayJay1024 Nov 28, 2023
05a8bcb
Improve bridge-select
JayJay1024 Nov 28, 2023
deb7edf
Update disclaimer style
JayJay1024 Nov 29, 2023
b3dc52d
Update the border radius of rainbow connect wallet modal
JayJay1024 Nov 29, 2023
a5a9cb9
Fix balance input dynamic style
JayJay1024 Nov 29, 2023
c6dbc96
Fix balance-input max check
JayJay1024 Nov 29, 2023
3b8b1ca
Update compact chain select gap between chain logo and name
JayJay1024 Nov 29, 2023
77f6155
Improve balance-input compact mode style
JayJay1024 Nov 29, 2023
69fd1b1
Add tips for withdraw-fee
JayJay1024 Nov 29, 2023
64e2617
Fix transfer-action disabled check
JayJay1024 Nov 29, 2023
1468bd3
Improve disabled check for deposit-more and withdraw-margin
JayJay1024 Nov 29, 2023
7928aeb
Update x-padding of table on pc
JayJay1024 Nov 29, 2023
a48fcb8
Update width of relayer-manage-modal on pc
JayJay1024 Nov 29, 2023
017692e
Merge branch 'main' into jay/improve-ui-code
JayJay1024 Dec 1, 2023
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@

- mainnet: https://helix-dev-main.vercel.app/
- testnet: https://helix-dev-test.vercel.app/

### Local development

```shell
$ npm install
$ npm run dev:apps
```

### How to add a new chain

1. Define `ChainID` and `Network` in `packages/apps/src/types/chain.ts`
2. Configure the chain file in the `packages/apps/src/config/chains` directory
3. Export the configuration file in the `packages/apps/src/config/chains/index.ts`
4. Add new chain to `packages/apps/src/utils/chain.ts`
22,675 changes: 7,810 additions & 14,865 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/apps/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
config.resolve.fallback = { fs: false, net: false, tls: false };
config.externals.push("lokijs", "encoding", "pino-pretty");
return config;
},
};
Expand Down
13 changes: 5 additions & 8 deletions packages/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,29 @@
"dependencies": {
"@apollo/client": "^3.8.2",
"@floating-ui/react": "^0.25.2",
"@polkadot/api": "^10.9.1",
"@rainbow-me/rainbowkit": "^1.0.9",
"@polkadot/api": "^10.11.1",
"@rainbow-me/rainbowkit": "^1.3.0",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"graphql": "^16.8.0",
"next": "13.4.16",
"next": "14.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-transition-group": "^4.4.5",
"sharp": "^0.32.6",
"viem": "^1.8.1",
"wagmi": "^1.3.10"
"viem": "^1.19.9",
"wagmi": "^1.4.7"
},
"devDependencies": {
"@types/node": "^20.5.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/react-transition-group": "^4.4.6",
"autoprefixer": "^10.4.15",
"encoding": "^0.1.13",
"eslint": "^8.47.0",
"eslint-config-next": "^13.4.16",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.7.0",
"lokijs": "^1.5.12",
"pino-pretty": "^10.2.0",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6"
Expand Down
7 changes: 7 additions & 0 deletions packages/apps/public/images/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/apps/public/images/token/usdt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/apps/src/__tests__/cross-config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getChainsConfig, getChainConfig } from "../utils/chain";
import { getChainConfigs, getChainConfig } from "../utils/chain";
import type { ChainConfig } from "../types/chain";

describe.each(getChainsConfig("all") as ChainConfig[])(
describe.each(getChainConfigs(true) as ChainConfig[])(
"Should configure price for HelixLpBridge to cross native token",
({ network, tokens }) => {
if (tokens.length) {
Expand All @@ -18,7 +18,7 @@ describe.each(getChainsConfig("all") as ChainConfig[])(
},
);

describe.each(getChainsConfig("all") as ChainConfig[])("Should configure target token", ({ network, tokens }) => {
describe.each(getChainConfigs(true) as ChainConfig[])("Should configure target token", ({ network, tokens }) => {
if (tokens.length) {
describe.each(tokens)(`Cross $symbol from ${network}`, (token) => {
if (token.cross.length) {
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/src/__tests__/native-token-config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getChainsConfig } from "../utils/chain";
import { getChainConfigs } from "../utils/chain";
import type { ChainConfig } from "../types/chain";

describe.each(getChainsConfig("all") as ChainConfig[])("Should configure native token", ({ network, tokens }) => {
describe.each(getChainConfigs(true) as ChainConfig[])("Should configure native token", ({ network, tokens }) => {
it(`${network}`, () => {
if (tokens.length) {
expect(tokens.some((t) => t.type === "native")).not.toBeFalsy();
Expand Down
52 changes: 22 additions & 30 deletions packages/apps/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,63 +27,51 @@ body {
} */

@layer components {
.token-select-dropdown {
width: calc(100vw - 3rem);
@apply lg:w-[36rem];
}

/* Layout */
.app-header {
@apply h-[64px];
}

.app-footer {
@apply h-[58px];
}

.app-main {
min-height: calc(100vh - 64px - 58px);
@apply mt-[64px] py-5;
@apply mt-[64px];
}

.user-connect-wallet {
@apply bg-primary gap-middle px-large flex h-9 shrink-0 items-center rounded transition hover:opacity-80 lg:h-8 lg:hover:opacity-80 lg:active:translate-y-1;
/* Page */
.page-container {
@apply px-middle container mx-auto py-5;
}

/* User */
.user-connect-wallet {
@apply bg-primary gap-middle rounded-middle px-large lg:hover:bg-primary/80 flex h-9 shrink-0 items-center transition lg:h-8 lg:active:translate-y-1;
}
.user-dropdown-item {
@apply gap-middle px-large py-small inline-flex items-center text-start transition hover:bg-white/10 lg:active:translate-y-1;
}

.tooltip-text {
@apply text-xs font-normal text-white;
}

.button {
@apply flex h-8 items-center justify-center text-sm lg:h-9;
@apply flex h-8 items-center justify-center lg:h-9;
}

/* Input */
.normal-input-wrap {
@apply rounded border transition-colors duration-300;
@apply border transition-colors duration-300;
}

.valid-input-wrap {
@apply hover:border-primary focus-within:border-primary;
}

.invalid-input-wrap {
@apply hover:border-app-red focus-within:border-app-red border-app-red;
}

.select {
@apply hover:border-primary focus-within:border-primary rounded border transition duration-300 disabled:cursor-not-allowed disabled:opacity-60 lg:active:translate-y-1 lg:disabled:translate-y-0;
}
}

@layer utilities {
.page-bg {
background: linear-gradient(180deg, #02061f 0%, #1c1837 100%);
@apply hover:border-primary focus-within:border-primary border transition duration-300 disabled:cursor-not-allowed disabled:opacity-60 lg:active:translate-y-1 lg:disabled:translate-y-0;
}
}

/* Page header loading bar */
.loading-bar {
background: linear-gradient(90deg, #ffffff 35%, #00b2ff 50%, #ffffff 65%);
background-position: 100% 50%;
Expand Down Expand Up @@ -112,7 +100,7 @@ body {
}
}

/* drawer */
/* Drawer */
.drawer-fade-enter {
opacity: 0;
}
Expand Down Expand Up @@ -142,7 +130,7 @@ body {
transition: transform 300ms;
}

/* tabs */
/* Tabs */
.tabs-fade-enter {
opacity: 0;
}
Expand All @@ -158,7 +146,7 @@ body {
transition: opacity 200ms;
}

/* component loading */
/* Component loading */
.component-loading-appear,
.component-loading-enter {
background-color: transparent;
Expand All @@ -180,17 +168,21 @@ body {
transition: background-color 300ms;
}

/* modal */
/* Modal */
.modal-fade-appear,
.modal-fade-enter {
opacity: 0;
}
.modal-fade-appear > div,
.modal-fade-enter > div {
transform: scale(0.5);
}
.modal-fade-appear-active,
.modal-fade-enter-active {
opacity: 1;
transition: opacity 300ms;
}
.modal-fade-appear-active > div,
.modal-fade-enter-active > div {
transform: scale(1);
transition: transform 300ms;
Expand Down
19 changes: 14 additions & 5 deletions packages/apps/src/app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/apps/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const metadata: Metadata = {

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" style={{ backgroundColor: "#000421" }}>
<body className={`${ibm_plex_sans.className} page-bg text-white`}>
<html lang="en">
<body className={`${ibm_plex_sans.className} bg-app-bg text-base font-normal text-white`}>
<GraphqlProvider>
<RainbowProvider>
<AppProvider>
Expand Down
17 changes: 8 additions & 9 deletions packages/apps/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import PageWrap from "@/ui/page-wrap";
import TransferProvider from "@/providers/transfer-provider";
import { Metadata } from "next";
import dynamic from "next/dynamic";

export const metadata: Metadata = {
title: "Transfer | Helix Bridge",
title: "Helix Bridge - Cross-chain for tokens",
description: "Perform cross-chain transfers through Helix Bridge",
};

const Transfer = dynamic(() => import("@/components/transfer"), { ssr: false });

export default function Home() {
export default function HomePage() {
return (
<main className="app-main">
<div className="px-middle container mx-auto lg:py-12">
<TransferProvider>
<Transfer />
</TransferProvider>
</div>
</main>
<PageWrap>
<TransferProvider>
<Transfer />
</TransferProvider>
</PageWrap>
);
}
13 changes: 6 additions & 7 deletions packages/apps/src/app/records/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import RecordDetail from "@/components/record-detail";
import PageWrap from "@/ui/page-wrap";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Detail | Helix Bridge",
title: "Detail - Helix Bridge",
description: "View Helix Bridge transfer details",
};

Expand All @@ -12,12 +13,10 @@ interface Props {
};
}

export default function Record({ params }: Props) {
export default function RecordPage({ params }: Props) {
return (
<main className="app-main">
<div className="px-middle container mx-auto">
<RecordDetail id={params.id} />
</div>
</main>
<PageWrap>
<RecordDetail id={params.id} />
</PageWrap>
);
}
17 changes: 9 additions & 8 deletions packages/apps/src/app/records/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import HistoryRecords from "@/components/history-records";
import PageWrap from "@/ui/page-wrap";
import { Metadata } from "next";
import dynamic from "next/dynamic";

export const metadata: Metadata = {
title: "Records | Helix Bridge",
title: "History Records - Helix Bridge",
description: "View the history of transfers via the Helix Bridge",
};

export default function Records() {
const HistoryRecords = dynamic(() => import("@/components/history-records"));

export default function RecordsPage() {
return (
<main className="app-main">
<div className="px-middle container mx-auto">
<HistoryRecords />
</div>
</main>
<PageWrap>
<HistoryRecords />
</PageWrap>
);
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import PageWrap from "@/ui/page-wrap";
import { Metadata } from "next";
import dynamic from "next/dynamic";

const RelayerRegisterManage = dynamic(() => import("@/components/relayer-register-manage"), { ssr: false });

export const metadata: Metadata = {
title: "Relayer Dashboard | Helix Bridge",
title: "Relayer Dashboard - Helix Bridge",
description: "Register a relayer on Helix Bridge or manage my relayers registered on Helix Bridge",
};

export default function MyRelayers() {
export default function RelayerDashboardPage() {
return (
<main className="app-main">
<div className="px-middle container mx-auto">
<RelayerRegisterManage />
</div>
</main>
<PageWrap>
<RelayerRegisterManage />
</PageWrap>
);
}
Loading
Loading