mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 06:58:06 +00:00
style(Switched Badge with Tag): Switch badge with Tag, prettier
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
@@ -5,57 +5,70 @@ import {
|
|||||||
CardBody,
|
CardBody,
|
||||||
IconButton,
|
IconButton,
|
||||||
Heading,
|
Heading,
|
||||||
Box, CardHeader,
|
Box,
|
||||||
} from '@chakra-ui/react';
|
CardHeader,
|
||||||
import Carousel from '../../../Carousel';
|
} from "@chakra-ui/react";
|
||||||
import {BiHeart} from 'react-icons/bi';
|
import Carousel from "../../../Carousel";
|
||||||
import {RxCross1} from 'react-icons/rx';
|
import { BiHeart } from "react-icons/bi";
|
||||||
import PassionBadgeList
|
import { RxCross1 } from "react-icons/rx";
|
||||||
from '@/components/layout/dashboard/card_user/PassionBadgeList';
|
import PassionTagList from "@/components/layout/dashboard/card_user/PassionTagList";
|
||||||
|
|
||||||
export default function CardUser(props) {
|
export default function CardUser(props) {
|
||||||
const { user } = props;
|
const { user } = props;
|
||||||
|
|
||||||
const interestingUser = {
|
const interestingUser = {
|
||||||
lastName: 'dujardin',
|
lastName: "dujardin",
|
||||||
firstName: 'jean',
|
firstName: "jean",
|
||||||
age: 19,
|
age: 19,
|
||||||
aPropos: 'Je suis une personne fictive, pas tres fictive',
|
aPropos: "Je suis une personne fictive, pas tres fictive",
|
||||||
images: ['/401446.webp', '/135538.webp'],
|
images: ["/401446.webp", "/135538.webp"],
|
||||||
passions: ['Sport', 'Piscine', 'Formule1'],
|
passions: ["Sport", "Piscine", "Formule1"],
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card w={"100%"} h={"100%"} borderRadius={'1rem'} overflow={'hidden'}>
|
<Card w={"100%"} h={"100%"} borderRadius={"1rem"} overflow={"hidden"}>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<Carousel borderRadius={"1rem"} images={interestingUser.images} />
|
<Carousel borderRadius={"1rem"} images={interestingUser.images} />
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Flex justify={'space-between'} mb={'20px'}>
|
<Flex justify={"space-between"} mb={"20px"}>
|
||||||
<Heading fontSize={'1.5rem'} fontWeight={'bold'} flexBasis={'70%'}>
|
<Heading fontSize={"1.5rem"} fontWeight={"bold"} flexBasis={"70%"}>
|
||||||
{interestingUser.firstName} {interestingUser.lastName}, {interestingUser.age}ans
|
{interestingUser.firstName} {interestingUser.lastName},{" "}
|
||||||
|
{interestingUser.age}ans
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Flex gap={1}>
|
<Flex gap={1}>
|
||||||
<IconButton borderRadius={'1rem'} colorScheme={'purple'}><BiHeart/></IconButton>
|
<IconButton borderRadius={"1rem"} colorScheme={"purple"}>
|
||||||
<IconButton borderRadius={'1rem'} colorScheme={'purple'}
|
<BiHeart />
|
||||||
variant={'outline'}><RxCross1/></IconButton>
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
borderRadius={"1rem"}
|
||||||
|
colorScheme={"purple"}
|
||||||
|
variant={"outline"}
|
||||||
|
>
|
||||||
|
<RxCross1 />
|
||||||
|
</IconButton>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Box mb={'20px'}>
|
<Box mb={"20px"}>
|
||||||
<Heading size={'sm'} fontWeight={'bold'}>A propos :</Heading>
|
<Heading size={"sm"} fontWeight={"bold"}>
|
||||||
|
A propos :
|
||||||
|
</Heading>
|
||||||
<Text>{interestingUser.aPropos}</Text>
|
<Text>{interestingUser.aPropos}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<Heading size={'sm'} fontWeight={'bold'}>Passions :</Heading>
|
<Heading size={"sm"} fontWeight={"bold"}>
|
||||||
<PassionBadgeList passions={interestingUser.passions}
|
Passions :
|
||||||
userPassions={user.passions}/>
|
</Heading>
|
||||||
|
<PassionTagList
|
||||||
|
passions={interestingUser.passions}
|
||||||
|
userPassions={user.passions}
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
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,22 @@
|
|||||||
|
import { Badge, Flex, Tag } from "@chakra-ui/react";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
passions: string[];
|
||||||
|
userPassions?: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function PassionTagList({ passions, userPassions = [] }: Props) {
|
||||||
|
return (
|
||||||
|
<Flex gap={"0.5rem"} mt={"1vh"}>
|
||||||
|
{passions.map((passion, index) => (
|
||||||
|
<Tag
|
||||||
|
key={index}
|
||||||
|
variant={userPassions.includes(passion) ? "subtle" : "outline"}
|
||||||
|
colorScheme={"purple"}
|
||||||
|
>
|
||||||
|
{passion}
|
||||||
|
</Tag>
|
||||||
|
))}
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
Badge,
|
|
||||||
useCheckbox,
|
useCheckbox,
|
||||||
Text,
|
|
||||||
Flex,
|
|
||||||
chakra,
|
chakra,
|
||||||
Box,
|
|
||||||
Tag,
|
Tag,
|
||||||
TagLeftIcon,
|
TagLeftIcon,
|
||||||
TagLabel,
|
TagLabel,
|
||||||
@@ -13,7 +9,7 @@ import {
|
|||||||
import { IoAdd, IoRemove } from "react-icons/io5";
|
import { IoAdd, IoRemove } from "react-icons/io5";
|
||||||
|
|
||||||
export default function CustomCheckbox(props) {
|
export default function CustomCheckbox(props) {
|
||||||
const { text, checked, value } = props;
|
const { text } = props;
|
||||||
const { state, getInputProps, getCheckboxProps, getLabelProps, htmlProps } =
|
const { state, getInputProps, getCheckboxProps, getLabelProps, htmlProps } =
|
||||||
useCheckbox(props);
|
useCheckbox(props);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user