This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
forked from helix-bridge/helix-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor ui and ux * Update README.md * Remove disclaimer
- Loading branch information
1 parent
652c1ad
commit d7dcdce
Showing
89 changed files
with
2,576 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Helix Bridge xToken UI | ||
# xToken UI |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Darwinia Bridge", | ||
"description": "Darwinia bridge, assets cross-chain", | ||
"icons": [{ "src": "icon.svg", "sizes": "any" }] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import dynamic from "next/dynamic"; | ||
|
||
const PageSelect = dynamic(() => import("@/components/page-select"), { ssr: false }); | ||
const TransferV2 = dynamic(() => import("@/components/transfer-v2"), { ssr: false }); | ||
|
||
export default function Home() { | ||
return <PageSelect />; | ||
return ( | ||
<main className="app-main relative overflow-hidden"> | ||
<div className="fixed bottom-0 left-0 right-0 top-0 z-[1] flex items-center justify-center"> | ||
<div className="h-[70vw] w-[70vw] rounded-full bg-primary blur-[8rem] lg:h-[65vh] lg:w-[65vh] lg:bg-primary/40" /> | ||
</div> | ||
<div className="absolute bottom-0 left-0 right-0 top-0 z-[2] overflow-y-auto"> | ||
<div className="page-container"> | ||
<TransferV2 /> | ||
</div> | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
import Footer from "@/components/footer"; | ||
import Header from "@/components/header"; | ||
import PageWrap from "@/ui/page-wrap"; | ||
import dynamic from "next/dynamic"; | ||
|
||
const HistoryRecords = dynamic(() => import("@/components/history-records")); | ||
|
||
export default function RecordsPage() { | ||
export default function Records() { | ||
return ( | ||
<> | ||
<Header /> | ||
<PageWrap> | ||
<HistoryRecords /> | ||
</PageWrap> | ||
<Footer /> | ||
</> | ||
<PageWrap> | ||
<HistoryRecords /> | ||
</PageWrap> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Key, ReactElement, useRef } from "react"; | ||
import { CSSTransition, SwitchTransition } from "react-transition-group"; | ||
|
||
export interface TabsProps<T> { | ||
activeTab: T; | ||
options: { | ||
tab: T; | ||
label: string; | ||
children: ReactElement; | ||
}[]; | ||
onChange?: (tab: T) => void; | ||
} | ||
|
||
export default function BridgeTabs<K extends Key = string>({ | ||
options, | ||
activeTab, | ||
onChange = () => undefined, | ||
}: TabsProps<K>) { | ||
const previousRef = useRef<HTMLDivElement | null>(null); | ||
const currentRef = useRef<HTMLDivElement | null>(null); | ||
|
||
const nodeRef = options.findIndex((option) => option.tab === activeTab) % 2 ? currentRef : previousRef; | ||
const activeItem = options.find(({ tab }) => tab === activeTab) || options[0]; | ||
|
||
return ( | ||
<> | ||
<div className="flex items-center justify-between gap-medium rounded-xl bg-background p-2"> | ||
{options.map((option) => ( | ||
<button | ||
key={option.tab} | ||
disabled={option.tab === activeTab} | ||
onClick={() => onChange(option.tab)} | ||
className="h-9 flex-1 rounded-lg text-sm font-bold text-white transition-colors hover:bg-white/10 disabled:bg-white/20" | ||
> | ||
{option.label} | ||
</button> | ||
))} | ||
</div> | ||
|
||
<SwitchTransition> | ||
<CSSTransition timeout={200} key={activeTab} nodeRef={nodeRef} classNames="tabs-fade" unmountOnExit> | ||
<div ref={nodeRef} className="flex flex-col gap-medium lg:gap-5"> | ||
{activeItem.children} | ||
</div> | ||
</CSSTransition> | ||
</SwitchTransition> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.