Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#308 팀페이지 설명글 반응형 수정 #309

Merged
25 changes: 24 additions & 1 deletion src/components/Title/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Text, Flex, Avatar, Box } from '@chakra-ui/react';
import { useState } from 'react';

import S3_URL from '@/constants/s3Url';

import { TitleProps } from './types';

const Title = ({ isTeam, name, description, imageUrl }: TitleProps) => {
const [isHovered, setIsHovered] = useState(false);

return (
<Flex pos="relative" align="center" gap="3">
{isTeam && (
Expand All @@ -16,7 +19,10 @@ const Title = ({ isTeam, name, description, imageUrl }: TitleProps) => {
src={imageUrl ? S3_URL(imageUrl) : '/images/doore_logo.png'}
/>
)}
<Text textStyle="bold_3xl">{name}</Text>
<Text textStyle="bold_3xl" onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
{name}
</Text>

<Box pos="relative" display={{ base: 'none', lg: 'block' }} w="10" h="12" px="2">
<Box pos="absolute" zIndex="1" top="50%" w="5" h="5" bg="white" transform="translate(0%, -50%) rotate(45deg)" />
<Flex
Expand All @@ -35,6 +41,23 @@ const Title = ({ isTeam, name, description, imageUrl }: TitleProps) => {
</Text>
</Flex>
</Box>

<Box
pos="absolute"
zIndex="2"
top="100%"
left={isTeam ? '10' : '0'}
alignContent="center"
display={{ base: isHovered ? 'block' : 'none', lg: 'none' }}
w={{ base: '72', '2xl': '96' }}
h="100%"
p="2"
bg="white"
borderRadius="base"
shadow="md"
>
<Text>{description}</Text>
</Box>
</Flex>
);
};
Expand Down