Don't show create team button if not logged in

This commit is contained in:
Kalle (Sendou)
2021-06-12 00:16:49 +03:00
parent 93020bc659
commit 449012e3fb
2 changed files with 4 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ const getTeamXPInfo = (roster: NonNullable<GetTeamData>["roster"]) => {
};
const TeamPage: React.FC<Props> = (props) => {
const { secondaryBgColor, themeColorHex } = useMyTheme();
const { secondaryBgColor } = useMyTheme();
const { data } = useSWR<GetTeamData>(`/api/teams/${props.team!.id}`, {
initialData: props.team!,
});

View File

@@ -45,7 +45,7 @@ const TeamsPage = ({ teams }: Props) => {
return (
<>
<MyHead title={t`Teams`} />
{!isInTeam && <CreateNewTeamModal />}
{!isInTeam && user && <CreateNewTeamModal />}
{teams.length > 0 && (
<Box mb={8}>
<FormControl display="flex" alignItems="center">
@@ -137,8 +137,8 @@ const TeamsPage = ({ teams }: Props) => {
<Flex ml={2}>
{team.countries.map((country) => (
<Box mr={1}>
<Flag key={country} countryCode={country} />
<Box key={country} mr={1}>
<Flag countryCode={country} />
</Box>
))}
</Flex>