-
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.
- Loading branch information
1 parent
dee5903
commit 7f91e77
Showing
47 changed files
with
2,419 additions
and
225 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
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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.
Binary file not shown.
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,52 @@ | ||
import React from 'react'; | ||
import HomeIcon from '../assets/home-icon.svg'; | ||
import ChevronRightIcon from '../assets/chevron-right-icon.svg'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
interface BreadcrumbsProps { | ||
pages: Page[]; | ||
} | ||
|
||
interface Page { | ||
name: string; | ||
href: string; | ||
current?: boolean; | ||
} | ||
|
||
const Breadcrumbs: React.FC<BreadcrumbsProps> = ({ pages }) => { | ||
return ( | ||
<nav aria-label="Breadcrumb" className="px-4 mt-4 flex"> | ||
<ol role="list" className="flex items-center space-x-4"> | ||
<li> | ||
<div> | ||
<Link href="/" className="text-gray-400 hover:text-gray-500"> | ||
<Image className="ps-2 w-8 inline" src={HomeIcon} alt={'Home'} /> | ||
<span className="sr-only">Home</span> | ||
</Link> | ||
</div> | ||
</li> | ||
{pages.map((page) => ( | ||
<li key={page.name}> | ||
<div className="flex items-center"> | ||
<Image | ||
className="ps-2 h-5 w-5 inline" | ||
src={ChevronRightIcon} | ||
alt={'>'} | ||
/> | ||
<Link | ||
href={page.href} | ||
aria-current={page.current ? 'page' : undefined} | ||
className="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700" | ||
> | ||
{page.name} | ||
</Link> | ||
</div> | ||
</li> | ||
))} | ||
</ol> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Breadcrumbs; |
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,40 @@ | ||
import Image from 'next/image'; | ||
import CopyIcon from '../assets/copy-icon.svg'; | ||
import React, { useState } from 'react'; | ||
import { InfoAlert } from '@/components'; | ||
|
||
interface CopyTextProps { | ||
text: string; | ||
alertMessage?: string; | ||
} | ||
|
||
const CopyText: React.FC<CopyTextProps> = ({ text, alertMessage }) => { | ||
const [alertText, setAlertText] = useState<string | null>(null); | ||
return ( | ||
<> | ||
<InfoAlert | ||
show={alertText != null} | ||
hide={() => setAlertText(null)} | ||
alertText={alertText || ''} | ||
className="my-3" | ||
/> | ||
<div className="flex flex-row no-wrap"> | ||
<div className="grow-0 outline rounded p-1"> | ||
<span className="font-mono">{text}</span> | ||
<Image | ||
className="ps-2 w-8 inline hover:opacity-70" | ||
src={CopyIcon} | ||
alt={'Copy'} | ||
onClick={() => | ||
navigator.clipboard | ||
.writeText(text || '') | ||
.then(() => setAlertText(alertMessage ?? 'Copied')) | ||
} | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default CopyText; |
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,35 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
|
||
interface CryptoIdProps { | ||
id: string; | ||
className?: string; | ||
} | ||
|
||
const CryptoId: React.FC<CryptoIdProps> = ({ id, className }) => { | ||
return ( | ||
<div className={`flex ${className}`}> | ||
<Image | ||
src={`https://raw.githubusercontent.com/spothq/cryptocurrency-icons/refs/heads/master/svg/icon/${getMainCoinId(id)}.svg`} | ||
alt="Crypto Logo" | ||
height={24} | ||
width={24} | ||
onError={(event) => { | ||
// @ts-ignore | ||
event.target.src = | ||
'https://raw.githubusercontent.com/spothq/cryptocurrency-icons/refs/heads/master/svg/icon/generic.svg'; | ||
}} | ||
/> | ||
<span className={`ms-1`}>{id}</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CryptoId; | ||
|
||
function getMainCoinId(id: string): string { | ||
if (id === 'AVAXTEST') { | ||
return 'avax'; | ||
} | ||
return id.split('_')[0].toLowerCase(); | ||
} |
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,45 @@ | ||
import React from 'react'; | ||
import { useRouter } from 'next/router'; | ||
import Link from 'next/link'; | ||
|
||
const tabs = [ | ||
{ name: 'Home', href: '/' }, | ||
{ name: 'Staking', href: '/staking' }, | ||
{ name: 'Staking positions', href: '/staking/positions' }, | ||
{ name: 'Staking providers', href: '/staking/providers' }, | ||
]; | ||
|
||
function classNames(...classes: string[]) { | ||
return classes.filter(Boolean).join(' '); | ||
} | ||
|
||
const NavigationBar: React.FC = () => { | ||
const router = useRouter(); | ||
const currentTab = tabs.find((tab) => tab.href === router.pathname); | ||
const tabName = currentTab ? currentTab.name : undefined; | ||
return ( | ||
<div> | ||
<div className="border-b border-gray-200"> | ||
<nav aria-label="Tabs" className="-mb-px flex space-x-8"> | ||
{tabs.map((tab) => ( | ||
<Link | ||
key={tab.name} | ||
href={tab.href} | ||
aria-current={tab.name == tabName ? 'page' : undefined} | ||
className={classNames( | ||
tab.name == tabName | ||
? 'text-label-dark-primary border-b-2 border-brand-light-primary' | ||
: 'text-label-dark-secondary', | ||
'whitespace-nowrap h-10 p-2 text-sm font-medium' | ||
)} | ||
> | ||
{tab.name} | ||
</Link> | ||
))} | ||
</nav> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NavigationBar; |
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,8 +1,17 @@ | ||
export { default as VaultHeader } from './VaultHeader'; | ||
export { default as VaultFooter } from './VaultFooter'; | ||
export { default as NavigationBar } from './NavigationBar'; | ||
export { default as Breadcrumbs } from './Breadcrumbs'; | ||
export { default as CopyText } from './CopyText'; | ||
export { default as CryptoId } from './CryptoId'; | ||
export { default as VaultStakingPositionStatusLabel } from './staking/VaultStakingPositionStatusLabel'; | ||
export { default as StakingAssetsTable } from './staking/VaultStakingAssetsTable'; | ||
export { default as VaultStakeActionModal } from './staking/VaultStakeActionModal'; | ||
export { default as VaultStakingPositionsTable } from './staking/positions/VaultStakingPositionsTable'; | ||
export { default as VaultStakingProviderInfo } from './staking/providers/VaultStakingProviderInfo'; | ||
export { default as BalanceCard } from './vaultAssets/BalanceCard'; | ||
export { default as DonutChart } from './vaultAssets/DonutChart'; | ||
export { default as CurrencyDropdown } from './vaultAssets/CurrencyDropdown'; | ||
export { default as VaultAssetsTable } from './vaultAssets/VaultAssetsTable'; | ||
export { default as AddressModal } from './vaultAssetAddress/AddressModal'; | ||
export { default as AddressModal } from './vaultAssets/address/AddressModal'; | ||
export { default as InfoAlert } from './alerts/InfoAlert'; |
Oops, something went wrong.