Skip to content

Commit

Permalink
use ChainLogo for SpacewalkTabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharqiewicz committed Oct 30, 2024
1 parent 27ee2b4 commit e333026
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/assets/ChainLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ 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;
2 changes: 1 addition & 1 deletion src/components/AccountCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WalletAccount } from '@talismn/connect-wallets';
import { trimAddress } from '../../helpers/addressFormatter';
import { useGlobalState } from '../../GlobalStateProvider';
import ChainLogo from '../../assets/ChainLogo';
import { ChainLogo } from '../../assets/ChainLogo';

interface AccountProps {
account: WalletAccount;
Expand Down
14 changes: 4 additions & 10 deletions src/pages/spacewalk/bridge/SpacewalkTabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { BridgeTabs } from '..';
import { useNodeInfoState } from '../../../../NodeInfoProvider';
import { Tabs } from '../../../../components/Tabs';

import { AmplitudeLogo } from '../../../../assets/AmplitudeLogo';
import { PendulumLogo } from '../../../../assets/PendulumLogo';
import StellarLogo from '../../../../assets/StellarLogo';
import { TenantName } from '../../../../models/Tenant';
import { useNodeInfoState } from '../../../../NodeInfoProvider';
import { TabProps } from '../../../../components/Tabs/Tab';
import { ChainLogo } from '../../../../assets/ChainLogo';
import { BridgeTabs } from '..';

interface SpacewalkTabsProps {
activeTab: BridgeTabs;
Expand All @@ -21,10 +18,7 @@ export function SpacewalkTabs({ activeTab, setActiveTab }: SpacewalkTabsProps) {
const ToPendulum = () =>
chain ? (
<>
{chain.toLowerCase() === TenantName.Pendulum && <PendulumLogo className="z-20 mr-1 h-6 w-6" />}
{(chain.toLowerCase() === TenantName.Amplitude || chain.toLowerCase() === TenantName.Foucoco) && (
<AmplitudeLogo className="z-20 mr-1 h-6 w-6" />
)}
<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>
</>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/staking/dialogs/DelegateToCollatorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
import { useMemo, useState } from 'preact/hooks';
import { Button } from 'react-daisyui';
import { useForm } from 'react-hook-form';
import ChainLogo from '../../../assets/ChainLogo';
import { ChainLogo } from '../../../assets/ChainLogo';
import Amount from '../../../components/Form/Amount';
import { PublicKey } from '../../../components/PublicKey';
import { Dialog } from '../../../components/Dialog';
Expand Down

0 comments on commit e333026

Please sign in to comment.