Files
TheGame/packages/web/components/Player/Section/PlayerSkills.tsx
Hammad Jutt 7492ae5bd6 Remove unused pages / components and fix usage of Wrap with WrapItem (#284)
* Remove unused pages / components

* Add WrapItem around components inside Wrap component

New version of Chakra requires WrapItem around any components that have Wrap

* Update LoginButton to link to own profile and show Avatar (#285)

* Update LoginButton to link to own profile and show Avatar

* Change SetupUsername to explicitly mention "username"
2021-01-18 11:44:52 -07:00

31 lines
928 B
TypeScript

import { MetaTag, Wrap, WrapItem } from '@metafam/ds';
import { PlayerFragmentFragment } from 'graphql/autogen/types';
import { SkillColors } from 'graphql/types';
import React from 'react';
import { ProfileSection } from '../../ProfileSection';
type Props = { player: PlayerFragmentFragment; onRemoveClick: () => void };
export const PlayerSkills: React.FC<Props> = ({ player, onRemoveClick }) => {
if (!player.Player_Skills?.length) {
return null;
}
return (
<ProfileSection title="Skills" onRemoveClick={onRemoveClick}>
<Wrap>
{(player.Player_Skills || []).map(({ Skill }) => (
<WrapItem key={Skill.id}>
<MetaTag
size="md"
fontWeight="normal"
backgroundColor={SkillColors[Skill.category]}
>
{Skill.name}
</MetaTag>
</WrapItem>
))}
</Wrap>
</ProfileSection>
);
};