mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-11 14:34:56 -05:00
* 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"
31 lines
928 B
TypeScript
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>
|
|
);
|
|
};
|