Files
TheGame/packages/web/components/Player/PlayerContacts.tsx
δυς 5f8cae1aea Improving Leaderboard Loading Time
* removing BrightId *(unused)* and DAOHaus memberships *(loaded separately)* from `Player` retreival 🦷

* setting `max-width` on hamburger menu 🧾

* increasing shown DAOs, shunting remote schemas, & handling missing Discord token 🤐

* triggering recalc on element resize 🚲

* adding copy of ETH address on profile image click 🛹

* adding `@emotion/cache` to try and eliminate unstyled content render 

* cleaning up failed emotion cache experiment 🚓

* updating Ceramic & locking versions to beat a dependency conflict 🤲🏿
2023-01-31 16:44:01 -05:00

75 lines
2.2 KiB
TypeScript

import { IconButton, MetaTileLinkWrapper, Wrap, WrapItem } from '@metafam/ds';
import { linkButtonProps } from 'components/Guild/Section/GuildLinks';
import { Player } from 'graphql/autogen/types';
import React from 'react';
import { FaGithub, FaTwitter } from 'react-icons/fa';
import { PlayerBrightId } from './Section/PlayerBrightId';
type Props = {
player: Player;
disableBrightId?: boolean;
};
export const PlayerContacts: React.FC<Props> = ({
player,
disableBrightId = true, // TODO: enable after fixing issue #1068
}) => (
<Wrap justify="center" pointerEvents="all" zIndex={1000}>
{player?.accounts?.map((acc) => {
switch (acc.type) {
case 'TWITTER': {
const link = `https://twitter.com/${acc.identifier}`;
return (
<MetaTileLinkWrapper key={`${acc.identifier}_${acc.type}`}>
<IconButton
onClick={(e) => {
e.preventDefault();
if (link) window?.open(link, '_blank')?.focus();
}}
aria-label="Twitter"
title={`Twitter: ${acc.identifier}`}
icon={<FaTwitter />}
minW={6}
w={6}
h={6}
borderRadius="full"
{...linkButtonProps}
/>
</MetaTileLinkWrapper>
);
}
case 'GITHUB': {
const link = `https://github.com/${acc.identifier}`;
return (
<MetaTileLinkWrapper key={`${acc.identifier}_${acc.type}`}>
<IconButton
onClick={(e) => {
e.preventDefault();
if (link) window?.open(link, '_blank')?.focus();
}}
aria-label="GitHub"
title={`Github: ${acc.identifier}`}
icon={<FaGithub />}
minW={6}
w={6}
h={6}
borderRadius="full"
{...linkButtonProps}
/>
</MetaTileLinkWrapper>
);
}
default: {
return null;
}
}
})}
{!disableBrightId && (
<WrapItem>
<PlayerBrightId {...{ player }} />
</WrapItem>
)}
</Wrap>
);