-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore | Unify <Tabs /> component (#612)
* Add wallet icon * Add page for fund wallet * Implement styling for fundwallet page * Finish content for fund wallet page * Add cards and icons * Adjust zenlink icon * Add mexc icon * Tune cards * Remove 'Buy PEN' item from sidebar * Adjust font style for Amplitude * Hide fund wallet page on Foucoco * use .svg instead of react component for svg img * change alchempaypay from .tsx to .svg * change stellaswap from component to .svg * change zenlink from component to .svg * change mexc from component to .svg * implement inline svg when custom fill is needed * add zenlink for amplitude theme * reduce code complexity * add Banxa * add slide tab animation * extract FundWalletTabs into separate component * extract FundWalletTabsContent into separate component * implement Tabs reusable component * create reusable CardExternalLink component * refactor FundWalletContent * create useResolvedUrl hook * redirect to faucet for foucoco * update yarn.lock * change foucoco fund wallet button text * dont show fund wallet tabs for foucoco * Change button color back to primary * move Banxa from exchange to buy for Pendulum * replace wallet icon * Change declaration of Chain logos, add SpacewalkTabs component * unify Tabs component for Fund and Spacewalk * fix SpacewalkTabs property bug * use ChainLogo for SpacewalkTabs * improve code readability --------- Co-authored-by: Marcel Ebert <[email protected]>
- Loading branch information
1 parent
0763590
commit 9fb80d9
Showing
13 changed files
with
102 additions
and
79 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
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,20 +1,18 @@ | ||
import { HTMLAttributes } from 'preact/compat'; | ||
import { useGlobalState } from '../GlobalStateProvider'; | ||
import { TenantName } from '../models/Tenant'; | ||
import AmplitudeLogo from './AmplitudeLogo'; | ||
import PendulumLogo from './PendulumLogo'; | ||
import { AmplitudeLogo } from './AmplitudeLogo'; | ||
import { PendulumLogo } from './PendulumLogo'; | ||
|
||
interface Props extends HTMLAttributes<SVGSVGElement> { | ||
className?: string; | ||
} | ||
|
||
const ChainLogo = (props: Props) => { | ||
export const ChainLogo = (props: Props) => { | ||
const { tenantName } = useGlobalState(); | ||
if (tenantName === TenantName.Pendulum) { | ||
return <PendulumLogo {...props} />; | ||
} else { | ||
return <AmplitudeLogo {...props} />; | ||
} | ||
}; | ||
|
||
export default ChainLogo; |
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
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
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,53 @@ | ||
import { useNodeInfoState } from '../../../../NodeInfoProvider'; | ||
import { TabProps } from '../../../../components/Tabs/Tab'; | ||
import { Tabs } from '../../../../components/Tabs'; | ||
import { ChainLogo } from '../../../../assets/ChainLogo'; | ||
import StellarLogo from '../../../../assets/StellarLogo'; | ||
import { BridgeTabs } from '..'; | ||
|
||
interface SpacewalkTabsProps { | ||
activeTab: BridgeTabs; | ||
setActiveTab: (index: BridgeTabs) => void; | ||
} | ||
|
||
export function SpacewalkTabs({ activeTab, setActiveTab }: SpacewalkTabsProps) { | ||
const { chain } = useNodeInfoState().state; | ||
|
||
const cs = 'z-20 flex items-center justify-center p-2 text-xs sm:text-sm '; | ||
|
||
const ToPendulum = () => | ||
chain ? ( | ||
<> | ||
<ChainLogo className="z-20 mr-1 h-6 w-6" /> | ||
<p className="z-20 text-gray-500 group-data-[active=true]:text-black dark:text-white">To {chain}</p> | ||
</> | ||
) : ( | ||
<></> | ||
); | ||
|
||
const ToStellar = () => ( | ||
<> | ||
<StellarLogo className="z-20 mr-1 h-6 w-6" /> | ||
<p className="z-20 text-gray-500 group-data-[active=true]:text-black dark:text-white">To Stellar</p> | ||
</> | ||
); | ||
|
||
const tabItems: Omit<TabProps<BridgeTabs>, 'setActiveTab' | 'activeTab'>[] = [ | ||
{ | ||
index: BridgeTabs.Issue, | ||
children: <ToPendulum />, | ||
className: cs, | ||
activeClassName: 'bg-[#f7f7f7] dark:bg-primary', | ||
}, | ||
{ | ||
index: BridgeTabs.Redeem, | ||
children: <ToStellar />, | ||
className: cs, | ||
activeClassName: 'bg-[#f7f7f7] dark:bg-primary', | ||
}, | ||
]; | ||
|
||
return ( | ||
<Tabs<BridgeTabs> activeTab={activeTab} setActiveTab={setActiveTab} tabItems={tabItems} className="border-0" /> | ||
); | ||
} |
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