hide suggestion text in UI if not member

This commit is contained in:
Kalle (Sendou) 2021-04-15 16:31:24 +03:00
parent 225b3ac9ed
commit c7e1440a4c

View File

@ -1,11 +1,11 @@
import { Box, Center, Divider, Flex, Stack } from "@chakra-ui/layout";
import { Box, Center, Divider, Flex, Heading, Stack } from "@chakra-ui/layout";
import {
Alert,
AlertDescription,
AlertTitle,
Progress,
Radio,
RadioGroup,
RadioGroup
} from "@chakra-ui/react";
import { Trans } from "@lingui/macro";
import { usePlusHomePage } from "app/plus/hooks/usePlusHomePage";
@ -32,6 +32,18 @@ const PlusHomePage = () => {
votingProgress,
} = usePlusHomePage();
if (!plusStatusData?.membershipTier) {
return <Box>
<Box fontSize="sm" mb={4}>
<VotingInfoHeader isMember={!!plusStatusData?.membershipTier} />
</Box>
<Heading size="md">Suggested players this month:</Heading>
<Flex flexWrap="wrap">
{suggestionsData.sort((a,b) => a.createdAt.getTime() - b.createdAt.getTime()).map(suggestion => <Box key={suggestion.tier + "+" + suggestion.suggestedUser.id} m={1}>{getFullUsername(suggestion.suggestedUser)} (+{suggestion.tier})</Box>)}
</Flex>
</Box>
}
return (
<>
<MyHead title="Plus Server" />