mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-13 08:37:53 -05:00
* wc/wagmi/viem * replace * profile * replace context (,: * testing, clean up * wallet connect deploy * connect * remove type slive * podcast * podcast * heck yeah * feat: connect button * chore * trying siwe, network switch * redirect * prettying, cleaning up SIWE endpoints, & passing linting 🕊 * switching minting to Optimism & converting `ethers` to `wagmi` for contract access 🥧 * simplified onboarding & successfully minted ⛲ * typo * api key --------- Co-authored-by: Udit Takkar <udit222001@gmail.com> Co-authored-by: dysbulic <dys@dhappy.org>
58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import { Link, LinkProps } from '@metafam/ds';
|
|
import type { PropsWithChildren } from 'react';
|
|
|
|
type LinkGuildProps = PropsWithChildren<{
|
|
daoURL: string | null;
|
|
guildname: string | undefined | null;
|
|
}>;
|
|
|
|
export const LinkGuild: React.FC<LinkGuildProps> = ({
|
|
daoURL,
|
|
guildname,
|
|
children,
|
|
}) => {
|
|
if (guildname != null) {
|
|
return <InternalGuildLink guildName={guildname} {...{ children }} />;
|
|
}
|
|
if (daoURL != null) {
|
|
return <ExternalDaoLink daoURL={daoURL} children={children} />;
|
|
}
|
|
return <>{children}</>;
|
|
};
|
|
|
|
type InternalGuildLinkProps = PropsWithChildren<{
|
|
guildName: string;
|
|
}>;
|
|
|
|
export const InternalGuildLink: React.FC<InternalGuildLinkProps> = ({
|
|
guildName,
|
|
children,
|
|
}) => (
|
|
<Link _hover={{ textDecoration: 'none' }} href={`/guild/${guildName}`}>
|
|
{children}
|
|
</Link>
|
|
);
|
|
|
|
type DaoHausLinkProps = {
|
|
daoURL: string | null;
|
|
};
|
|
|
|
export const ExternalDaoLink: React.FC<DaoHausLinkProps & LinkProps> = ({
|
|
daoURL,
|
|
children,
|
|
_hover = {},
|
|
...props
|
|
}) => {
|
|
_hover.textDecoration = 'none'; // eslint-disable-line no-param-reassign
|
|
|
|
if (daoURL != null) {
|
|
return (
|
|
<Link href={daoURL} isExternal {...{ _hover, ...props }}>
|
|
{children}
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
return <>{children}</>;
|
|
};
|