open trading links in new page from wardrobe page

This commit is contained in:
Emi Matchu 2020-11-23 09:36:05 -08:00
parent 1af034e4e7
commit 9481ce05a6

View file

@ -84,7 +84,7 @@ export function ItemPageContent({ itemId, isEmbedded }) {
/> />
<VStack spacing="4"> <VStack spacing="4">
{isLoggedIn && <ItemPageOwnWantButtons itemId={itemId} />} {isLoggedIn && <ItemPageOwnWantButtons itemId={itemId} />}
<ItemPageTradeLinks itemId={itemId} /> <ItemPageTradeLinks itemId={itemId} isEmbedded={isEmbedded} />
</VStack> </VStack>
{!isEmbedded && <ItemPageOutfitPreview itemId={itemId} />} {!isEmbedded && <ItemPageOutfitPreview itemId={itemId} />}
</VStack> </VStack>
@ -358,7 +358,7 @@ function ItemPageWantButton({ itemId, isChecked }) {
); );
} }
function ItemPageTradeLinks({ itemId }) { function ItemPageTradeLinks({ itemId, isEmbedded }) {
const { data, loading, error } = useQuery( const { data, loading, error } = useQuery(
gql` gql`
query ItemPageTradeLinks($itemId: ID!) { query ItemPageTradeLinks($itemId: ID!) {
@ -387,6 +387,7 @@ function ItemPageTradeLinks({ itemId }) {
count={data?.item?.numUsersOfferingThis || 0} count={data?.item?.numUsersOfferingThis || 0}
label="offering" label="offering"
colorScheme="green" colorScheme="green"
isEmbedded={isEmbedded}
/> />
</SubtleSkeleton> </SubtleSkeleton>
<SubtleSkeleton isLoaded={!loading}> <SubtleSkeleton isLoaded={!loading}>
@ -395,18 +396,20 @@ function ItemPageTradeLinks({ itemId }) {
count={data?.item?.numUsersSeekingThis || 0} count={data?.item?.numUsersSeekingThis || 0}
label="seeking" label="seeking"
colorScheme="blue" colorScheme="blue"
isEmbedded={isEmbedded}
/> />
</SubtleSkeleton> </SubtleSkeleton>
</HStack> </HStack>
); );
} }
function ItemPageTradeLink({ itemId, count, label, colorScheme }) { function ItemPageTradeLink({ itemId, count, label, colorScheme, isEmbedded }) {
return ( return (
<Button <Button
as="a" as="a"
// TODO: Link to a new Impress 2020 page instead! // TODO: Link to a new Impress 2020 page instead!
href={`https://impress.openneo.net/items/${itemId}`} href={`https://impress.openneo.net/items/${itemId}`}
target={isEmbedded ? "_blank" : undefined}
size="xs" size="xs"
variant="outline" variant="outline"
colorScheme={colorScheme} colorScheme={colorScheme}