Files
TheGame/packages/web/components/Player/Box/PlayerBoxe.tsx
dan13ram aa0a532d4a updated frontend to display nft gallery from 3box/opensea (#222)
* updated backend to read 3box collectiblesFavorite

* removed unneccesary '?'

* updated frontend to display nft gallery from 3box/opensea

* prettier format

* using theme colors/sizes

* fixed nft price string
2020-12-16 11:16:31 -07:00

52 lines
1.1 KiB
TypeScript

import { Box, HStack, Text } from '@metafam/ds';
import React from 'react';
import { FaTimes } from 'react-icons/fa';
export type PlayerBoxProps = {
title?: string;
children?: React.ReactNode;
setRemoveBox?: () => void;
};
// TODO If MetaBox is only used for Player profile maybe merge both component
export const PlayerBox: React.FC<PlayerBoxProps> = ({
children,
title,
setRemoveBox,
}) => (
<Box>
{!!title && (
<Box bg="rgba(70, 20, 100, 0.8)" borderTopRadius="lg" p={4}>
<HStack>
<Text
fontFamily="mono"
fontSize="sm"
fontWeight="bold"
color="blueLight"
as="div"
mr="auto"
>
{title}
</Text>
<FaTimes
color="blueLight"
opacity="0.4"
cursor="pointer"
onClick={setRemoveBox}
/>
</HStack>
</Box>
)}
<Box
bg="whiteAlpha.200"
borderBottomRadius="lg"
borderTopRadius={!title ? 'lg' : 0}
p={6}
boxShadow="md"
css={{ backdropFilter: 'blur(8px)' }}
>
{children}
</Box>
</Box>
);