refactor ItemPage a bit

to prepare the way for the other content
This commit is contained in:
Emi Matchu 2020-09-12 17:27:00 -07:00
parent 4f6f3640bb
commit ef7ba58c90

View file

@ -47,6 +47,14 @@ function ItemPage() {
const { item } = data; const { item } = data;
return (
<Box>
<ItemPageHeader item={item} />
</Box>
);
}
function ItemPageHeader({ item }) {
return ( return (
<Box display="flex" alignItems="center"> <Box display="flex" alignItems="center">
<ItemThumbnail <ItemThumbnail
@ -58,6 +66,14 @@ function ItemPage() {
/> />
<Box> <Box>
<Heading1 lineHeight="1.1">{item.name}</Heading1> <Heading1 lineHeight="1.1">{item.name}</Heading1>
<ItemPageBadges item={item} />
</Box>
</Box>
);
}
function ItemPageBadges({ item }) {
return (
<ItemBadgeList> <ItemBadgeList>
{item.isNc ? <NcBadge /> : <NpBadge />} {item.isNc ? <NcBadge /> : <NpBadge />}
<LinkBadge <LinkBadge
@ -110,8 +126,6 @@ function ItemPage() {
</LinkBadge> </LinkBadge>
)} )}
</ItemBadgeList> </ItemBadgeList>
</Box>
</Box>
); );
} }