Files
TheGame/packages/web/components/Player/Box/PlayerAchievements.tsx
vanmoortel 17fde6510a Hotfix/hide unused sections (#183)
* Remove true in text and hide read more if less than 115 characters

* Hide view all/less if not more than 3 fake data

* Hide view all/less if not more than 3 fake data

* Hide unused sections, gallery and achievements
2020-11-26 18:08:40 -07:00

40 lines
1.1 KiB
TypeScript

import { HStack, Text } from '@metafam/ds';
import React from 'react';
import { FaMedal } from 'react-icons/fa';
import { PlayerBox } from './PlayerBoxe';
// TODO Fake data
type Props = { setRemoveBox: () => void };
export const PlayerAchievements: React.FC<Props> = ({ setRemoveBox }) => {
const [show, setShow] = React.useState(false);
const fakeData = [
'Founding Father of MetaGame',
'Summoner of Meta Fam',
'Dragon Quests Quest',
];
return (
<PlayerBox title="Achievements" setRemoveBox={setRemoveBox}>
{(fakeData || []).slice(0, show ? 999 : 3).map((title) => (
<HStack alignItems="baseline" mb={3}>
<FaMedal color="#FBB112" />
<Text fontSize="md">{title}</Text>
</HStack>
))}
{(fakeData || []).length > 3 && (
<Text
as="span"
fontFamily="body"
fontSize="xs"
color="cyanText"
cursor="pointer"
onClick={() => setShow(!show)}
>
View {show ? 'less' : 'all'}
</Text>
)}
</PlayerBox>
);
};