Files
TheGame/packages/web/components/Player/PlayerGuild.tsx
Sero 38c3dc059e Sero/wc v2 (#1735)
* 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>
2024-03-21 06:09:12 -04:00

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}</>;
};