Commit 83a124a0 authored by Jonáš Rosecký's avatar Jonáš Rosecký
Browse files

Fixed author layout

parent e0825b10
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ module.exports = {
    disableHostCheck: true,
    proxy: {
        '/api/': {
            target: 'https://games-stage.mlejnek.cafour.cz/',
            target: 'https://games.muni.cz/',
            secure: true,
            changeOrigin: true,
        },
+104 −38
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@ import {
    Center,
    Grid,
    GridItem,
    HStack,
    Heading,
    Icon,
    Image,
    Link,
    Menu,
@@ -32,6 +34,7 @@ import {
    useColorModeValue,
} from '@chakra-ui/react';
import Avatar from 'boring-avatars';
import { CZ, GB, SK } from 'country-flag-icons/react/3x2';
import { t } from 'i18next';
import moment from 'moment';
import { useState } from 'react';
@@ -93,6 +96,19 @@ export function Release() {
        return <Error error={'Game or version not found!'} />;
    }

    const getLanguageFlag = (language: string) => {
        switch (language) {
            case 'cs':
                return <Icon as={CZ} boxSize={6} />;
            case 'en':
                return <Icon as={GB} boxSize={6} />;
            case 'sk':
                return <Icon as={SK} boxSize={6} />;
            default:
                return <></>;
        }
    };

    return (
        <AwaitAPI
            request={getApiV1ReleasesById({
@@ -165,7 +181,7 @@ export function Release() {

                                        <BreadcrumbItem fontWeight={'semibold'} isCurrentPage>
                                            <BreadcrumbLink href={'games/' + release.id}>
                                                {game.name?.iv}
                                                {getPrefered(game.name)}
                                            </BreadcrumbLink>
                                        </BreadcrumbItem>
                                    </Breadcrumb>
@@ -179,7 +195,7 @@ export function Release() {
                                                fontWeight={'semibold'}
                                                color={useColorModeValue('brand.500', 'brand.400')}
                                            >
                                                {game.name?.iv}
                                                {getPrefered(game.name)}
                                            </Heading>
                                            {game.releases.length > 1 && (
                                                <Text
@@ -302,10 +318,20 @@ export function Release() {
                                                                download="OmnibulletDemo"
                                                            >
                                                                <MenuItem>
                                                                    {t('games.downloadFor')}{' '}
                                                                    {download.tags
                                                                        .map((tag) => capitalize(getPrefered(tag.name)))
                                                                        .join(', ').length > 0 ? (
                                                                        <>
                                                                            {t('games.downloadFor')}{' '}
                                                                            {download.tags
                                                                                .map((tag) =>
                                                                                    capitalize(getPrefered(tag.name)),
                                                                                )
                                                                                .join(', ')}
                                                                        </>
                                                                    ) : (
                                                                        t('games.download')
                                                                    )}
                                                                </MenuItem>
                                                            </Link>
                                                        ))}
@@ -321,8 +347,25 @@ export function Release() {
                                    <Text marginBottom={5} fontSize="md">
                                        <Wrap spacingX={10} spacingY={5} marginTop={2}>
                                            {release.authors?.map((author) => (
                                                <WrapItem key={author.id}>
                                                    <Center>
                                                <WrapItem
                                                    key={author.id}
                                                    width={{ base: '100%', md: '40%', lg: '30%', xl: '20%' }}
                                                    maxWidth={{ base: '100%', md: '40%', lg: '30%', xl: '20%' }}
                                                >
                                                    <HStack
                                                        spacing={0}
                                                        align={
                                                            author.roles.join(', ').trim().length > 0
                                                                ? 'start'
                                                                : 'center'
                                                        }
                                                    >
                                                        <Center
                                                            flexShrink={0}
                                                            width="40px"
                                                            height="40px"
                                                            position="relative"
                                                        >
                                                            <Avatar
                                                                size={40}
                                                                name={author.name}
@@ -335,7 +378,22 @@ export function Release() {
                                                                    '#C0ECCD',
                                                                ]}
                                                            />
                                                        <VStack spacing={0}>
                                                            <Center position="absolute" inset="0" color="white">
                                                                <Text
                                                                    textAlign="center"
                                                                    fontSize={'md'}
                                                                    fontWeight="bold"
                                                                    letterSpacing={1}
                                                                >
                                                                    {author.name
                                                                        .split(' ')
                                                                        .map((word) => word[0].toUpperCase())
                                                                        .slice(0, 2)
                                                                        .join('')}
                                                                </Text>
                                                            </Center>
                                                        </Center>
                                                        <VStack spacing={0} align="start">
                                                            <Text key={author.id} marginLeft={3} fontSize={'sm'}>
                                                                {author.name}
                                                            </Text>
@@ -348,7 +406,7 @@ export function Release() {
                                                                {author.roles.join(', ')}
                                                            </Text>
                                                        </VStack>
                                                    </Center>
                                                    </HStack>
                                                </WrapItem>
                                            ))}
                                        </Wrap>
@@ -486,6 +544,8 @@ export function Release() {
                        </>
                    )} */}

                                        {release.supportedLanguages.length > 0 && (
                                            <>
                                                <GridItem>
                                                    <Text
                                                        fontSize="sm"
@@ -497,13 +557,19 @@ export function Release() {
                                                    </Text>
                                                </GridItem>
                                                <GridItem>
                                                    <HStack spacing={2}>
                                                        {release.supportedLanguages.map((language, index, all) => (
                                                <Text key={language} fontSize="sm" as="span">
                                                    {language}
                                                    {index < all.length - 1 && ', '}
                                                            <>
                                                                {getLanguageFlag(language)}
                                                                <Text key={language} fontSize="sm" as="span" mr={6}>
                                                                    {language.toUpperCase()}
                                                                </Text>
                                                            </>
                                                        ))}
                                                    </HStack>
                                                </GridItem>
                                            </>
                                        )}

                                        {/* <GridItem>
                                            <Text