Files
TheGame/packages/web/components/Player/PlayerContacts.tsx
dan13ram f95b12751e profile setup - about you flow (#130)
* added data for personality types and refactored images

* setup personality type

* setup player type

* player types descriptions
2020-10-08 22:00:53 -06:00

52 lines
1.3 KiB
TypeScript

import { Button } from '@metafam/ds';
import { PlayerFragmentFragment } from 'graphql/autogen/types';
import React from 'react';
import { FaGithub, FaTwitter } from 'react-icons/fa';
type Props = {
player: PlayerFragmentFragment;
};
export const PlayerContacts: React.FC<Props> = ({ player }) => {
return (
<>
{player.Accounts.map((acc) => {
if (acc.type === 'TWITTER') {
const link = `https://twitter.com/${acc.identifier}`;
return (
<Button
as="a"
href={link}
target="_blank"
key={link}
size="xs"
colorScheme="twitter"
leftIcon={<FaTwitter />}
>
{acc.identifier}
</Button>
);
}
if (acc.type === 'GITHUB') {
const link = `https://github.com/${acc.identifier}`;
return (
<Button
as="a"
href={link}
target="_blank"
key={link}
size="xs"
colorScheme="blackAlpha"
backgroundColor="black"
leftIcon={<FaGithub />}
>
{acc.identifier}
</Button>
);
}
return null;
})}
</>
);
};