mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 06:58:06 +00:00
Update Schema User gender
Took 15 minutes
This commit is contained in:
@@ -19,7 +19,7 @@ model User {
|
|||||||
location String?
|
location String?
|
||||||
images String[]
|
images String[]
|
||||||
birthdate DateTime?
|
birthdate DateTime?
|
||||||
sex Sex?
|
gender Gender @default(UNKNOWN)
|
||||||
role Role @default(USER)
|
role Role @default(USER)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
@@ -75,9 +75,11 @@ model Message {
|
|||||||
Chat Chat? @relation(fields: [ChatID], references: [id])
|
Chat Chat? @relation(fields: [ChatID], references: [id])
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Sex {
|
enum Gender {
|
||||||
MALE
|
MALE
|
||||||
FEMALE
|
FEMALE
|
||||||
|
OTHER
|
||||||
|
UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Role {
|
enum Role {
|
||||||
|
|||||||
@@ -3,32 +3,32 @@ import {Flex, IconButton} from '@chakra-ui/react';
|
|||||||
import { BiLeftArrowAlt, BiRightArrowAlt } from "react-icons/bi";
|
import { BiLeftArrowAlt, BiRightArrowAlt } from "react-icons/bi";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
images: string[];
|
images: string[]
|
||||||
|
borderRadius?: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Carousel = ({images}: Props) => {
|
const Carousel = ({images, borderRadius: bRadius}: Props) => {
|
||||||
const [currentIndex, setCurrentIndex] = useState(0);
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
|
|
||||||
const handleClickPrevious = () => {
|
const handleClickPrevious = () => {
|
||||||
setCurrentIndex(
|
setCurrentIndex(
|
||||||
(currentIndex === 0)
|
(currentIndex === 0)
|
||||||
? images.length - 1
|
? images.length - 1 : currentIndex - 1,
|
||||||
: currentIndex - 1,
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClickNext = () => {
|
const handleClickNext = () => {
|
||||||
setCurrentIndex(
|
setCurrentIndex(
|
||||||
(currentIndex === images.length - 1)
|
(currentIndex === images.length - 1)
|
||||||
? 0
|
? 0 : currentIndex + 1,
|
||||||
: currentIndex + 1,
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex px={2} align="center" justify={'space-between'}
|
<Flex px={2} align="center" borderRadius={bRadius} overflow={"hidden"} justify={'space-between'}
|
||||||
bgImage={images[currentIndex]} bgSize={'cover'} width={'100%'}
|
bgImage={images[currentIndex]} bgSize={'cover'} width={'100%'}
|
||||||
height={500}>
|
height={500}>
|
||||||
|
|
||||||
<IconButton aria-label="left-arrow" colorScheme="purple"
|
<IconButton aria-label="left-arrow" colorScheme="purple"
|
||||||
borderRadius="full" onClick={handleClickPrevious}>
|
borderRadius="full" onClick={handleClickPrevious}>
|
||||||
<BiLeftArrowAlt/>
|
<BiLeftArrowAlt/>
|
||||||
@@ -38,6 +38,7 @@ const Carousel = ({images}: Props) => {
|
|||||||
borderRadius="full" onClick={handleClickNext}>
|
borderRadius="full" onClick={handleClickNext}>
|
||||||
<BiRightArrowAlt/>
|
<BiRightArrowAlt/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
CardBody,
|
CardBody,
|
||||||
IconButton,
|
IconButton,
|
||||||
Heading,
|
Heading,
|
||||||
Box
|
Box, CardHeader,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import Carousel from '../../../Carousel';
|
import Carousel from '../../../Carousel';
|
||||||
import {BiHeart} from 'react-icons/bi';
|
import {BiHeart} from 'react-icons/bi';
|
||||||
@@ -27,7 +27,9 @@ export default function CardUser(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card maxW="md" borderRadius={'1rem'} overflow={'hidden'}>
|
<Card maxW="md" borderRadius={'1rem'} overflow={'hidden'}>
|
||||||
<Carousel images={interestingUser.images}/>
|
<CardHeader>
|
||||||
|
<Carousel borderRadius={"1rem"} images={interestingUser.images}/>
|
||||||
|
</CardHeader>
|
||||||
|
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Flex justify={'space-between'} mb={'20px'}>
|
<Flex justify={'space-between'} mb={'20px'}>
|
||||||
|
|||||||
Reference in New Issue
Block a user