mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-12-05 17:30:50 +00:00
Edit Carousel
Took 1 hour 41 minutes
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import {
|
||||
Card,
|
||||
Flex,
|
||||
Text,
|
||||
CardBody,
|
||||
IconButton,
|
||||
Heading,
|
||||
Box
|
||||
} from '@chakra-ui/react';
|
||||
import Carousel from '../../../Carousel';
|
||||
import {BiHeart} from 'react-icons/bi';
|
||||
import {RxCross1} from 'react-icons/rx';
|
||||
import PassionBadgeList
|
||||
from '@/components/layout/dashboard/card_user/PassionBadgeList';
|
||||
|
||||
export default function CardUser(props) {
|
||||
const {user} = props;
|
||||
|
||||
const interestingUser = {
|
||||
lastName: 'dujardin',
|
||||
firstName: 'jean',
|
||||
age: 19,
|
||||
aPropos: 'Je suis une personne fictive, pas tres fictive',
|
||||
images: ['/401446.webp', '/135538.webp'],
|
||||
passions: ['Sport', 'Piscine', 'Formule1'],
|
||||
};
|
||||
|
||||
return (
|
||||
<Card maxW="md" borderRadius={'1rem'} overflow={'hidden'}>
|
||||
<Carousel images={interestingUser.images}/>
|
||||
|
||||
<CardBody>
|
||||
<Flex justify={'space-between'} mb={'20px'}>
|
||||
<Heading fontSize={'1.5rem'} fontWeight={'bold'} flexBasis={'70%'}>
|
||||
{interestingUser.firstName} {interestingUser.lastName}, {interestingUser.age}ans
|
||||
</Heading>
|
||||
|
||||
<Flex gap={1}>
|
||||
<IconButton borderRadius={'1rem'} colorScheme={'purple'}><BiHeart/></IconButton>
|
||||
<IconButton borderRadius={'1rem'} colorScheme={'purple'}
|
||||
variant={'outline'}><RxCross1/></IconButton>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
<Box mb={'20px'}>
|
||||
<Heading size={'sm'} fontWeight={'bold'}>A propos :</Heading>
|
||||
<Text>{interestingUser.aPropos}</Text>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Heading size={'sm'} fontWeight={'bold'}>Passions :</Heading>
|
||||
<PassionBadgeList passions={interestingUser.passions}
|
||||
userPassions={user.passions}/>
|
||||
</Box>
|
||||
</CardBody>
|
||||
</Card>
|
||||
);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import {Badge, Flex} from '@chakra-ui/react';
|
||||
|
||||
type Props = {
|
||||
passions: string[],
|
||||
userPassions?: string[]
|
||||
}
|
||||
|
||||
export default function PassionBadgeList({passions, userPassions = []}: Props) {
|
||||
return (
|
||||
<Flex gap={'0.5rem'} mt={'1vh'}>
|
||||
{passions.map((passion, index) =>
|
||||
<Badge key={index} colorScheme={
|
||||
userPassions.includes(passion) ? 'purple' : 'ghost'
|
||||
}
|
||||
>#{passion}</Badge>,
|
||||
)}
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
Card,
|
||||
Flex,
|
||||
Box,
|
||||
Image,
|
||||
Text,
|
||||
Button,
|
||||
VStack,
|
||||
Spacer,
|
||||
} from '@chakra-ui/react';
|
||||
import {useRouter} from 'next/router';
|
||||
import {AiFillMessage} from 'react-icons/ai';
|
||||
import {BsFillPersonFill} from 'react-icons/bs';
|
||||
import LeftPanelButton
|
||||
from '@/components/layout/dashboard/left_panel/LeftPanelButton';
|
||||
|
||||
export default function LeftPanel(props) {
|
||||
const router = useRouter();
|
||||
const {user} = props;
|
||||
|
||||
return (
|
||||
<Card width={'20vw'} height={'100vh'} padding={'0px'}>
|
||||
<Flex direction={'column'} height={'100%'} margin={'10%'}>
|
||||
<Box>
|
||||
<Image src={user.images[0]} borderRadius={'1rem'}/>
|
||||
<Box mt={'1vh'}>
|
||||
<Text fontSize={'1.5rem'} fontWeight={'bold'}>
|
||||
{user.firstName} {user.lastName}
|
||||
</Text>
|
||||
<Text as="i" fontWeight={'bold'}>
|
||||
"{user.aPropos}"
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
<Spacer/>
|
||||
<Flex gap={2} direction={'column'} mt={'1vh'} spacing={3.5}
|
||||
alignContent={'bottom'}>
|
||||
|
||||
<LeftPanelButton leftIcon={<AiFillMessage/>}
|
||||
onClickHandler={() => router.push('/dashboard')}>
|
||||
Messages
|
||||
</LeftPanelButton>
|
||||
<LeftPanelButton leftIcon={<BsFillPersonFill/>}
|
||||
onClickHandler={() => router.push('/dashboard')}>
|
||||
Profile
|
||||
</LeftPanelButton>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import {Button} from '@chakra-ui/react';
|
||||
import {ReactJSXElement} from '@emotion/react/types/jsx-namespace';
|
||||
|
||||
type Props = {
|
||||
children?: ReactJSXElement
|
||||
onClickHandler: () => void
|
||||
leftIcon ?: ReactJSXElement
|
||||
}
|
||||
|
||||
export default function LeftPanelButton(props: Props) {
|
||||
const {children, onClickHandler, leftIcon: icon} = props;
|
||||
|
||||
return (
|
||||
<Button
|
||||
colorScheme={'purple'}
|
||||
variant={'ghost'}
|
||||
width={'100%'}
|
||||
justifyContent={'left'}
|
||||
onClick={onClickHandler}
|
||||
leftIcon={icon}
|
||||
fontWeight={'bold'}
|
||||
fontSize={'1.2rem'}
|
||||
>{children}</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user