mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 15:08:06 +00:00
feat(Info user Dashboard): Added info user Panel left side of dashboard
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -6,22 +6,30 @@ export default function CardUser(props) {
|
|||||||
// const data_user = props;
|
// const data_user = props;
|
||||||
const borderRad = "2rem";
|
const borderRad = "2rem";
|
||||||
|
|
||||||
|
const potentialMatch = {
|
||||||
|
lastName: "dujardin",
|
||||||
|
firstName: "jean",
|
||||||
|
age: 19,
|
||||||
|
aPropos: "Je suis une personne fictive, pas tres fictive",
|
||||||
|
images: ["401446.webp"],
|
||||||
|
passions: ["Sport", "Piscine", "Formule1"],
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
borderRadius={borderRad}
|
borderRadius={borderRad}
|
||||||
width={"30vw"}
|
width={"35vw"}
|
||||||
height={"100vh"}
|
height={"90vh"}
|
||||||
padding={"0px"}
|
padding={"0px"}
|
||||||
|
marginY={"auto"}
|
||||||
>
|
>
|
||||||
<Carousel
|
<Carousel
|
||||||
user={user}
|
actualUser={user}
|
||||||
|
potentialMatch={potentialMatch}
|
||||||
borderRadiusImg={borderRad}
|
borderRadiusImg={borderRad}
|
||||||
heightPhoto={"75vh"}
|
heightPhoto={"75vh"}
|
||||||
heightText={"25vh"}
|
heightText={"25vh"}
|
||||||
/>
|
/>
|
||||||
<Flex>
|
|
||||||
<Box></Box>
|
|
||||||
</Flex>
|
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,7 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
|
|
||||||
import {
|
import { BiLeftArrowAlt, BiRightArrowAlt, BiHeart } from "react-icons/bi";
|
||||||
BiLeftArrowAlt,
|
|
||||||
BiRightArrowAlt,
|
|
||||||
BiHeart,
|
|
||||||
} from "react-icons/bi";
|
|
||||||
|
|
||||||
import { RxCross1 } from "react-icons/rx";
|
import { RxCross1 } from "react-icons/rx";
|
||||||
import Slider from "react-slick";
|
import Slider from "react-slick";
|
||||||
@@ -32,17 +28,7 @@ const settings = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function Carousel(props) {
|
export default function Carousel(props) {
|
||||||
const { borderRadiusImg, user } = props;
|
const { borderRadiusImg, actualUser, potentialMatch } = props;
|
||||||
|
|
||||||
// C'est l'utilisateur qui est login
|
|
||||||
const actualUser = {
|
|
||||||
lastName: "Alexandra",
|
|
||||||
firstName: "Lamie",
|
|
||||||
age: 21,
|
|
||||||
aPropos: "Je suis la personne fictive la plus fictive",
|
|
||||||
images: ["401446.webp"],
|
|
||||||
passions: ["Sport", "Voiture", "Cuisine"],
|
|
||||||
};
|
|
||||||
|
|
||||||
const [slider, setSlider] = React.useState();
|
const [slider, setSlider] = React.useState();
|
||||||
|
|
||||||
@@ -52,13 +38,6 @@ export default function Carousel(props) {
|
|||||||
const top = useBreakpointValue({ base: "90%", md: "50%" });
|
const top = useBreakpointValue({ base: "90%", md: "50%" });
|
||||||
const side = useBreakpointValue({ base: "30%", md: "10px" });
|
const side = useBreakpointValue({ base: "30%", md: "10px" });
|
||||||
|
|
||||||
// These are the images used in the slide
|
|
||||||
// const cards = [
|
|
||||||
// 'https://images.unsplash.com/photo-1612852098516-55d01c75769a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1yZWxhdGVkfDR8fHxlbnwwfHx8fA%3D%3D&auto=format&fit=crop&w=900&q=60',
|
|
||||||
// 'https://images.unsplash.com/photo-1627875764093-315831ac12f7?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1yZWxhdGVkfDJ8fHxlbnwwfHx8fA%3D%3D&auto=format&fit=crop&w=900&q=60',
|
|
||||||
// 'https://images.unsplash.com/photo-1571432248690-7fd6980a1ae2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1yZWxhdGVkfDl8fHxlbnwwfHx8fA%3D%3D&auto=format&fit=crop&w=900&q=60',
|
|
||||||
// ];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
@@ -109,10 +88,10 @@ export default function Carousel(props) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
{/* Slider */}
|
{/* Slider */}
|
||||||
<Slider {...settings} ref={(slider) => setSlider(slider)}>
|
<Slider {...settings} ref={(slider) => setSlider(slider)}>
|
||||||
{user.images.map((url, index) => (
|
{potentialMatch.images.map((url, index) => (
|
||||||
<Box
|
<Box
|
||||||
key={index}
|
key={index}
|
||||||
borderTopEndRadius={borderRadiusImg}
|
borderTopRadius={borderRadiusImg}
|
||||||
height={heightPhoto}
|
height={heightPhoto}
|
||||||
backgroundPosition="center"
|
backgroundPosition="center"
|
||||||
backgroundSize="cover"
|
backgroundSize="cover"
|
||||||
@@ -134,7 +113,8 @@ export default function Carousel(props) {
|
|||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{user.firstName} {user.lastName} , {user.age} ans
|
{potentialMatch.firstName} {potentialMatch.lastName} ,{" "}
|
||||||
|
{potentialMatch.age} ans
|
||||||
</h1>
|
</h1>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<Box alignItems="center" display="flex">
|
<Box alignItems="center" display="flex">
|
||||||
@@ -152,12 +132,12 @@ export default function Carousel(props) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Box m={"1vh"}>
|
<Box m={"1vh"}>
|
||||||
<Text style={{ fontWeight: "bold" }}>{user.aPropos}</Text>
|
<Text style={{ fontWeight: "bold" }}>{potentialMatch.aPropos}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box m={"1vh"}>
|
<Box m={"1vh"}>
|
||||||
<h2 style={{ fontWeight: "bold" }}>Passions :</h2>
|
<h2 style={{ fontWeight: "bold" }}>Passions :</h2>
|
||||||
<Flex gap={"0.5rem"} mt={"1vh"}>
|
<Flex gap={"0.5rem"} mt={"1vh"}>
|
||||||
{user.passions.map((passion, index) =>
|
{potentialMatch.passions.map((passion, index) =>
|
||||||
actualUser.passions.includes(passion) ? (
|
actualUser.passions.includes(passion) ? (
|
||||||
<Badge borderRadius={"0.5rem"} colorScheme={"purple"}>
|
<Badge borderRadius={"0.5rem"} colorScheme={"purple"}>
|
||||||
#{passion}
|
#{passion}
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
import {
|
||||||
|
Card,
|
||||||
|
Flex,
|
||||||
|
Box,
|
||||||
|
Image,
|
||||||
|
Text,
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
HStack,
|
||||||
|
VStack,
|
||||||
|
Spacer,
|
||||||
|
} from "@chakra-ui/react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import Carousel from "./Carousel";
|
||||||
|
import { AiFillMessage } from "react-icons/ai";
|
||||||
|
import { BsFillPersonFill } from "react-icons/bs";
|
||||||
|
|
||||||
|
export default function InfoUser(props) {
|
||||||
|
const router = useRouter();
|
||||||
|
const { user } = props;
|
||||||
|
// const data_user = props;
|
||||||
|
const borderRad = "2rem";
|
||||||
|
|
||||||
|
const buttonGenerator = (icon, text, url) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
bg={"white"}
|
||||||
|
_hover={{ bg: "blackAlpha.100", color: "purple.400" }}
|
||||||
|
width={"100%"}
|
||||||
|
lineHeight={"auto"}
|
||||||
|
justifyContent={"left"}
|
||||||
|
onClick={() => router.push(url)}
|
||||||
|
>
|
||||||
|
<HStack spacing={"1rem"} alignItems={"center"}>
|
||||||
|
{icon}
|
||||||
|
<Text fontWeight={"bold"} fontSize={"1.2rem"}>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
|
</HStack>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
//changer l'url
|
||||||
|
const messageButton = buttonGenerator(
|
||||||
|
<AiFillMessage />,
|
||||||
|
"Messages",
|
||||||
|
"/test_card"
|
||||||
|
);
|
||||||
|
|
||||||
|
const profileButton = buttonGenerator(
|
||||||
|
<BsFillPersonFill />,
|
||||||
|
"Profile",
|
||||||
|
"/test_card"
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
borderRadius={borderRad}
|
||||||
|
width={"20vw"}
|
||||||
|
height={"100vh"}
|
||||||
|
padding={"0px"}
|
||||||
|
>
|
||||||
|
<Flex direction={"column"} height={"100%"} margin={"10%"}>
|
||||||
|
<Box>
|
||||||
|
<Image src={user.images[0]} borderRadius={borderRad} />
|
||||||
|
<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 />
|
||||||
|
<VStack mt={"1vh"} spacing={3.5} alignContent={"bottom"}>
|
||||||
|
{messageButton}
|
||||||
|
{profileButton}
|
||||||
|
</VStack>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
+11
-20
@@ -1,27 +1,18 @@
|
|||||||
import {
|
import { Box, Flex } from "@chakra-ui/react";
|
||||||
Box,
|
import RegisterForm from "@/components/form/RegisterForm";
|
||||||
Button,
|
|
||||||
Flex,
|
|
||||||
FormControl,
|
|
||||||
FormErrorMessage,
|
|
||||||
FormLabel,
|
|
||||||
Heading,
|
|
||||||
Image,
|
|
||||||
Input,
|
|
||||||
Spacer,
|
|
||||||
} from '@chakra-ui/react';
|
|
||||||
import {useRouter} from 'next/router';
|
|
||||||
import {useForm} from 'react-hook-form';
|
|
||||||
import RegisterForm from '@/components/form/RegisterForm';
|
|
||||||
|
|
||||||
export default function Register() {
|
export default function Register() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Flex gap={10} h={'100vh'} alignItems={'center'}>
|
<Flex gap={10} h={"100vh"} alignItems={"center"}>
|
||||||
<Box display={{base: 'none', md: 'block'}} h={'100%'}
|
<Box
|
||||||
flexBasis={'100%'} bgImage={'/couple_holding_hands.png'}
|
display={{ base: "none", md: "block" }}
|
||||||
bgPos={'center'} bgSize={'cover'}/>
|
h={"100%"}
|
||||||
|
flexBasis={"100%"}
|
||||||
|
bgImage={"/couple_holding_hands.png"}
|
||||||
|
bgPos={"center"}
|
||||||
|
bgSize={"cover"}
|
||||||
|
/>
|
||||||
<RegisterForm />
|
<RegisterForm />
|
||||||
</Flex>
|
</Flex>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
+15
-9
@@ -1,16 +1,22 @@
|
|||||||
|
import { Flex } from "@chakra-ui/react";
|
||||||
import CardUser from "../components/CardUser";
|
import CardUser from "../components/CardUser";
|
||||||
|
import InfoUser from "../components/InfoUser";
|
||||||
|
|
||||||
export default function Test_card() {
|
export default function Test_card() {
|
||||||
const user = {
|
const user = {
|
||||||
lastName: "dujardin",
|
lastName: "Alexandra",
|
||||||
firstName: "jean",
|
firstName: "Lamy",
|
||||||
age: 19,
|
age: 21,
|
||||||
aPropos: "Je suis une personne fictive, pas tres fictive",
|
aPropos: "Je suis la personne fictive la plus fictive",
|
||||||
images: ["401446.webp"],
|
images: ["135538.webp"],
|
||||||
passions: ["Sport", "Piscine", "Formule1"],
|
passions: ["Sport", "Voiture", "Cuisine"],
|
||||||
};
|
};
|
||||||
|
|
||||||
//faudra faire une requete sur la BD pour chaque utilisateurs
|
return (
|
||||||
|
<Flex gap={10}>
|
||||||
return <CardUser user={user} />;
|
{/* à terme, envoyer les données du user depuis la session */}
|
||||||
|
<InfoUser user={user} />
|
||||||
|
<CardUser user={user} />
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user